diff --git a/README.md b/README.md index 7e8123568d27b35b0faeca22c78ab125a507a1bd..7d71e70d1ccb23e2f4da7076fae9be22f17a4d4e 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,8 @@ rename with the `.elf` extension! | Crate | Description | | ---- | --- | -| card10 | Helpers for implementing custom firmwares | | example | l0dable example | | l0dable | Helpers for building l0dables | -| max32665 | Peripheral Access Crate for implementing your own drivers | -| watchapp | Sample firmware | ## TODO diff --git a/card10/Cargo.toml b/card10/Cargo.toml deleted file mode 100644 index bb17ac1524c4cabe492e0a9c39fc01d577e0c51f..0000000000000000000000000000000000000000 --- a/card10/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -edition = "2018" -name = "card10" -version = "0.0.0" -authors = ["Astro <astro@spaceboyz.net>"] - -[dependencies] -max32665 = { path = "../max32665", features = ["rt"] } -cortex-m-rt = { version = "0.6", features = ["device"] } - -[build-dependencies] -cc = "1.0" diff --git a/card10/build.rs b/card10/build.rs deleted file mode 100644 index 19af34be5fb87a35eb7d0c39518b79c11fa19f42..0000000000000000000000000000000000000000 --- a/card10/build.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::env; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; - -fn main() { - println!("cargo:rerun-if-changed=build.rs"); - - let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); - File::create(out.join("memory.x")) - .unwrap() - .write_all(include_bytes!("memory.x")) - .unwrap(); - println!("cargo:rustc-link-search={}", out.display()); - println!("cargo:rerun-if-changed=memory.x"); - - cc::Build::new() - .target("thumbv7em-none-eabihf") - .compiler("arm-none-eabihf-gcc") - .define("TARGET", "MAX32665") - .define("TARGET_UC", "MAX32665") - .define("TARGET_LC", "max32665") - .define("TARGET_REV", "0x4131") - .define("BOARD", "card10") - .opt_level_str("s") - .debug(true) - .pic(false) - .include("../c/lib/card10") - .include("../c/lib/gfx") - .include("../c/lib/gfx/GUI_DEV") - .include("../c/lib/gfx/LCD") - .include("../c/lib/gfx/Fonts") - .include("../c/lib/vendor/Bosch/BHy1/driver/inc") - .include("../c/lib/vendor/Bosch/BHy1/examples/firmware") - .include("../c/lib/vendor/Bosch/BME680") - .include("../c/lib/vendor/Bosch/BMA400") - .include("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Include") - .include("../c/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include") - .include("../c/lib/sdk/Libraries/CMSIS/Include") - .include("../c/lib/sdk/Libraries/Boards/card10/Include") - .include("../c/lib/vendor/Maxim/MAX77650") - .include("../c/lib/sdk/Libraries/Boards/Include") - .file("../c/lib/card10/card10.c") - .file("../c/lib/card10/pb.c") - .file("../c/lib/card10/pmic.c") - .file("../c/lib/card10/portexpander.c") - .file("../c/lib/card10/leds.c") - .file("../c/lib/card10/bosch.c") - .file("../c/lib/card10/display.c") - .file("../c/lib/gfx/LCD/LCD_Driver.c") - .file("../c/lib/gfx/GUI_DEV/DEV_Config.c") - .file("../c/lib/gfx/GUI_DEV/GUI_Paint.c") - .file("../c/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/gpio.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/tmr.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/tmr_utils.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/rtc.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_delay.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_lock.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c") - .file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_pins.c") - .file("../c/lib/sdk/Libraries/Boards/card10/Source/board.c") - // .file("../c/lib/sdk/Libraries/Boards/Source/stdio.c") - .file("../c/lib/vendor/Bosch/BMA400/bma400.c") - .file("../c/lib/vendor/Bosch/BME680/bme680.c") - .file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy.c") - .file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy_uc_driver.c") - .file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy_support.c") - .file("../c/lib/vendor/Maxim/MAX77650/MAX77650-Arduino-Library.c") - .compile("card10"); -} diff --git a/card10/memory.x b/card10/memory.x deleted file mode 100644 index 665e9bc728ee46549f86688ac2c664c39993c951..0000000000000000000000000000000000000000 --- a/card10/memory.x +++ /dev/null @@ -1,15 +0,0 @@ -MEMORY { - SPIX (rx) : ORIGIN = 0x08000000, LENGTH = 128M - FLASH (rx) : ORIGIN = 0x10010000, LENGTH = 960k - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512k - SPID (r) : ORIGIN = 0x80000000, LENGTH = 512M -} - -SECTIONS -{ - /DISCARD/ : - { - /* cortex-m-rt's link.x drops only `.ARM.exidx.*` */ - *(.ARM.exidx); - } -} diff --git a/card10/src/lcd.rs b/card10/src/lcd.rs deleted file mode 100644 index c6e472560b3466ee784f90edf67cd405ce5502fb..0000000000000000000000000000000000000000 --- a/card10/src/lcd.rs +++ /dev/null @@ -1,30 +0,0 @@ -#[link(name = "card10")] -extern { - fn LCD_SetBacklight(brightness: usize); - fn LCD_Clear(color: usize); - fn LCD_ClearWindow(xstart: usize, ystart: usize, xend: usize, yend: usize, color: usize); - fn LCD_SetWindowColor(xstart: usize, ystart: usize, xend: usize, yend: usize, color: usize); - fn LCD_SetUWORD(x: usize, y: usize, color: usize); - fn LCD_Update(); -} - -pub const W: usize = 160; -pub const H: usize = 80; - -pub fn set_backlight(brightness: usize) { - unsafe { - LCD_SetBacklight(brightness); - } -} - -pub fn put_pixel(x: usize, y: usize, color: usize) { - unsafe { - LCD_SetUWORD(x, y, color); - } -} - -pub fn update() { - unsafe { - LCD_Update(); - } -} diff --git a/card10/src/leds.rs b/card10/src/leds.rs deleted file mode 100644 index 77ba78ddb827614cef2d6e3daa92cde3a404e534..0000000000000000000000000000000000000000 --- a/card10/src/leds.rs +++ /dev/null @@ -1,51 +0,0 @@ -#[link(name = "card10")] -extern { - fn leds_init(); - fn leds_update(); - fn leds_set_dim(led: u8,dim: u8); - fn leds_set(led: u8,r: u8,g: u8,b: u8); - fn leds_set_hsv(led: u8, h: f32, s: f32, v: f32); -} - -pub struct Leds; - -impl Leds { - pub fn new() -> Self { - unsafe { leds_init(); } - Leds - } - - pub fn len(&self) -> usize { - 15 - } - - pub fn led(&self, idx: usize) -> Led { - Led { idx } - } - - pub fn iter(&self) -> impl Iterator<Item=Led> { - (0..self.len()).map(|idx| Led { idx }) - } - - pub fn update(&self) { - unsafe { leds_update(); } - } -} - -pub struct Led { - idx: usize, -} - -impl Led { - pub fn set_dim(&self, dim: u8) { - unsafe { leds_set_dim(self.idx as u8, dim); } - } - - pub fn set(&self, r: u8, g: u8, b: u8) { - unsafe { leds_set(self.idx as u8, r, g, b); } - } - - pub fn set_hsv(&self, h: f32, s: f32, v: f32) { - unsafe { leds_set_hsv(self.idx as u8, h, s, v); } - } -} diff --git a/card10/src/lib.rs b/card10/src/lib.rs deleted file mode 100644 index 163ce14dc0a12ef10300559b4b625e5359f07ad2..0000000000000000000000000000000000000000 --- a/card10/src/lib.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![no_std] - -pub use max32665; -pub use cortex_m_rt as _; -pub use cortex_m_rt::entry; - -pub mod lcd; -pub mod leds; - -#[link(name = "card10")] -extern { - fn card10_init(); - fn card10_diag(); -} - -#[no_mangle] -pub extern "C" fn puts() { - /* Stub */ -} - -#[no_mangle] -pub extern "C" fn printf() { - /* Stub */ -} - -pub fn init() { - unsafe { - card10_init(); - card10_diag(); - } -} diff --git a/max32665/Cargo.toml b/max32665/Cargo.toml deleted file mode 100644 index a37e6ca05b8a4b59c68f5bd3fa133220b0172e8c..0000000000000000000000000000000000000000 --- a/max32665/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2018" -name = "max32665" -version = "0.0.0" -authors = ["Astro <astro@spaceboyz.net>"] -description = "Peripheral Access Crate for the Maxim-Integrated MAX32665" -keywords = ["cortex-m", "svd2rust", "no_std", "embedded"] -categories = ["embedded", "no-std"] -license = "MIT/Apache-2.0" - -[dependencies] -bare-metal = "0.2.4" -vcell = "0.1.0" -cortex-m = ">=0.5.8,<0.7" - -[dependencies.cortex-m-rt] -optional = true -version = "0.6.8" - -[package.metadata.docs.rs] -features = ['rt'] - -[features] -default = [] -rt = ["cortex-m-rt/device"] diff --git a/max32665/build.rs b/max32665/build.rs deleted file mode 100644 index 597923f508921809ff9e8563158f5f94b3713a66..0000000000000000000000000000000000000000 --- a/max32665/build.rs +++ /dev/null @@ -1,16 +0,0 @@ -use std::env; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; -fn main() { - if env::var_os("CARGO_FEATURE_RT").is_some() { - let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); - File::create(out.join("device.x")) - .unwrap() - .write_all(include_bytes!("device.x")) - .unwrap(); - println!("cargo:rustc-link-search={}", out.display()); - println!("cargo:rerun-if-changed=device.x"); - } - println!("cargo:rerun-if-changed=build.rs"); -} diff --git a/max32665/device.x b/max32665/device.x deleted file mode 100644 index c076c461e4cbf0dab28c0e8ecab27dee3db2d1ec..0000000000000000000000000000000000000000 --- a/max32665/device.x +++ /dev/null @@ -1,51 +0,0 @@ -PROVIDE(WDT0 = DefaultHandler); -PROVIDE(USB = DefaultHandler); -PROVIDE(RTC = DefaultHandler); -PROVIDE(TRNG = DefaultHandler); -PROVIDE(TMR0 = DefaultHandler); -PROVIDE(TMR1 = DefaultHandler); -PROVIDE(TMR2 = DefaultHandler); -PROVIDE(TMR3 = DefaultHandler); -PROVIDE(TMR4 = DefaultHandler); -PROVIDE(TMR5 = DefaultHandler); -PROVIDE(I2C0 = DefaultHandler); -PROVIDE(UART0 = DefaultHandler); -PROVIDE(UART1 = DefaultHandler); -PROVIDE(SPI17Y1 = DefaultHandler); -PROVIDE(SPI17Y2 = DefaultHandler); -PROVIDE(ADC = DefaultHandler); -PROVIDE(FLASH_CONTROLLER = DefaultHandler); -PROVIDE(GPIO0 = DefaultHandler); -PROVIDE(GPIO1 = DefaultHandler); -PROVIDE(GPIO2 = DefaultHandler); -PROVIDE(CRYPTO_ENGINE = DefaultHandler); -PROVIDE(DMA0 = DefaultHandler); -PROVIDE(DMA1 = DefaultHandler); -PROVIDE(DMA2 = DefaultHandler); -PROVIDE(DMA3 = DefaultHandler); -PROVIDE(UART2 = DefaultHandler); -PROVIDE(I2C1 = DefaultHandler); -PROVIDE(SPIXFC = DefaultHandler); -PROVIDE(WAKEUP_TIMER = DefaultHandler); -PROVIDE(SPI0 = DefaultHandler); -PROVIDE(WDT1 = DefaultHandler); -PROVIDE(PT = DefaultHandler); -PROVIDE(SMARTDMA = DefaultHandler); -PROVIDE(I2C2 = DefaultHandler); -PROVIDE(SDHC = DefaultHandler); -PROVIDE(ONEWIRE = DefaultHandler); -PROVIDE(DMA4 = DefaultHandler); -PROVIDE(DMA5 = DefaultHandler); -PROVIDE(DMA6 = DefaultHandler); -PROVIDE(DMA7 = DefaultHandler); -PROVIDE(DMA8 = DefaultHandler); -PROVIDE(DMA9 = DefaultHandler); -PROVIDE(DMA10 = DefaultHandler); -PROVIDE(DMA11 = DefaultHandler); -PROVIDE(DMA12 = DefaultHandler); -PROVIDE(DMA13 = DefaultHandler); -PROVIDE(DMA14 = DefaultHandler); -PROVIDE(DMA15 = DefaultHandler); -PROVIDE(HTIMER = DefaultHandler); -PROVIDE(HTMR1 = DefaultHandler); - diff --git a/max32665/src/lib.rs b/max32665/src/lib.rs deleted file mode 100644 index a1f7e6ceba016e6681ff3922156cd1915db69d00..0000000000000000000000000000000000000000 --- a/max32665/src/lib.rs +++ /dev/null @@ -1,231776 +0,0 @@ -#![doc = "Peripheral access API for MAX32665 microcontrollers (generated using svd2rust v0.14.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.14.0/svd2rust/#peripheral-api"] -#![deny(missing_docs)] -#![deny(warnings)] -#![allow(non_camel_case_types)] -#![no_std] -extern crate bare_metal; -extern crate cortex_m; -#[cfg(feature = "rt")] -extern crate cortex_m_rt; -extern crate vcell; -use core::marker::PhantomData; -use core::ops::Deref; -#[doc = r" Number available in the NVIC for configuring priority"] -pub const NVIC_PRIO_BITS: u8 = 3; -#[cfg(feature = "rt")] -extern "C" { - fn WDT0(); - fn USB(); - fn RTC(); - fn TRNG(); - fn TMR0(); - fn TMR1(); - fn TMR2(); - fn TMR3(); - fn TMR4(); - fn TMR5(); - fn I2C0(); - fn UART0(); - fn UART1(); - fn SPI17Y1(); - fn SPI17Y2(); - fn ADC(); - fn FLASH_CONTROLLER(); - fn GPIO0(); - fn GPIO1(); - fn GPIO2(); - fn CRYPTO_ENGINE(); - fn DMA0(); - fn DMA1(); - fn DMA2(); - fn DMA3(); - fn UART2(); - fn I2C1(); - fn SPIXFC(); - fn WAKEUP_TIMER(); - fn SPI0(); - fn WDT1(); - fn PT(); - fn SMARTDMA(); - fn I2C2(); - fn SDHC(); - fn ONEWIRE(); - fn DMA4(); - fn DMA5(); - fn DMA6(); - fn DMA7(); - fn DMA8(); - fn DMA9(); - fn DMA10(); - fn DMA11(); - fn DMA12(); - fn DMA13(); - fn DMA14(); - fn DMA15(); - fn HTIMER(); - fn HTMR1(); -} -#[doc(hidden)] -pub union Vector { - _handler: unsafe extern "C" fn(), - _reserved: u32, -} -#[cfg(feature = "rt")] -#[doc(hidden)] -#[link_section = ".vector_table.interrupts"] -#[no_mangle] -pub static __INTERRUPTS: [Vector; 95] = [ - Vector { _reserved: 0 }, - Vector { _handler: WDT0 }, - Vector { _handler: USB }, - Vector { _handler: RTC }, - Vector { _handler: TRNG }, - Vector { _handler: TMR0 }, - Vector { _handler: TMR1 }, - Vector { _handler: TMR2 }, - Vector { _handler: TMR3 }, - Vector { _handler: TMR4 }, - Vector { _handler: TMR5 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: I2C0 }, - Vector { _handler: UART0 }, - Vector { _handler: UART1 }, - Vector { _handler: SPI17Y1 }, - Vector { _handler: SPI17Y2 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: ADC }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { - _handler: FLASH_CONTROLLER, - }, - Vector { _handler: GPIO0 }, - Vector { _handler: GPIO1 }, - Vector { _handler: GPIO2 }, - Vector { - _handler: CRYPTO_ENGINE, - }, - Vector { _handler: DMA0 }, - Vector { _handler: DMA1 }, - Vector { _handler: DMA2 }, - Vector { _handler: DMA3 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: UART2 }, - Vector { _reserved: 0 }, - Vector { _handler: I2C1 }, - Vector { _reserved: 0 }, - Vector { _handler: SPIXFC }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { - _handler: WAKEUP_TIMER, - }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: SPI0 }, - Vector { _handler: WDT1 }, - Vector { _reserved: 0 }, - Vector { _handler: PT }, - Vector { _handler: SMARTDMA }, - Vector { _reserved: 0 }, - Vector { _handler: I2C2 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: SDHC }, - Vector { _handler: ONEWIRE }, - Vector { _handler: DMA4 }, - Vector { _handler: DMA5 }, - Vector { _handler: DMA6 }, - Vector { _handler: DMA7 }, - Vector { _handler: DMA8 }, - Vector { _handler: DMA9 }, - Vector { _handler: DMA10 }, - Vector { _handler: DMA11 }, - Vector { _handler: DMA12 }, - Vector { _handler: DMA13 }, - Vector { _handler: DMA14 }, - Vector { _handler: DMA15 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _reserved: 0 }, - Vector { _handler: HTIMER }, - Vector { _handler: HTMR1 }, -]; -#[doc = r" Enumeration of all the interrupts"] -#[derive(Copy, Clone, Debug)] -pub enum Interrupt { - #[doc = "1 - WDT0"] - WDT0, - #[doc = "2 - USB"] - USB, - #[doc = "3 - RTC interrupt."] - RTC, - #[doc = "4 - TRNG interrupt."] - TRNG, - #[doc = "5 - TMR0 IRQ"] - TMR0, - #[doc = "6 - TMR1 IRQ"] - TMR1, - #[doc = "7 - TMR2 IRQ"] - TMR2, - #[doc = "8 - TMR3 IRQ"] - TMR3, - #[doc = "9 - TMR4 IRQ"] - TMR4, - #[doc = "10 - TMR5 IRQ"] - TMR5, - #[doc = "13 - I2C0 IRQ"] - I2C0, - #[doc = "14 - UART0 IRQ"] - UART0, - #[doc = "15 - UART1 IRQ"] - UART1, - #[doc = "16 - SPI17Y1 IRQ"] - SPI17Y1, - #[doc = "17 - SPI17Y2 IRQ"] - SPI17Y2, - #[doc = "20 - ADC IRQ"] - ADC, - #[doc = "23 - Flash Controller interrupt."] - FLASH_CONTROLLER, - #[doc = "24 - GPIO0 interrupt."] - GPIO0, - #[doc = "25 - GPIO1 IRQ"] - GPIO1, - #[doc = "26 - GPIO2 IRQ"] - GPIO2, - #[doc = "27 - Crypto Engine interrupt."] - CRYPTO_ENGINE, - #[doc = "28 - DMA0"] - DMA0, - #[doc = "29 - DMA1"] - DMA1, - #[doc = "30 - DMA2"] - DMA2, - #[doc = "31 - DMA3"] - DMA3, - #[doc = "34 - UART2 IRQ"] - UART2, - #[doc = "36 - I2C1 IRQ"] - I2C1, - #[doc = "38 - SPIXFC IRQ"] - SPIXFC, - #[doc = "53 - Wakeup_Timer"] - WAKEUP_TIMER, - #[doc = "56 - SPI0"] - SPI0, - #[doc = "57 - WDT1 IRQ"] - WDT1, - #[doc = "59 - Pulse Train IRQ"] - PT, - #[doc = "60 - Smart DMA interrupt."] - SMARTDMA, - #[doc = "62 - I2C2 IRQ"] - I2C2, - #[doc = "66 - SDHC"] - SDHC, - #[doc = "67 - OneWire"] - ONEWIRE, - #[doc = "68 - DMA4"] - DMA4, - #[doc = "69 - DMA5"] - DMA5, - #[doc = "70 - DMA6"] - DMA6, - #[doc = "71 - DMA7"] - DMA7, - #[doc = "72 - DMA8"] - DMA8, - #[doc = "73 - DMA9"] - DMA9, - #[doc = "74 - DMA10"] - DMA10, - #[doc = "75 - DMA11"] - DMA11, - #[doc = "76 - DMA12"] - DMA12, - #[doc = "77 - DMA13"] - DMA13, - #[doc = "78 - DMA14"] - DMA14, - #[doc = "79 - DMA15"] - DMA15, - #[doc = "93 - HTimer interrupt."] - HTIMER, - #[doc = "94 - HTMR1 IRQ"] - HTMR1, -} -unsafe impl ::bare_metal::Nr for Interrupt { - #[inline] - fn nr(&self) -> u8 { - match *self { - Interrupt::WDT0 => 1, - Interrupt::USB => 2, - Interrupt::RTC => 3, - Interrupt::TRNG => 4, - Interrupt::TMR0 => 5, - Interrupt::TMR1 => 6, - Interrupt::TMR2 => 7, - Interrupt::TMR3 => 8, - Interrupt::TMR4 => 9, - Interrupt::TMR5 => 10, - Interrupt::I2C0 => 13, - Interrupt::UART0 => 14, - Interrupt::UART1 => 15, - Interrupt::SPI17Y1 => 16, - Interrupt::SPI17Y2 => 17, - Interrupt::ADC => 20, - Interrupt::FLASH_CONTROLLER => 23, - Interrupt::GPIO0 => 24, - Interrupt::GPIO1 => 25, - Interrupt::GPIO2 => 26, - Interrupt::CRYPTO_ENGINE => 27, - Interrupt::DMA0 => 28, - Interrupt::DMA1 => 29, - Interrupt::DMA2 => 30, - Interrupt::DMA3 => 31, - Interrupt::UART2 => 34, - Interrupt::I2C1 => 36, - Interrupt::SPIXFC => 38, - Interrupt::WAKEUP_TIMER => 53, - Interrupt::SPI0 => 56, - Interrupt::WDT1 => 57, - Interrupt::PT => 59, - Interrupt::SMARTDMA => 60, - Interrupt::I2C2 => 62, - Interrupt::SDHC => 66, - Interrupt::ONEWIRE => 67, - Interrupt::DMA4 => 68, - Interrupt::DMA5 => 69, - Interrupt::DMA6 => 70, - Interrupt::DMA7 => 71, - Interrupt::DMA8 => 72, - Interrupt::DMA9 => 73, - Interrupt::DMA10 => 74, - Interrupt::DMA11 => 75, - Interrupt::DMA12 => 76, - Interrupt::DMA13 => 77, - Interrupt::DMA14 => 78, - Interrupt::DMA15 => 79, - Interrupt::HTIMER => 93, - Interrupt::HTMR1 => 94, - } - } -} -#[cfg(feature = "rt")] -pub use self::Interrupt as interrupt; -pub use cortex_m::peripheral::Peripherals as CorePeripherals; -pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU}; -#[cfg(feature = "rt")] -pub use cortex_m_rt::interrupt; -#[doc = "10-bit Analog to Digital Converter"] -pub struct ADC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for ADC {} -impl ADC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const adc::RegisterBlock { - 0x4003_5000 as *const _ - } -} -impl Deref for ADC { - type Target = adc::RegisterBlock; - fn deref(&self) -> &adc::RegisterBlock { - unsafe { &*ADC::ptr() } - } -} -#[doc = "10-bit Analog to Digital Converter"] -pub mod adc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - ADC Control"] - pub ctrl: CTRL, - #[doc = "0x04 - ADC Status"] - pub status: STATUS, - #[doc = "0x08 - ADC Output Data"] - pub data: DATA, - #[doc = "0x0c - ADC Interrupt Control Register"] - pub intr: INTR, - #[doc = "0x10 - ADC Limit"] - pub limit: [LIMIT; 4], - } - #[doc = "ADC Control"] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Control"] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct STARTR { - bits: bool, - } - impl STARTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PWRR { - bits: bool, - } - impl PWRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct REFBUF_PWRR { - bits: bool, - } - impl REFBUF_PWRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CHGPUMP_PWRR { - bits: bool, - } - impl CHGPUMP_PWRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct REF_SCALER { - bits: bool, - } - impl REF_SCALER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCALER { - bits: bool, - } - impl SCALER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct REF_SELR { - bits: bool, - } - impl REF_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CLK_ENR { - bits: bool, - } - impl CLK_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH_SELR { - bits: u8, - } - impl CH_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct ADC_XREFR { - bits: bool, - } - impl ADC_XREFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_ALIGNR { - bits: bool, - } - impl DATA_ALIGNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _STARTW<'a> { - w: &'a mut W, - } - impl<'a> _STARTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PWRW<'a> { - w: &'a mut W, - } - impl<'a> _PWRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _REFBUF_PWRW<'a> { - w: &'a mut W, - } - impl<'a> _REFBUF_PWRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CHGPUMP_PWRW<'a> { - w: &'a mut W, - } - impl<'a> _CHGPUMP_PWRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _REF_SCALEW<'a> { - w: &'a mut W, - } - impl<'a> _REF_SCALEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCALEW<'a> { - w: &'a mut W, - } - impl<'a> _SCALEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _REF_SELW<'a> { - w: &'a mut W, - } - impl<'a> _REF_SELW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CLK_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CLK_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH_SELW<'a> { - w: &'a mut W, - } - impl<'a> _CH_SELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADC_XREFW<'a> { - w: &'a mut W, - } - impl<'a> _ADC_XREFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_ALIGNW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_ALIGNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Start ADC Conversion"] - #[inline] - pub fn start(&self) -> STARTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - STARTR { bits } - } - #[doc = "Bit 1 - ADC Power Up"] - #[inline] - pub fn pwr(&self) -> PWRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PWRR { bits } - } - #[doc = "Bit 3 - ADC Reference Buffer Power Up"] - #[inline] - pub fn refbuf_pwr(&self) -> REFBUF_PWRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - REFBUF_PWRR { bits } - } - #[doc = "Bit 4 - ADC Charge Pump Power Up"] - #[inline] - pub fn chgpump_pwr(&self) -> CHGPUMP_PWRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CHGPUMP_PWRR { bits } - } - #[doc = "Bit 8 - ADC Reference Scale"] - #[inline] - pub fn ref_scale(&self) -> REF_SCALER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - REF_SCALER { bits } - } - #[doc = "Bit 9 - ADC Scale"] - #[inline] - pub fn scale(&self) -> SCALER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCALER { bits } - } - #[doc = "Bit 10 - ADC Reference (VRef) Select (INTERNAL ONLY)"] - #[inline] - pub fn ref_sel(&self) -> REF_SELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - REF_SELR { bits } - } - #[doc = "Bit 11 - ADC Clock Enable"] - #[inline] - pub fn clk_en(&self) -> CLK_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CLK_ENR { bits } - } - #[doc = "Bits 12:15 - ADC Channel Select"] - #[inline] - pub fn ch_sel(&self) -> CH_SELR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CH_SELR { bits } - } - #[doc = "Bit 16 - Enable Use of ADC External Reference"] - #[inline] - pub fn adc_xref(&self) -> ADC_XREFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ADC_XREFR { bits } - } - #[doc = "Bit 17 - ADC Data Alignment Select"] - #[inline] - pub fn data_align(&self) -> DATA_ALIGNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DATA_ALIGNR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Start ADC Conversion"] - #[inline] - pub fn start(&mut self) -> _STARTW { - _STARTW { w: self } - } - #[doc = "Bit 1 - ADC Power Up"] - #[inline] - pub fn pwr(&mut self) -> _PWRW { - _PWRW { w: self } - } - #[doc = "Bit 3 - ADC Reference Buffer Power Up"] - #[inline] - pub fn refbuf_pwr(&mut self) -> _REFBUF_PWRW { - _REFBUF_PWRW { w: self } - } - #[doc = "Bit 4 - ADC Charge Pump Power Up"] - #[inline] - pub fn chgpump_pwr(&mut self) -> _CHGPUMP_PWRW { - _CHGPUMP_PWRW { w: self } - } - #[doc = "Bit 8 - ADC Reference Scale"] - #[inline] - pub fn ref_scale(&mut self) -> _REF_SCALEW { - _REF_SCALEW { w: self } - } - #[doc = "Bit 9 - ADC Scale"] - #[inline] - pub fn scale(&mut self) -> _SCALEW { - _SCALEW { w: self } - } - #[doc = "Bit 10 - ADC Reference (VRef) Select (INTERNAL ONLY)"] - #[inline] - pub fn ref_sel(&mut self) -> _REF_SELW { - _REF_SELW { w: self } - } - #[doc = "Bit 11 - ADC Clock Enable"] - #[inline] - pub fn clk_en(&mut self) -> _CLK_ENW { - _CLK_ENW { w: self } - } - #[doc = "Bits 12:15 - ADC Channel Select"] - #[inline] - pub fn ch_sel(&mut self) -> _CH_SELW { - _CH_SELW { w: self } - } - #[doc = "Bit 16 - Enable Use of ADC External Reference"] - #[inline] - pub fn adc_xref(&mut self) -> _ADC_XREFW { - _ADC_XREFW { w: self } - } - #[doc = "Bit 17 - ADC Data Alignment Select"] - #[inline] - pub fn data_align(&mut self) -> _DATA_ALIGNW { - _DATA_ALIGNW { w: self } - } - } - } - #[doc = "ADC Status"] - pub struct STATUS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Status"] - pub mod status { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::STATUS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ACTIVER { - bits: bool, - } - impl ACTIVER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AFE_PWR_UP_ACTIVER { - bits: bool, - } - impl AFE_PWR_UP_ACTIVER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OVERFLOWR { - bits: bool, - } - impl OVERFLOWR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ADC Conversion In Progress"] - #[inline] - pub fn active(&self) -> ACTIVER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ACTIVER { bits } - } - #[doc = "Bit 2 - AFE Power Up Delay Active"] - #[inline] - pub fn afe_pwr_up_active(&self) -> AFE_PWR_UP_ACTIVER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AFE_PWR_UP_ACTIVER { bits } - } - #[doc = "Bit 3 - ADC Overflow"] - #[inline] - pub fn overflow(&self) -> OVERFLOWR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OVERFLOWR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "ADC Output Data"] - pub struct DATA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Output Data"] - pub mod data { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DATA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADC_DATAR { - bits: u16, - } - impl ADC_DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - ADC Converted Sample Data Output"] - #[inline] - pub fn adc_data(&self) -> ADC_DATAR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - ADC_DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "ADC Interrupt Control Register"] - pub struct INTR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Interrupt Control Register"] - pub mod intr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DONE_IER { - bits: bool, - } - impl DONE_IER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct REF_READY_IER { - bits: bool, - } - impl REF_READY_IER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HI_LIMIT_IER { - bits: bool, - } - impl HI_LIMIT_IER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LO_LIMIT_IER { - bits: bool, - } - impl LO_LIMIT_IER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OVERFLOW_IER { - bits: bool, - } - impl OVERFLOW_IER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DONE_IFR { - bits: bool, - } - impl DONE_IFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct REF_READY_IFR { - bits: bool, - } - impl REF_READY_IFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HI_LIMIT_IFR { - bits: bool, - } - impl HI_LIMIT_IFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LO_LIMIT_IFR { - bits: bool, - } - impl LO_LIMIT_IFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OVERFLOW_IFR { - bits: bool, - } - impl OVERFLOW_IFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PENDINGR { - bits: bool, - } - impl PENDINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _DONE_IEW<'a> { - w: &'a mut W, - } - impl<'a> _DONE_IEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _REF_READY_IEW<'a> { - w: &'a mut W, - } - impl<'a> _REF_READY_IEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HI_LIMIT_IEW<'a> { - w: &'a mut W, - } - impl<'a> _HI_LIMIT_IEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LO_LIMIT_IEW<'a> { - w: &'a mut W, - } - impl<'a> _LO_LIMIT_IEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OVERFLOW_IEW<'a> { - w: &'a mut W, - } - impl<'a> _OVERFLOW_IEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DONE_IFW<'a> { - w: &'a mut W, - } - impl<'a> _DONE_IFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _REF_READY_IFW<'a> { - w: &'a mut W, - } - impl<'a> _REF_READY_IFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HI_LIMIT_IFW<'a> { - w: &'a mut W, - } - impl<'a> _HI_LIMIT_IFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LO_LIMIT_IFW<'a> { - w: &'a mut W, - } - impl<'a> _LO_LIMIT_IFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OVERFLOW_IFW<'a> { - w: &'a mut W, - } - impl<'a> _OVERFLOW_IFW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ADC Done Interrupt Enable"] - #[inline] - pub fn done_ie(&self) -> DONE_IER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DONE_IER { bits } - } - #[doc = "Bit 1 - ADC Reference Ready Interrupt Enable"] - #[inline] - pub fn ref_ready_ie(&self) -> REF_READY_IER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - REF_READY_IER { bits } - } - #[doc = "Bit 2 - ADC Hi Limit Monitor Interrupt Enable"] - #[inline] - pub fn hi_limit_ie(&self) -> HI_LIMIT_IER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HI_LIMIT_IER { bits } - } - #[doc = "Bit 3 - ADC Lo Limit Monitor Interrupt Enable"] - #[inline] - pub fn lo_limit_ie(&self) -> LO_LIMIT_IER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LO_LIMIT_IER { bits } - } - #[doc = "Bit 4 - ADC Overflow Interrupt Enable"] - #[inline] - pub fn overflow_ie(&self) -> OVERFLOW_IER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OVERFLOW_IER { bits } - } - #[doc = "Bit 16 - ADC Done Interrupt Flag"] - #[inline] - pub fn done_if(&self) -> DONE_IFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DONE_IFR { bits } - } - #[doc = "Bit 17 - ADC Reference Ready Interrupt Flag"] - #[inline] - pub fn ref_ready_if(&self) -> REF_READY_IFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - REF_READY_IFR { bits } - } - #[doc = "Bit 18 - ADC Hi Limit Monitor Interrupt Flag"] - #[inline] - pub fn hi_limit_if(&self) -> HI_LIMIT_IFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HI_LIMIT_IFR { bits } - } - #[doc = "Bit 19 - ADC Lo Limit Monitor Interrupt Flag"] - #[inline] - pub fn lo_limit_if(&self) -> LO_LIMIT_IFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LO_LIMIT_IFR { bits } - } - #[doc = "Bit 20 - ADC Overflow Interrupt Flag"] - #[inline] - pub fn overflow_if(&self) -> OVERFLOW_IFR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OVERFLOW_IFR { bits } - } - #[doc = "Bit 22 - ADC Interrupt Pending Status"] - #[inline] - pub fn pending(&self) -> PENDINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PENDINGR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ADC Done Interrupt Enable"] - #[inline] - pub fn done_ie(&mut self) -> _DONE_IEW { - _DONE_IEW { w: self } - } - #[doc = "Bit 1 - ADC Reference Ready Interrupt Enable"] - #[inline] - pub fn ref_ready_ie(&mut self) -> _REF_READY_IEW { - _REF_READY_IEW { w: self } - } - #[doc = "Bit 2 - ADC Hi Limit Monitor Interrupt Enable"] - #[inline] - pub fn hi_limit_ie(&mut self) -> _HI_LIMIT_IEW { - _HI_LIMIT_IEW { w: self } - } - #[doc = "Bit 3 - ADC Lo Limit Monitor Interrupt Enable"] - #[inline] - pub fn lo_limit_ie(&mut self) -> _LO_LIMIT_IEW { - _LO_LIMIT_IEW { w: self } - } - #[doc = "Bit 4 - ADC Overflow Interrupt Enable"] - #[inline] - pub fn overflow_ie(&mut self) -> _OVERFLOW_IEW { - _OVERFLOW_IEW { w: self } - } - #[doc = "Bit 16 - ADC Done Interrupt Flag"] - #[inline] - pub fn done_if(&mut self) -> _DONE_IFW { - _DONE_IFW { w: self } - } - #[doc = "Bit 17 - ADC Reference Ready Interrupt Flag"] - #[inline] - pub fn ref_ready_if(&mut self) -> _REF_READY_IFW { - _REF_READY_IFW { w: self } - } - #[doc = "Bit 18 - ADC Hi Limit Monitor Interrupt Flag"] - #[inline] - pub fn hi_limit_if(&mut self) -> _HI_LIMIT_IFW { - _HI_LIMIT_IFW { w: self } - } - #[doc = "Bit 19 - ADC Lo Limit Monitor Interrupt Flag"] - #[inline] - pub fn lo_limit_if(&mut self) -> _LO_LIMIT_IFW { - _LO_LIMIT_IFW { w: self } - } - #[doc = "Bit 20 - ADC Overflow Interrupt Flag"] - #[inline] - pub fn overflow_if(&mut self) -> _OVERFLOW_IFW { - _OVERFLOW_IFW { w: self } - } - } - } - #[doc = "ADC Limit"] - pub struct LIMIT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Limit"] - pub mod limit { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LIMIT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CH_LO_LIMITR { - bits: u16, - } - impl CH_LO_LIMITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CH_HI_LIMITR { - bits: u16, - } - impl CH_HI_LIMITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CH_SELR { - bits: u8, - } - impl CH_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CH_LO_LIMIT_ENR { - bits: bool, - } - impl CH_LO_LIMIT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH_HI_LIMIT_ENR { - bits: bool, - } - impl CH_HI_LIMIT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CH_LO_LIMITW<'a> { - w: &'a mut W, - } - impl<'a> _CH_LO_LIMITW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH_HI_LIMITW<'a> { - w: &'a mut W, - } - impl<'a> _CH_HI_LIMITW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH_SELW<'a> { - w: &'a mut W, - } - impl<'a> _CH_SELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH_LO_LIMIT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CH_LO_LIMIT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH_HI_LIMIT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CH_HI_LIMIT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:9 - Low Limit Threshold"] - #[inline] - pub fn ch_lo_limit(&self) -> CH_LO_LIMITR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CH_LO_LIMITR { bits } - } - #[doc = "Bits 12:21 - High Limit Threshold"] - #[inline] - pub fn ch_hi_limit(&self) -> CH_HI_LIMITR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CH_HI_LIMITR { bits } - } - #[doc = "Bits 24:27 - ADC Channel Select"] - #[inline] - pub fn ch_sel(&self) -> CH_SELR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CH_SELR { bits } - } - #[doc = "Bit 28 - Low Limit Monitoring Enable"] - #[inline] - pub fn ch_lo_limit_en(&self) -> CH_LO_LIMIT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH_LO_LIMIT_ENR { bits } - } - #[doc = "Bit 29 - High Limit Monitoring Enable"] - #[inline] - pub fn ch_hi_limit_en(&self) -> CH_HI_LIMIT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH_HI_LIMIT_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:9 - Low Limit Threshold"] - #[inline] - pub fn ch_lo_limit(&mut self) -> _CH_LO_LIMITW { - _CH_LO_LIMITW { w: self } - } - #[doc = "Bits 12:21 - High Limit Threshold"] - #[inline] - pub fn ch_hi_limit(&mut self) -> _CH_HI_LIMITW { - _CH_HI_LIMITW { w: self } - } - #[doc = "Bits 24:27 - ADC Channel Select"] - #[inline] - pub fn ch_sel(&mut self) -> _CH_SELW { - _CH_SELW { w: self } - } - #[doc = "Bit 28 - Low Limit Monitoring Enable"] - #[inline] - pub fn ch_lo_limit_en(&mut self) -> _CH_LO_LIMIT_ENW { - _CH_LO_LIMIT_ENW { w: self } - } - #[doc = "Bit 29 - High Limit Monitoring Enable"] - #[inline] - pub fn ch_hi_limit_en(&mut self) -> _CH_HI_LIMIT_ENW { - _CH_HI_LIMIT_ENW { w: self } - } - } - } -} -#[doc = "Misc Control."] -pub struct MCR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for MCR {} -impl MCR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const mcr::RegisterBlock { - 0x4000_6c00 as *const _ - } -} -impl Deref for MCR { - type Target = mcr::RegisterBlock; - fn deref(&self) -> &mcr::RegisterBlock { - unsafe { &*MCR::ptr() } - } -} -#[doc = "Misc Control."] -pub mod mcr { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - ECC Enable Register"] - pub eccen: ECCEN, - #[doc = "0x04 - 96MHz Oscillator Trim Register"] - pub hirc96m: HIRC96M, - #[doc = "0x08 - GPIOOUT_EN Function Enable Register"] - pub outen: OUTEN, - #[doc = "0x0c - Comparator Power Control Register"] - pub aincomp: AINCOMP, - #[doc = "0x10 - Misc Power State Control Register"] - pub ctrl: CTRL, - } - #[doc = "ECC Enable Register"] - pub struct ECCEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ECC Enable Register"] - pub mod eccen { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ECCEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SYSRAMECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYSRAMECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SYSRAMECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYSRAMECCENR::DIS => false, - SYSRAMECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYSRAMECCENR { - match value { - false => SYSRAMECCENR::DIS, - true => SYSRAMECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYSRAMECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SYSRAMECCENR::EN - } - } - #[doc = "Possible values of the field `IC0ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC0ECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl IC0ECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - IC0ECCENR::DIS => false, - IC0ECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> IC0ECCENR { - match value { - false => IC0ECCENR::DIS, - true => IC0ECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == IC0ECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == IC0ECCENR::EN - } - } - #[doc = "Possible values of the field `IC1ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC1ECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl IC1ECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - IC1ECCENR::DIS => false, - IC1ECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> IC1ECCENR { - match value { - false => IC1ECCENR::DIS, - true => IC1ECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == IC1ECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == IC1ECCENR::EN - } - } - #[doc = "Possible values of the field `ICXIPECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICXIPECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl ICXIPECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ICXIPECCENR::DIS => false, - ICXIPECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ICXIPECCENR { - match value { - false => ICXIPECCENR::DIS, - true => ICXIPECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ICXIPECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ICXIPECCENR::EN - } - } - #[doc = "Possible values of the field `FL0ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL0ECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl FL0ECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FL0ECCENR::DIS => false, - FL0ECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FL0ECCENR { - match value { - false => FL0ECCENR::DIS, - true => FL0ECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FL0ECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FL0ECCENR::EN - } - } - #[doc = "Possible values of the field `FL1ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL1ECCENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl FL1ECCENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FL1ECCENR::DIS => false, - FL1ECCENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FL1ECCENR { - match value { - false => FL1ECCENR::DIS, - true => FL1ECCENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FL1ECCENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FL1ECCENR::EN - } - } - #[doc = "Values that can be written to the field `SYSRAMECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYSRAMECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SYSRAMECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYSRAMECCENW::DIS => false, - SYSRAMECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SYSRAMECCENW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAMECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYSRAMECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYSRAMECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SYSRAMECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `IC0ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC0ECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl IC0ECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - IC0ECCENW::DIS => false, - IC0ECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _IC0ECCENW<'a> { - w: &'a mut W, - } - impl<'a> _IC0ECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: IC0ECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(IC0ECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(IC0ECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `IC1ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC1ECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl IC1ECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - IC1ECCENW::DIS => false, - IC1ECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _IC1ECCENW<'a> { - w: &'a mut W, - } - impl<'a> _IC1ECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: IC1ECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(IC1ECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(IC1ECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ICXIPECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICXIPECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl ICXIPECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ICXIPECCENW::DIS => false, - ICXIPECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ICXIPECCENW<'a> { - w: &'a mut W, - } - impl<'a> _ICXIPECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ICXIPECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ICXIPECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ICXIPECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FL0ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL0ECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl FL0ECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FL0ECCENW::DIS => false, - FL0ECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FL0ECCENW<'a> { - w: &'a mut W, - } - impl<'a> _FL0ECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FL0ECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FL0ECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FL0ECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FL1ECCEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL1ECCENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl FL1ECCENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FL1ECCENW::DIS => false, - FL1ECCENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FL1ECCENW<'a> { - w: &'a mut W, - } - impl<'a> _FL1ECCENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FL1ECCENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FL1ECCENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FL1ECCENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ECC System RAM Enable."] - #[inline] - pub fn sysrameccen(&self) -> SYSRAMECCENR { - SYSRAMECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Icache0 ECC Enable."] - #[inline] - pub fn ic0eccen(&self) -> IC0ECCENR { - IC0ECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Icache1 ECC Enable."] - #[inline] - pub fn ic1eccen(&self) -> IC1ECCENR { - IC1ECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - IcacheXIP ECC Enable."] - #[inline] - pub fn icxipeccen(&self) -> ICXIPECCENR { - ICXIPECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Flash0 ECC Enable."] - #[inline] - pub fn fl0eccen(&self) -> FL0ECCENR { - FL0ECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Flash1 ECC Enable."] - #[inline] - pub fn fl1eccen(&self) -> FL1ECCENR { - FL1ECCENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ECC System RAM Enable."] - #[inline] - pub fn sysrameccen(&mut self) -> _SYSRAMECCENW { - _SYSRAMECCENW { w: self } - } - #[doc = "Bit 8 - Icache0 ECC Enable."] - #[inline] - pub fn ic0eccen(&mut self) -> _IC0ECCENW { - _IC0ECCENW { w: self } - } - #[doc = "Bit 9 - Icache1 ECC Enable."] - #[inline] - pub fn ic1eccen(&mut self) -> _IC1ECCENW { - _IC1ECCENW { w: self } - } - #[doc = "Bit 10 - IcacheXIP ECC Enable."] - #[inline] - pub fn icxipeccen(&mut self) -> _ICXIPECCENW { - _ICXIPECCENW { w: self } - } - #[doc = "Bit 11 - Flash0 ECC Enable."] - #[inline] - pub fn fl0eccen(&mut self) -> _FL0ECCENW { - _FL0ECCENW { w: self } - } - #[doc = "Bit 12 - Flash1 ECC Enable."] - #[inline] - pub fn fl1eccen(&mut self) -> _FL1ECCENW { - _FL1ECCENW { w: self } - } - } - } - #[doc = "96MHz Oscillator Trim Register"] - pub struct HIRC96M { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "96MHz Oscillator Trim Register"] - pub mod hirc96m { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HIRC96M { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct HIRC96MTRR { - bits: u8, - } - impl HIRC96MTRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _HIRC96MTRW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC96MTRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Allows User to Trim 96MHz Oscillator"] - #[inline] - pub fn hirc96mtr(&self) -> HIRC96MTRR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - HIRC96MTRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Allows User to Trim 96MHz Oscillator"] - #[inline] - pub fn hirc96mtr(&mut self) -> _HIRC96MTRW { - _HIRC96MTRW { w: self } - } - } - } - #[doc = "GPIOOUT_EN Function Enable Register"] - pub struct OUTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIOOUT_EN Function Enable Register"] - pub mod outen { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SQWOUT0EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQWOUT0ENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SQWOUT0ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SQWOUT0ENR::DIS => false, - SQWOUT0ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SQWOUT0ENR { - match value { - false => SQWOUT0ENR::DIS, - true => SQWOUT0ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SQWOUT0ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SQWOUT0ENR::EN - } - } - #[doc = "Possible values of the field `SQWOUT1EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQWOUT1ENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SQWOUT1ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SQWOUT1ENR::DIS => false, - SQWOUT1ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SQWOUT1ENR { - match value { - false => SQWOUT1ENR::DIS, - true => SQWOUT1ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SQWOUT1ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SQWOUT1ENR::EN - } - } - #[doc = "Possible values of the field `PDOWNOUT0EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PDOWNOUT0ENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl PDOWNOUT0ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PDOWNOUT0ENR::DIS => false, - PDOWNOUT0ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PDOWNOUT0ENR { - match value { - false => PDOWNOUT0ENR::DIS, - true => PDOWNOUT0ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PDOWNOUT0ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PDOWNOUT0ENR::EN - } - } - #[doc = "Possible values of the field `PDOWNOUT1EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PDOWNOUT1ENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl PDOWNOUT1ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PDOWNOUT1ENR::DIS => false, - PDOWNOUT1ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PDOWNOUT1ENR { - match value { - false => PDOWNOUT1ENR::DIS, - true => PDOWNOUT1ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PDOWNOUT1ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PDOWNOUT1ENR::EN - } - } - #[doc = "Values that can be written to the field `SQWOUT0EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQWOUT0ENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SQWOUT0ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SQWOUT0ENW::DIS => false, - SQWOUT0ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SQWOUT0ENW<'a> { - w: &'a mut W, - } - impl<'a> _SQWOUT0ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SQWOUT0ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SQWOUT0ENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SQWOUT0ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SQWOUT1EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQWOUT1ENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl SQWOUT1ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SQWOUT1ENW::DIS => false, - SQWOUT1ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SQWOUT1ENW<'a> { - w: &'a mut W, - } - impl<'a> _SQWOUT1ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SQWOUT1ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SQWOUT1ENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SQWOUT1ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PDOWNOUT0EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PDOWNOUT0ENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl PDOWNOUT0ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PDOWNOUT0ENW::DIS => false, - PDOWNOUT0ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PDOWNOUT0ENW<'a> { - w: &'a mut W, - } - impl<'a> _PDOWNOUT0ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PDOWNOUT0ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PDOWNOUT0ENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PDOWNOUT0ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PDOWNOUT1EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PDOWNOUT1ENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl PDOWNOUT1ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PDOWNOUT1ENW::DIS => false, - PDOWNOUT1ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PDOWNOUT1ENW<'a> { - w: &'a mut W, - } - impl<'a> _PDOWNOUT1ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PDOWNOUT1ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PDOWNOUT1ENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PDOWNOUT1ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allows SQWOUT on GPIO0_19"] - #[inline] - pub fn sqwout0en(&self) -> SQWOUT0ENR { - SQWOUT0ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allows SQWOUT on GPIO0_27"] - #[inline] - pub fn sqwout1en(&self) -> SQWOUT1ENR { - SQWOUT1ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allows PDOWN on GPIO0_18"] - #[inline] - pub fn pdownout0en(&self) -> PDOWNOUT0ENR { - PDOWNOUT0ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allows PDOWN on GPIO0_26"] - #[inline] - pub fn pdownout1en(&self) -> PDOWNOUT1ENR { - PDOWNOUT1ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allows SQWOUT on GPIO0_19"] - #[inline] - pub fn sqwout0en(&mut self) -> _SQWOUT0ENW { - _SQWOUT0ENW { w: self } - } - #[doc = "Bit 1 - Allows SQWOUT on GPIO0_27"] - #[inline] - pub fn sqwout1en(&mut self) -> _SQWOUT1ENW { - _SQWOUT1ENW { w: self } - } - #[doc = "Bit 2 - Allows PDOWN on GPIO0_18"] - #[inline] - pub fn pdownout0en(&mut self) -> _PDOWNOUT0ENW { - _PDOWNOUT0ENW { w: self } - } - #[doc = "Bit 3 - Allows PDOWN on GPIO0_26"] - #[inline] - pub fn pdownout1en(&mut self) -> _PDOWNOUT1ENW { - _PDOWNOUT1ENW { w: self } - } - } - } - #[doc = "Comparator Power Control Register"] - pub struct AINCOMP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Comparator Power Control Register"] - pub mod aincomp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AINCOMP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `AINCOMP0PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP0PDR { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP0PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AINCOMP0PDR::ON => false, - AINCOMP0PDR::OFF => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AINCOMP0PDR { - match value { - false => AINCOMP0PDR::ON, - true => AINCOMP0PDR::OFF, - } - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == AINCOMP0PDR::ON - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == AINCOMP0PDR::OFF - } - } - #[doc = "Possible values of the field `AINCOMP1PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP1PDR { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP1PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AINCOMP1PDR::ON => false, - AINCOMP1PDR::OFF => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AINCOMP1PDR { - match value { - false => AINCOMP1PDR::ON, - true => AINCOMP1PDR::OFF, - } - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == AINCOMP1PDR::ON - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == AINCOMP1PDR::OFF - } - } - #[doc = "Possible values of the field `AINCOMP2PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP2PDR { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP2PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AINCOMP2PDR::ON => false, - AINCOMP2PDR::OFF => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AINCOMP2PDR { - match value { - false => AINCOMP2PDR::ON, - true => AINCOMP2PDR::OFF, - } - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == AINCOMP2PDR::ON - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == AINCOMP2PDR::OFF - } - } - #[doc = "Possible values of the field `AINCOMP3PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP3PDR { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP3PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AINCOMP3PDR::ON => false, - AINCOMP3PDR::OFF => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AINCOMP3PDR { - match value { - false => AINCOMP3PDR::ON, - true => AINCOMP3PDR::OFF, - } - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == AINCOMP3PDR::ON - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == AINCOMP3PDR::OFF - } - } - #[doc = r" Value of the field"] - pub struct AINCOMPHYSTR { - bits: u8, - } - impl AINCOMPHYSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `AINCOMP0PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP0PDW { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP0PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AINCOMP0PDW::ON => false, - AINCOMP0PDW::OFF => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AINCOMP0PDW<'a> { - w: &'a mut W, - } - impl<'a> _AINCOMP0PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AINCOMP0PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "power on"] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(AINCOMP0PDW::ON) - } - #[doc = "power off"] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(AINCOMP0PDW::OFF) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AINCOMP1PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP1PDW { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP1PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AINCOMP1PDW::ON => false, - AINCOMP1PDW::OFF => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AINCOMP1PDW<'a> { - w: &'a mut W, - } - impl<'a> _AINCOMP1PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AINCOMP1PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "power on"] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(AINCOMP1PDW::ON) - } - #[doc = "power off"] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(AINCOMP1PDW::OFF) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AINCOMP2PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP2PDW { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP2PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AINCOMP2PDW::ON => false, - AINCOMP2PDW::OFF => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AINCOMP2PDW<'a> { - w: &'a mut W, - } - impl<'a> _AINCOMP2PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AINCOMP2PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "power on"] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(AINCOMP2PDW::ON) - } - #[doc = "power off"] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(AINCOMP2PDW::OFF) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AINCOMP3PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AINCOMP3PDW { - #[doc = "power on"] - ON, - #[doc = "power off"] - OFF, - } - impl AINCOMP3PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AINCOMP3PDW::ON => false, - AINCOMP3PDW::OFF => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AINCOMP3PDW<'a> { - w: &'a mut W, - } - impl<'a> _AINCOMP3PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AINCOMP3PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "power on"] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(AINCOMP3PDW::ON) - } - #[doc = "power off"] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(AINCOMP3PDW::OFF) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AINCOMPHYSTW<'a> { - w: &'a mut W, - } - impl<'a> _AINCOMPHYSTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Power Down AIN Comp0"] - #[inline] - pub fn aincomp0pd(&self) -> AINCOMP0PDR { - AINCOMP0PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Power Down AIN Comp1"] - #[inline] - pub fn aincomp1pd(&self) -> AINCOMP1PDR { - AINCOMP1PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Power Down AIN Comp2"] - #[inline] - pub fn aincomp2pd(&self) -> AINCOMP2PDR { - AINCOMP2PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Power Down AIN Comp3"] - #[inline] - pub fn aincomp3pd(&self) -> AINCOMP3PDR { - AINCOMP3PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 4:5 - Set Hysteresis on Analog Comparators"] - #[inline] - pub fn aincomphyst(&self) -> AINCOMPHYSTR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - AINCOMPHYSTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Power Down AIN Comp0"] - #[inline] - pub fn aincomp0pd(&mut self) -> _AINCOMP0PDW { - _AINCOMP0PDW { w: self } - } - #[doc = "Bit 1 - Power Down AIN Comp1"] - #[inline] - pub fn aincomp1pd(&mut self) -> _AINCOMP1PDW { - _AINCOMP1PDW { w: self } - } - #[doc = "Bit 2 - Power Down AIN Comp2"] - #[inline] - pub fn aincomp2pd(&mut self) -> _AINCOMP2PDW { - _AINCOMP2PDW { w: self } - } - #[doc = "Bit 3 - Power Down AIN Comp3"] - #[inline] - pub fn aincomp3pd(&mut self) -> _AINCOMP3PDW { - _AINCOMP3PDW { w: self } - } - #[doc = "Bits 4:5 - Set Hysteresis on Analog Comparators"] - #[inline] - pub fn aincomphyst(&mut self) -> _AINCOMPHYSTW { - _AINCOMPHYSTW { w: self } - } - } - } - #[doc = "Misc Power State Control Register"] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Misc Power State Control Register"] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `VDDCSWEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDCSWENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl VDDCSWENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDCSWENR::DIS => false, - VDDCSWENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDCSWENR { - match value { - false => VDDCSWENR::DIS, - true => VDDCSWENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDCSWENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDCSWENR::EN - } - } - #[doc = r" Value of the field"] - pub struct VDDCSWR { - bits: u8, - } - impl VDDCSWR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `USBSWEN_N`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBSWEN_NR { - #[doc = "USB SW off in LP modes"] - OFF, - #[doc = "USB SW On"] - ON, - } - impl USBSWEN_NR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBSWEN_NR::OFF => true, - USBSWEN_NR::ON => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBSWEN_NR { - match value { - true => USBSWEN_NR::OFF, - false => USBSWEN_NR::ON, - } - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == USBSWEN_NR::OFF - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == USBSWEN_NR::ON - } - } - #[doc = "Possible values of the field `BUCKCLKSCALEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUCKCLKSCALENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl BUCKCLKSCALENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUCKCLKSCALENR::DIS => false, - BUCKCLKSCALENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUCKCLKSCALENR { - match value { - false => BUCKCLKSCALENR::DIS, - true => BUCKCLKSCALENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BUCKCLKSCALENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BUCKCLKSCALENR::EN - } - } - #[doc = "Possible values of the field `P1M`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum P1MR { - #[doc = "1MOhm Pullup"] - _1M, - #[doc = "25kOhm Pullup."] - _25K, - } - impl P1MR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - P1MR::_1M => false, - P1MR::_25K => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> P1MR { - match value { - false => P1MR::_1M, - true => P1MR::_25K, - } - } - #[doc = "Checks if the value of the field is `_1M`"] - #[inline] - pub fn is_1m(&self) -> bool { - *self == P1MR::_1M - } - #[doc = "Checks if the value of the field is `_25K`"] - #[inline] - pub fn is_25k(&self) -> bool { - *self == P1MR::_25K - } - } - #[doc = r" Value of the field"] - pub struct VDDIOH_SELR { - bits: bool, - } - impl VDDIOH_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `VDDCSWEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDCSWENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl VDDCSWENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDCSWENW::DIS => false, - VDDCSWENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDCSWENW<'a> { - w: &'a mut W, - } - impl<'a> _VDDCSWENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDCSWENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDCSWENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDCSWENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VDDCSWW<'a> { - w: &'a mut W, - } - impl<'a> _VDDCSWW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBSWEN_N`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBSWEN_NW { - #[doc = "USB SW off in LP modes"] - OFF, - #[doc = "USB SW On"] - ON, - } - impl USBSWEN_NW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBSWEN_NW::OFF => true, - USBSWEN_NW::ON => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBSWEN_NW<'a> { - w: &'a mut W, - } - impl<'a> _USBSWEN_NW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBSWEN_NW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "USB SW off in LP modes"] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(USBSWEN_NW::OFF) - } - #[doc = "USB SW On"] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(USBSWEN_NW::ON) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BUCKCLKSCALEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUCKCLKSCALENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl BUCKCLKSCALENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BUCKCLKSCALENW::DIS => false, - BUCKCLKSCALENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BUCKCLKSCALENW<'a> { - w: &'a mut W, - } - impl<'a> _BUCKCLKSCALENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BUCKCLKSCALENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BUCKCLKSCALENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BUCKCLKSCALENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `P1M`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum P1MW { - #[doc = "1MOhm Pullup"] - _1M, - #[doc = "25kOhm Pullup."] - _25K, - } - impl P1MW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - P1MW::_1M => false, - P1MW::_25K => true, - } - } - } - #[doc = r" Proxy"] - pub struct _P1MW<'a> { - w: &'a mut W, - } - impl<'a> _P1MW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: P1MW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "1MOhm Pullup"] - #[inline] - pub fn _1m(self) -> &'a mut W { - self.variant(P1MW::_1M) - } - #[doc = "25kOhm Pullup."] - #[inline] - pub fn _25k(self) -> &'a mut W { - self.variant(P1MW::_25K) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VDDIOH_SELW<'a> { - w: &'a mut W, - } - impl<'a> _VDDIOH_SELW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allows switching VDDC from VCOREA to VCOREB"] - #[inline] - pub fn vddcswen(&self) -> VDDCSWENR { - VDDCSWENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 1:2 - Controls switching of VCORE"] - #[inline] - pub fn vddcsw(&self) -> VDDCSWR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - VDDCSWR { bits } - } - #[doc = "Bit 3 - USB Switch Control"] - #[inline] - pub fn usbswen_n(&self) -> USBSWEN_NR { - USBSWEN_NR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allows Dynamic scaling of SIMO clock, reduces power in LP Modes"] - #[inline] - pub fn buckclkscalen(&self) -> BUCKCLKSCALENR { - BUCKCLKSCALENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Enable the Reset Pad Pull Up Resistors"] - #[inline] - pub fn p1m(&self) -> P1MR { - P1MR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Error! Description not Found!"] - #[inline] - pub fn vddioh_sel(&self) -> VDDIOH_SELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - VDDIOH_SELR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allows switching VDDC from VCOREA to VCOREB"] - #[inline] - pub fn vddcswen(&mut self) -> _VDDCSWENW { - _VDDCSWENW { w: self } - } - #[doc = "Bits 1:2 - Controls switching of VCORE"] - #[inline] - pub fn vddcsw(&mut self) -> _VDDCSWW { - _VDDCSWW { w: self } - } - #[doc = "Bit 3 - USB Switch Control"] - #[inline] - pub fn usbswen_n(&mut self) -> _USBSWEN_NW { - _USBSWEN_NW { w: self } - } - #[doc = "Bit 8 - Allows Dynamic scaling of SIMO clock, reduces power in LP Modes"] - #[inline] - pub fn buckclkscalen(&mut self) -> _BUCKCLKSCALENW { - _BUCKCLKSCALENW { w: self } - } - #[doc = "Bit 9 - Enable the Reset Pad Pull Up Resistors"] - #[inline] - pub fn p1m(&mut self) -> _P1MW { - _P1MW { w: self } - } - #[doc = "Bit 10 - Error! Description not Found!"] - #[inline] - pub fn vddioh_sel(&mut self) -> _VDDIOH_SELW { - _VDDIOH_SELW { w: self } - } - } - } -} -#[doc = "The Trust Protection Unit used to assist the computationally intensive operations of several common cryptographic algorithms."] -pub struct TPU { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TPU {} -impl TPU { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tpu::RegisterBlock { - 0x4000_1000 as *const _ - } -} -impl Deref for TPU { - type Target = tpu::RegisterBlock; - fn deref(&self) -> &tpu::RegisterBlock { - unsafe { &*TPU::ptr() } - } -} -#[doc = "The Trust Protection Unit used to assist the computationally intensive operations of several common cryptographic algorithms."] -pub mod tpu { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Crypto Control Register."] - pub ctrl: CTRL, - #[doc = "0x04 - Cipher Control Register."] - pub cipher_ctrl: CIPHER_CTRL, - #[doc = "0x08 - HASH Control Register."] - pub hash_ctrl: HASH_CTRL, - #[doc = "0x0c - CRC Control Register."] - pub crc_ctrl: CRC_CTRL, - #[doc = "0x10 - Crypto DMA Source Address."] - pub dma_src: DMA_SRC, - #[doc = "0x14 - Crypto DMA Destination Address."] - pub dma_dest: DMA_DEST, - #[doc = "0x18 - Crypto DMA Byte Count."] - pub dma_cnt: DMA_CNT, - #[doc = "0x1c - MAA Control Register."] - pub maa_ctrl: MAA_CTRL, - #[doc = "0x20 - Crypto Data Input. Data input can be written to this register instead of using the DMA. This register writes to the FIFO. This register occupies four successive words to allow the use of multi-store instructions. Words can be written to any location, they will be placed in the FIFO in the order they are written. The endian swap input control bit affects this register."] - pub din: [DIN; 4], - #[doc = "0x30 - Crypto Data Output. Resulting data from cipher calculation. Data is placed in the lower words of these four registers depending on the algorithm. For block cipher modes, this register holds the result of most recent encryption or decryption operation. These registers are affected by the endian swap bits."] - pub dout: [DOUT; 4], - #[doc = "0x40 - CRC Polynomial. The polynomial to be used for Galois Field calculations (CRC or LFSR) should be written to this register. This register is affected by the MSB control bit."] - pub crc_poly: CRC_POLY, - #[doc = "0x44 - CRC Value. This is the state for the Galois Field. This register holds the result of a CRC calculation or the current state of the LFSR. This register is affected by the MSB control bit."] - pub crc_val: CRC_VAL, - #[doc = "0x48 - Pseudo Random Value. Output of the Galois Field shift register. This holds the resulting pseudo-random number if entropy is disabled or true random number if entropy is enabled."] - pub crc_prng: CRC_PRNG, - #[doc = "0x4c - Hamming ECC Register."] - pub ham_ecc: HAM_ECC, - #[doc = "0x50 - Initial Vector. For block cipher operations that use CBC, CFB, OFB, or CNTR modes, this register holds the initial value. This register is updated with each encryption or decryption operation. This register is affected by the endian swap bits."] - pub cipher_init: [CIPHER_INIT; 4], - #[doc = "0x60 - Cipher Key. This register holds the key used for block cipher operations. The lower words are used for block ciphers that use shorter key lengths. This register is affected by the endian swap input control bits."] - pub cipher_key: [CIPHER_KEY; 8], - #[doc = "0x80 - This register holds the calculated hash value. This register is affected by the endian swap bits."] - pub hash_digest: [HASH_DIGEST; 16], - #[doc = "0xc0 - Message Size. This register holds the lowest 32-bit of message size in bytes."] - pub hash_msg_sz: [HASH_MSG_SZ; 4], - #[doc = "0xd0 - MAA Word Size. This register defines the number of bits for a modular operation. This register must be set to a valid value prior to the MAA operation start. Valid values are from 1 to 2048. Invalid values are ignored and will not initiate a MAA operation."] - pub maa_maws: MAA_MAWS, - } - #[doc = "Crypto Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `RST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RSTR { - #[doc = "Reset complete."] - RESET_DONE, - #[doc = "Reset in progress."] - BUSY, - } - impl RSTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RSTR::RESET_DONE => false, - RSTR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RSTR { - match value { - false => RSTR::RESET_DONE, - true => RSTR::BUSY, - } - } - #[doc = "Checks if the value of the field is `RESET_DONE`"] - #[inline] - pub fn is_reset_done(&self) -> bool { - *self == RSTR::RESET_DONE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == RSTR::BUSY - } - } - #[doc = "Possible values of the field `INTR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTRR { - #[doc = "Disable"] - DIS, - #[doc = "Enable"] - EN, - } - impl INTRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INTRR::DIS => false, - INTRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INTRR { - match value { - false => INTRR::DIS, - true => INTRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == INTRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == INTRR::EN - } - } - #[doc = "Possible values of the field `SRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCR { - #[doc = "Input FIFO"] - INPUTFIFO, - #[doc = "Output FIFO"] - OUTPUTFIFO, - } - impl SRCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRCR::INPUTFIFO => false, - SRCR::OUTPUTFIFO => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRCR { - match value { - false => SRCR::INPUTFIFO, - true => SRCR::OUTPUTFIFO, - } - } - #[doc = "Checks if the value of the field is `INPUTFIFO`"] - #[inline] - pub fn is_input_fifo(&self) -> bool { - *self == SRCR::INPUTFIFO - } - #[doc = "Checks if the value of the field is `OUTPUTFIFO`"] - #[inline] - pub fn is_output_fifo(&self) -> bool { - *self == SRCR::OUTPUTFIFO - } - } - #[doc = r" Value of the field"] - pub struct BSOR { - bits: bool, - } - impl BSOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BSIR { - bits: bool, - } - impl BSIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WAIT_ENR { - bits: bool, - } - impl WAIT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `WAIT_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WAIT_POLR { - #[doc = "Active Low."] - ACTIVELO, - #[doc = "Active High."] - ACTIVEHI, - } - impl WAIT_POLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WAIT_POLR::ACTIVELO => false, - WAIT_POLR::ACTIVEHI => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WAIT_POLR { - match value { - false => WAIT_POLR::ACTIVELO, - true => WAIT_POLR::ACTIVEHI, - } - } - #[doc = "Checks if the value of the field is `ACTIVELO`"] - #[inline] - pub fn is_active_lo(&self) -> bool { - *self == WAIT_POLR::ACTIVELO - } - #[doc = "Checks if the value of the field is `ACTIVEHI`"] - #[inline] - pub fn is_active_hi(&self) -> bool { - *self == WAIT_POLR::ACTIVEHI - } - } - #[doc = "Possible values of the field `WRSRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRSRCR { - #[doc = "None."] - NONE, - #[doc = "Cipher Output."] - CIPHEROUTPUT, - #[doc = "Read FIFO."] - READFIFO, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl WRSRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - WRSRCR::NONE => 0, - WRSRCR::CIPHEROUTPUT => 0x01, - WRSRCR::READFIFO => 0x02, - WRSRCR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> WRSRCR { - match value { - 0 => WRSRCR::NONE, - 1 => WRSRCR::CIPHEROUTPUT, - 2 => WRSRCR::READFIFO, - i => WRSRCR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NONE`"] - #[inline] - pub fn is_none(&self) -> bool { - *self == WRSRCR::NONE - } - #[doc = "Checks if the value of the field is `CIPHEROUTPUT`"] - #[inline] - pub fn is_cipher_output(&self) -> bool { - *self == WRSRCR::CIPHEROUTPUT - } - #[doc = "Checks if the value of the field is `READFIFO`"] - #[inline] - pub fn is_read_fifo(&self) -> bool { - *self == WRSRCR::READFIFO - } - } - #[doc = "Possible values of the field `RDSRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDSRCR { - #[doc = "DMA Disable."] - DMADISABLED, - #[doc = "DMA Or APB."] - DMAORAPB, - #[doc = "RNG."] - RNG, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl RDSRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - RDSRCR::DMADISABLED => 0, - RDSRCR::DMAORAPB => 0x01, - RDSRCR::RNG => 0x02, - RDSRCR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> RDSRCR { - match value { - 0 => RDSRCR::DMADISABLED, - 1 => RDSRCR::DMAORAPB, - 2 => RDSRCR::RNG, - i => RDSRCR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DMADISABLED`"] - #[inline] - pub fn is_dma_disabled(&self) -> bool { - *self == RDSRCR::DMADISABLED - } - #[doc = "Checks if the value of the field is `DMAORAPB`"] - #[inline] - pub fn is_dma_or_apb(&self) -> bool { - *self == RDSRCR::DMAORAPB - } - #[doc = "Checks if the value of the field is `RNG`"] - #[inline] - pub fn is_rng(&self) -> bool { - *self == RDSRCR::RNG - } - } - #[doc = "Possible values of the field `FLAG_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLAG_MODER { - #[doc = "Unrestricted write (0 or 1) of CRYPTO_CTRL\\[27:24\\] flags."] - UNRES_WR, - #[doc = "Access to CRYPTO_CTRL\\[27:24\\] are write 1 to clear/write 0 no effect."] - RES_WR, - } - impl FLAG_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FLAG_MODER::UNRES_WR => false, - FLAG_MODER::RES_WR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FLAG_MODER { - match value { - false => FLAG_MODER::UNRES_WR, - true => FLAG_MODER::RES_WR, - } - } - #[doc = "Checks if the value of the field is `UNRES_WR`"] - #[inline] - pub fn is_unres_wr(&self) -> bool { - *self == FLAG_MODER::UNRES_WR - } - #[doc = "Checks if the value of the field is `RES_WR`"] - #[inline] - pub fn is_res_wr(&self) -> bool { - *self == FLAG_MODER::RES_WR - } - } - #[doc = "Possible values of the field `DMADNEMSK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMADNEMSKR { - #[doc = "DMA_DONE not used in setting CRYPTO_CTRL.DONE bit."] - NOT_USED, - #[doc = "DMA_DONE used in setting CRYPTO_CTRL.DONE bit."] - USED, - } - impl DMADNEMSKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMADNEMSKR::NOT_USED => false, - DMADNEMSKR::USED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMADNEMSKR { - match value { - false => DMADNEMSKR::NOT_USED, - true => DMADNEMSKR::USED, - } - } - #[doc = "Checks if the value of the field is `NOT_USED`"] - #[inline] - pub fn is_not_used(&self) -> bool { - *self == DMADNEMSKR::NOT_USED - } - #[doc = "Checks if the value of the field is `USED`"] - #[inline] - pub fn is_used(&self) -> bool { - *self == DMADNEMSKR::USED - } - } - #[doc = "Possible values of the field `DMA_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA_DONER { - #[doc = "Not Done."] - NOTDONE, - #[doc = "Done."] - DONE, - } - impl DMA_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA_DONER::NOTDONE => false, - DMA_DONER::DONE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA_DONER { - match value { - false => DMA_DONER::NOTDONE, - true => DMA_DONER::DONE, - } - } - #[doc = "Checks if the value of the field is `NOTDONE`"] - #[inline] - pub fn is_not_done(&self) -> bool { - *self == DMA_DONER::NOTDONE - } - #[doc = "Checks if the value of the field is `DONE`"] - #[inline] - pub fn is_done(&self) -> bool { - *self == DMA_DONER::DONE - } - } - #[doc = r" Value of the field"] - pub struct GLS_DONER { - bits: bool, - } - impl GLS_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HSH_DONER { - bits: bool, - } - impl HSH_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPH_DONER { - bits: bool, - } - impl CPH_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct MAA_DONER { - bits: bool, - } - impl MAA_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `ERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ERRR { - #[doc = "No Error."] - NOERROR, - #[doc = "Error."] - ERROR, - } - impl ERRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ERRR::NOERROR => false, - ERRR::ERROR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ERRR { - match value { - false => ERRR::NOERROR, - true => ERRR::ERROR, - } - } - #[doc = "Checks if the value of the field is `NOERROR`"] - #[inline] - pub fn is_no_error(&self) -> bool { - *self == ERRR::NOERROR - } - #[doc = "Checks if the value of the field is `ERROR`"] - #[inline] - pub fn is_error(&self) -> bool { - *self == ERRR::ERROR - } - } - #[doc = "Possible values of the field `RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYR { - #[doc = "Busy."] - BUSY, - #[doc = "Ready."] - READY, - } - impl RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RDYR::BUSY => false, - RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RDYR { - match value { - false => RDYR::BUSY, - true => RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == RDYR::BUSY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == RDYR::READY - } - } - #[doc = r" Value of the field"] - pub struct DONER { - bits: bool, - } - impl DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `RST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RSTW { - #[doc = "Starts reset operation."] - RESET, - } - impl RSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RSTW::RESET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RSTW<'a> { - w: &'a mut W, - } - impl<'a> _RSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RSTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Starts reset operation."] - #[inline] - pub fn reset(self) -> &'a mut W { - self.variant(RSTW::RESET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `INTR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTRW { - #[doc = "Disable"] - DIS, - #[doc = "Enable"] - EN, - } - impl INTRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INTRW::DIS => false, - INTRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INTRW<'a> { - w: &'a mut W, - } - impl<'a> _INTRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INTRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(INTRW::DIS) - } - #[doc = "Enable"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(INTRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCW { - #[doc = "Input FIFO"] - INPUTFIFO, - #[doc = "Output FIFO"] - OUTPUTFIFO, - } - impl SRCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRCW::INPUTFIFO => false, - SRCW::OUTPUTFIFO => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRCW<'a> { - w: &'a mut W, - } - impl<'a> _SRCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Input FIFO"] - #[inline] - pub fn input_fifo(self) -> &'a mut W { - self.variant(SRCW::INPUTFIFO) - } - #[doc = "Output FIFO"] - #[inline] - pub fn output_fifo(self) -> &'a mut W { - self.variant(SRCW::OUTPUTFIFO) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BSOW<'a> { - w: &'a mut W, - } - impl<'a> _BSOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BSIW<'a> { - w: &'a mut W, - } - impl<'a> _BSIW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WAIT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _WAIT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WAIT_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WAIT_POLW { - #[doc = "Active Low."] - ACTIVELO, - #[doc = "Active High."] - ACTIVEHI, - } - impl WAIT_POLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WAIT_POLW::ACTIVELO => false, - WAIT_POLW::ACTIVEHI => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WAIT_POLW<'a> { - w: &'a mut W, - } - impl<'a> _WAIT_POLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WAIT_POLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Active Low."] - #[inline] - pub fn active_lo(self) -> &'a mut W { - self.variant(WAIT_POLW::ACTIVELO) - } - #[doc = "Active High."] - #[inline] - pub fn active_hi(self) -> &'a mut W { - self.variant(WAIT_POLW::ACTIVEHI) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WRSRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRSRCW { - #[doc = "None."] - NONE, - #[doc = "Cipher Output."] - CIPHEROUTPUT, - #[doc = "Read FIFO."] - READFIFO, - } - impl WRSRCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - WRSRCW::NONE => 0, - WRSRCW::CIPHEROUTPUT => 1, - WRSRCW::READFIFO => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _WRSRCW<'a> { - w: &'a mut W, - } - impl<'a> _WRSRCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WRSRCW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "None."] - #[inline] - pub fn none(self) -> &'a mut W { - self.variant(WRSRCW::NONE) - } - #[doc = "Cipher Output."] - #[inline] - pub fn cipher_output(self) -> &'a mut W { - self.variant(WRSRCW::CIPHEROUTPUT) - } - #[doc = "Read FIFO."] - #[inline] - pub fn read_fifo(self) -> &'a mut W { - self.variant(WRSRCW::READFIFO) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RDSRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDSRCW { - #[doc = "DMA Disable."] - DMADISABLED, - #[doc = "DMA Or APB."] - DMAORAPB, - #[doc = "RNG."] - RNG, - } - impl RDSRCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - RDSRCW::DMADISABLED => 0, - RDSRCW::DMAORAPB => 1, - RDSRCW::RNG => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _RDSRCW<'a> { - w: &'a mut W, - } - impl<'a> _RDSRCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RDSRCW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "DMA Disable."] - #[inline] - pub fn dma_disabled(self) -> &'a mut W { - self.variant(RDSRCW::DMADISABLED) - } - #[doc = "DMA Or APB."] - #[inline] - pub fn dma_or_apb(self) -> &'a mut W { - self.variant(RDSRCW::DMAORAPB) - } - #[doc = "RNG."] - #[inline] - pub fn rng(self) -> &'a mut W { - self.variant(RDSRCW::RNG) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FLAG_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLAG_MODEW { - #[doc = "Unrestricted write (0 or 1) of CRYPTO_CTRL\\[27:24\\] flags."] - UNRES_WR, - #[doc = "Access to CRYPTO_CTRL\\[27:24\\] are write 1 to clear/write 0 no effect."] - RES_WR, - } - impl FLAG_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FLAG_MODEW::UNRES_WR => false, - FLAG_MODEW::RES_WR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FLAG_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _FLAG_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FLAG_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Unrestricted write (0 or 1) of CRYPTO_CTRL\\[27:24\\] flags."] - #[inline] - pub fn unres_wr(self) -> &'a mut W { - self.variant(FLAG_MODEW::UNRES_WR) - } - #[doc = "Access to CRYPTO_CTRL\\[27:24\\] are write 1 to clear/write 0 no effect."] - #[inline] - pub fn res_wr(self) -> &'a mut W { - self.variant(FLAG_MODEW::RES_WR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMADNEMSK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMADNEMSKW { - #[doc = "DMA_DONE not used in setting CRYPTO_CTRL.DONE bit."] - NOT_USED, - #[doc = "DMA_DONE used in setting CRYPTO_CTRL.DONE bit."] - USED, - } - impl DMADNEMSKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMADNEMSKW::NOT_USED => false, - DMADNEMSKW::USED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DMADNEMSKW<'a> { - w: &'a mut W, - } - impl<'a> _DMADNEMSKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMADNEMSKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "DMA_DONE not used in setting CRYPTO_CTRL.DONE bit."] - #[inline] - pub fn not_used(self) -> &'a mut W { - self.variant(DMADNEMSKW::NOT_USED) - } - #[doc = "DMA_DONE used in setting CRYPTO_CTRL.DONE bit."] - #[inline] - pub fn used(self) -> &'a mut W { - self.variant(DMADNEMSKW::USED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA_DONEW { - #[doc = "Not Done."] - NOTDONE, - #[doc = "Done."] - DONE, - } - impl DMA_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA_DONEW::NOTDONE => false, - DMA_DONEW::DONE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _DMA_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Done."] - #[inline] - pub fn not_done(self) -> &'a mut W { - self.variant(DMA_DONEW::NOTDONE) - } - #[doc = "Done."] - #[inline] - pub fn done(self) -> &'a mut W { - self.variant(DMA_DONEW::DONE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _GLS_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _GLS_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HSH_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _HSH_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPH_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _CPH_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MAA_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _MAA_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Reset. This bit is used to reset the crypto accelerator. All crypto internal states and related registers are reset to their default reset values. Control register such as CRYPTO_CTRL, CIPHER_CTRL, HASH_CTRL, CRC_CTRL, MAA_CTRL (with the exception of the STC bit), HASH_MSG_SZ_\\[3:0\\] and MAA_MAWS will retain their values. This bit will automatically clear itself after one cycle."] - #[inline] - pub fn rst(&self) -> RSTR { - RSTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Interrupt Enable. Generates an interrupt when done or error set."] - #[inline] - pub fn intr(&self) -> INTRR { - INTRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Source Select. This bit selects the hash function and CRC generator input source."] - #[inline] - pub fn src(&self) -> SRCR { - SRCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Byte Swap Output. Note. No byte swap will occur if there is not a full word."] - #[inline] - pub fn bso(&self) -> BSOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BSOR { bits } - } - #[doc = "Bit 5 - Byte Swap Input. Note. No byte swap will occur if there is not a full word."] - #[inline] - pub fn bsi(&self) -> BSIR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BSIR { bits } - } - #[doc = "Bit 6 - Wait Pin Enable. This can be used to hold off the crypto DMA until an external memory is ready. This is useful for transferring pages from NAND flash which may take several microseconds to become ready."] - #[inline] - pub fn wait_en(&self) -> WAIT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WAIT_ENR { bits } - } - #[doc = "Bit 7 - Wait Pin Polarity. When the wait pin is enabled, this bit selects its active state."] - #[inline] - pub fn wait_pol(&self) -> WAIT_POLR { - WAIT_POLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:9 - Write FIFO Source Select. This field determines where data written to the write FIFO comes from. When data is written to the write FIFO, it is always written out the DMA. To decrypt or encrypt data, the write FIFO source should be set to the cipher output. To implement memcpy() or memset() functions, or to fill memory with random data, the write FIFO source should be set to the read FIFO. When calculating a HASH or CMAC, the write FIFO should be disabled."] - #[inline] - pub fn wrsrc(&self) -> WRSRCR { - WRSRCR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 10:11 - Read FIFO Source Select. This field selects the source of the read FIFO. Typically, it is set to use the DMA. To implement a memset() function, the read FIFO DMA should be disabled. To fill memory with random data or to hash random numbers, the read FIFO source should be set to the random number generator."] - #[inline] - pub fn rdsrc(&self) -> RDSRCR { - RDSRCR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 14 - Done Flag Mode. This bit configures the access behavior of the individual CRYPTO_CTRL Done flags (CRYPTO_CTRL\\[27:24\\]). This bit is cleared only on reset to limit upkeep, i.e. once set, it will remain set until a reset occurs."] - #[inline] - pub fn flag_mode(&self) -> FLAG_MODER { - FLAG_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - DMA Done Flag Mask. This bit masks the DMA_DONE flag from being used to generate the CRYPTO_CTRL.DONE flag, and this disables a DMA_DONE condition from generating and interrupt. The DMA_DONE flag itself is unaffected and still may be monitored. This allows more optimal interrupt-driven crypto operations using DMA."] - #[inline] - pub fn dmadnemsk(&self) -> DMADNEMSKR { - DMADNEMSKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 24 - DMA Done. DMA write/read operation is complete. This bit must be cleared before starting a DMA operation."] - #[inline] - pub fn dma_done(&self) -> DMA_DONER { - DMA_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 25 - Galois Done. FIFO is full and CRC or Hamming Code Generator is enabled. This bit must be cleared before starting a CRC operation Note that DMA_DONE must be polled instead of this bit to determine the end of DMA operation during the utilization of Hamming Code Generator."] - #[inline] - pub fn gls_done(&self) -> GLS_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - GLS_DONER { bits } - } - #[doc = "Bit 26 - Hash Done. SHA operation is complete. This bit must be cleared before starting a HASH operation."] - #[inline] - pub fn hsh_done(&self) -> HSH_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HSH_DONER { bits } - } - #[doc = "Bit 27 - Cipher Done. Either AES or DES encryption/decryption operation is complete. This bit must be cleared before starting a cipher operation."] - #[inline] - pub fn cph_done(&self) -> CPH_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPH_DONER { bits } - } - #[doc = "Bit 28 - MAA Done. MAA operation is complete. This bit must be cleared before starting a new MAA operation. This bit is read only while the MAA is in progress. This bit is negate of MAA_CTRL.STC."] - #[inline] - pub fn maa_done(&self) -> MAA_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - MAA_DONER { bits } - } - #[doc = "Bit 29 - AHB Bus Error. This bit is set when the DMA encounters a bus error during a read or write operation. Once this bit is set, the DMA will stop. This bit can only be cleared by resetting the crypto block."] - #[inline] - pub fn err(&self) -> ERRR { - ERRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 30 - Ready. Crypto block ready for more data."] - #[inline] - pub fn rdy(&self) -> RDYR { - RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 31 - Done. One or more cryptographic calculations complete (logical OR of done flags)."] - #[inline] - pub fn done(&self) -> DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DONER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0xc000_0000 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Reset. This bit is used to reset the crypto accelerator. All crypto internal states and related registers are reset to their default reset values. Control register such as CRYPTO_CTRL, CIPHER_CTRL, HASH_CTRL, CRC_CTRL, MAA_CTRL (with the exception of the STC bit), HASH_MSG_SZ_\\[3:0\\] and MAA_MAWS will retain their values. This bit will automatically clear itself after one cycle."] - #[inline] - pub fn rst(&mut self) -> _RSTW { - _RSTW { w: self } - } - #[doc = "Bit 1 - Interrupt Enable. Generates an interrupt when done or error set."] - #[inline] - pub fn intr(&mut self) -> _INTRW { - _INTRW { w: self } - } - #[doc = "Bit 2 - Source Select. This bit selects the hash function and CRC generator input source."] - #[inline] - pub fn src(&mut self) -> _SRCW { - _SRCW { w: self } - } - #[doc = "Bit 4 - Byte Swap Output. Note. No byte swap will occur if there is not a full word."] - #[inline] - pub fn bso(&mut self) -> _BSOW { - _BSOW { w: self } - } - #[doc = "Bit 5 - Byte Swap Input. Note. No byte swap will occur if there is not a full word."] - #[inline] - pub fn bsi(&mut self) -> _BSIW { - _BSIW { w: self } - } - #[doc = "Bit 6 - Wait Pin Enable. This can be used to hold off the crypto DMA until an external memory is ready. This is useful for transferring pages from NAND flash which may take several microseconds to become ready."] - #[inline] - pub fn wait_en(&mut self) -> _WAIT_ENW { - _WAIT_ENW { w: self } - } - #[doc = "Bit 7 - Wait Pin Polarity. When the wait pin is enabled, this bit selects its active state."] - #[inline] - pub fn wait_pol(&mut self) -> _WAIT_POLW { - _WAIT_POLW { w: self } - } - #[doc = "Bits 8:9 - Write FIFO Source Select. This field determines where data written to the write FIFO comes from. When data is written to the write FIFO, it is always written out the DMA. To decrypt or encrypt data, the write FIFO source should be set to the cipher output. To implement memcpy() or memset() functions, or to fill memory with random data, the write FIFO source should be set to the read FIFO. When calculating a HASH or CMAC, the write FIFO should be disabled."] - #[inline] - pub fn wrsrc(&mut self) -> _WRSRCW { - _WRSRCW { w: self } - } - #[doc = "Bits 10:11 - Read FIFO Source Select. This field selects the source of the read FIFO. Typically, it is set to use the DMA. To implement a memset() function, the read FIFO DMA should be disabled. To fill memory with random data or to hash random numbers, the read FIFO source should be set to the random number generator."] - #[inline] - pub fn rdsrc(&mut self) -> _RDSRCW { - _RDSRCW { w: self } - } - #[doc = "Bit 14 - Done Flag Mode. This bit configures the access behavior of the individual CRYPTO_CTRL Done flags (CRYPTO_CTRL\\[27:24\\]). This bit is cleared only on reset to limit upkeep, i.e. once set, it will remain set until a reset occurs."] - #[inline] - pub fn flag_mode(&mut self) -> _FLAG_MODEW { - _FLAG_MODEW { w: self } - } - #[doc = "Bit 15 - DMA Done Flag Mask. This bit masks the DMA_DONE flag from being used to generate the CRYPTO_CTRL.DONE flag, and this disables a DMA_DONE condition from generating and interrupt. The DMA_DONE flag itself is unaffected and still may be monitored. This allows more optimal interrupt-driven crypto operations using DMA."] - #[inline] - pub fn dmadnemsk(&mut self) -> _DMADNEMSKW { - _DMADNEMSKW { w: self } - } - #[doc = "Bit 24 - DMA Done. DMA write/read operation is complete. This bit must be cleared before starting a DMA operation."] - #[inline] - pub fn dma_done(&mut self) -> _DMA_DONEW { - _DMA_DONEW { w: self } - } - #[doc = "Bit 25 - Galois Done. FIFO is full and CRC or Hamming Code Generator is enabled. This bit must be cleared before starting a CRC operation Note that DMA_DONE must be polled instead of this bit to determine the end of DMA operation during the utilization of Hamming Code Generator."] - #[inline] - pub fn gls_done(&mut self) -> _GLS_DONEW { - _GLS_DONEW { w: self } - } - #[doc = "Bit 26 - Hash Done. SHA operation is complete. This bit must be cleared before starting a HASH operation."] - #[inline] - pub fn hsh_done(&mut self) -> _HSH_DONEW { - _HSH_DONEW { w: self } - } - #[doc = "Bit 27 - Cipher Done. Either AES or DES encryption/decryption operation is complete. This bit must be cleared before starting a cipher operation."] - #[inline] - pub fn cph_done(&mut self) -> _CPH_DONEW { - _CPH_DONEW { w: self } - } - #[doc = "Bit 28 - MAA Done. MAA operation is complete. This bit must be cleared before starting a new MAA operation. This bit is read only while the MAA is in progress. This bit is negate of MAA_CTRL.STC."] - #[inline] - pub fn maa_done(&mut self) -> _MAA_DONEW { - _MAA_DONEW { w: self } - } - } - } - #[doc = "Cipher Control Register."] - pub struct CIPHER_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cipher Control Register."] - pub mod cipher_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CIPHER_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ENC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENCR { - #[doc = "Encrypt."] - ENCRYPT, - #[doc = "Decrypt."] - DECRYPT, - } - impl ENCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ENCR::ENCRYPT => false, - ENCR::DECRYPT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ENCR { - match value { - false => ENCR::ENCRYPT, - true => ENCR::DECRYPT, - } - } - #[doc = "Checks if the value of the field is `ENCRYPT`"] - #[inline] - pub fn is_encrypt(&self) -> bool { - *self == ENCR::ENCRYPT - } - #[doc = "Checks if the value of the field is `DECRYPT`"] - #[inline] - pub fn is_decrypt(&self) -> bool { - *self == ENCR::DECRYPT - } - } - #[doc = "Possible values of the field `KEY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum KEYR { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl KEYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - KEYR::COMPLETE => false, - KEYR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> KEYR { - match value { - false => KEYR::COMPLETE, - true => KEYR::START, - } - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == KEYR::COMPLETE - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == KEYR::START - } - } - #[doc = "Possible values of the field `SRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCR { - #[doc = "User cipher key (0x4000_1060)."] - CIPHERKEY, - #[doc = "Key from battery-backed register file (0x4000_5000 to 0x4000_501F)."] - REGFILE, - #[doc = "Key from battery-backed register file (0x4000_5020 to 0x4000_502F)."] - QSPIKEY_REGFILE, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SRCR::CIPHERKEY => 0, - SRCR::REGFILE => 0x02, - SRCR::QSPIKEY_REGFILE => 0x03, - SRCR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SRCR { - match value { - 0 => SRCR::CIPHERKEY, - 2 => SRCR::REGFILE, - 3 => SRCR::QSPIKEY_REGFILE, - i => SRCR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CIPHERKEY`"] - #[inline] - pub fn is_cipher_key(&self) -> bool { - *self == SRCR::CIPHERKEY - } - #[doc = "Checks if the value of the field is `REGFILE`"] - #[inline] - pub fn is_reg_file(&self) -> bool { - *self == SRCR::REGFILE - } - #[doc = "Checks if the value of the field is `QSPIKEY_REGFILE`"] - #[inline] - pub fn is_qspi_key_reg_file(&self) -> bool { - *self == SRCR::QSPIKEY_REGFILE - } - } - #[doc = "Possible values of the field `CIPHER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CIPHERR { - #[doc = "Disabled."] - DIS, - #[doc = "AES 128."] - AES128, - #[doc = "AES 192."] - AES192, - #[doc = "AES 256."] - AES256, - #[doc = "DES."] - DES, - #[doc = "Triple DES."] - TDES, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl CIPHERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - CIPHERR::DIS => 0, - CIPHERR::AES128 => 0x01, - CIPHERR::AES192 => 0x02, - CIPHERR::AES256 => 0x03, - CIPHERR::DES => 0x04, - CIPHERR::TDES => 0x05, - CIPHERR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> CIPHERR { - match value { - 0 => CIPHERR::DIS, - 1 => CIPHERR::AES128, - 2 => CIPHERR::AES192, - 3 => CIPHERR::AES256, - 4 => CIPHERR::DES, - 5 => CIPHERR::TDES, - i => CIPHERR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CIPHERR::DIS - } - #[doc = "Checks if the value of the field is `AES128`"] - #[inline] - pub fn is_aes128(&self) -> bool { - *self == CIPHERR::AES128 - } - #[doc = "Checks if the value of the field is `AES192`"] - #[inline] - pub fn is_aes192(&self) -> bool { - *self == CIPHERR::AES192 - } - #[doc = "Checks if the value of the field is `AES256`"] - #[inline] - pub fn is_aes256(&self) -> bool { - *self == CIPHERR::AES256 - } - #[doc = "Checks if the value of the field is `DES`"] - #[inline] - pub fn is_des(&self) -> bool { - *self == CIPHERR::DES - } - #[doc = "Checks if the value of the field is `TDES`"] - #[inline] - pub fn is_tdes(&self) -> bool { - *self == CIPHERR::TDES - } - } - #[doc = "Possible values of the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "ECB Mode."] - ECB, - #[doc = "CBC Mode."] - CBC, - #[doc = "CFB (AES only)."] - CFB, - #[doc = "OFB (AES only)."] - OFB, - #[doc = "CTR (AES only)."] - CTR, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - MODER::ECB => 0, - MODER::CBC => 0x01, - MODER::CFB => 0x02, - MODER::OFB => 0x03, - MODER::CTR => 0x04, - MODER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> MODER { - match value { - 0 => MODER::ECB, - 1 => MODER::CBC, - 2 => MODER::CFB, - 3 => MODER::OFB, - 4 => MODER::CTR, - i => MODER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `ECB`"] - #[inline] - pub fn is_ecb(&self) -> bool { - *self == MODER::ECB - } - #[doc = "Checks if the value of the field is `CBC`"] - #[inline] - pub fn is_cbc(&self) -> bool { - *self == MODER::CBC - } - #[doc = "Checks if the value of the field is `CFB`"] - #[inline] - pub fn is_cfb(&self) -> bool { - *self == MODER::CFB - } - #[doc = "Checks if the value of the field is `OFB`"] - #[inline] - pub fn is_ofb(&self) -> bool { - *self == MODER::OFB - } - #[doc = "Checks if the value of the field is `CTR`"] - #[inline] - pub fn is_ctr(&self) -> bool { - *self == MODER::CTR - } - } - #[doc = "Values that can be written to the field `ENC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENCW { - #[doc = "Encrypt."] - ENCRYPT, - #[doc = "Decrypt."] - DECRYPT, - } - impl ENCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ENCW::ENCRYPT => false, - ENCW::DECRYPT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ENCW<'a> { - w: &'a mut W, - } - impl<'a> _ENCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ENCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Encrypt."] - #[inline] - pub fn encrypt(self) -> &'a mut W { - self.variant(ENCW::ENCRYPT) - } - #[doc = "Decrypt."] - #[inline] - pub fn decrypt(self) -> &'a mut W { - self.variant(ENCW::DECRYPT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `KEY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum KEYW { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl KEYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - KEYW::COMPLETE => false, - KEYW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _KEYW<'a> { - w: &'a mut W, - } - impl<'a> _KEYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: KEYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn complete(self) -> &'a mut W { - self.variant(KEYW::COMPLETE) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(KEYW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCW { - #[doc = "User cipher key (0x4000_1060)."] - CIPHERKEY, - #[doc = "Key from battery-backed register file (0x4000_5000 to 0x4000_501F)."] - REGFILE, - #[doc = "Key from battery-backed register file (0x4000_5020 to 0x4000_502F)."] - QSPIKEY_REGFILE, - } - impl SRCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SRCW::CIPHERKEY => 0, - SRCW::REGFILE => 2, - SRCW::QSPIKEY_REGFILE => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SRCW<'a> { - w: &'a mut W, - } - impl<'a> _SRCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRCW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "User cipher key (0x4000_1060)."] - #[inline] - pub fn cipher_key(self) -> &'a mut W { - self.variant(SRCW::CIPHERKEY) - } - #[doc = "Key from battery-backed register file (0x4000_5000 to 0x4000_501F)."] - #[inline] - pub fn reg_file(self) -> &'a mut W { - self.variant(SRCW::REGFILE) - } - #[doc = "Key from battery-backed register file (0x4000_5020 to 0x4000_502F)."] - #[inline] - pub fn qspi_key_reg_file(self) -> &'a mut W { - self.variant(SRCW::QSPIKEY_REGFILE) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CIPHER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CIPHERW { - #[doc = "Disabled."] - DIS, - #[doc = "AES 128."] - AES128, - #[doc = "AES 192."] - AES192, - #[doc = "AES 256."] - AES256, - #[doc = "DES."] - DES, - #[doc = "Triple DES."] - TDES, - } - impl CIPHERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - CIPHERW::DIS => 0, - CIPHERW::AES128 => 1, - CIPHERW::AES192 => 2, - CIPHERW::AES256 => 3, - CIPHERW::DES => 4, - CIPHERW::TDES => 5, - } - } - } - #[doc = r" Proxy"] - pub struct _CIPHERW<'a> { - w: &'a mut W, - } - impl<'a> _CIPHERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CIPHERW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CIPHERW::DIS) - } - #[doc = "AES 128."] - #[inline] - pub fn aes128(self) -> &'a mut W { - self.variant(CIPHERW::AES128) - } - #[doc = "AES 192."] - #[inline] - pub fn aes192(self) -> &'a mut W { - self.variant(CIPHERW::AES192) - } - #[doc = "AES 256."] - #[inline] - pub fn aes256(self) -> &'a mut W { - self.variant(CIPHERW::AES256) - } - #[doc = "DES."] - #[inline] - pub fn des(self) -> &'a mut W { - self.variant(CIPHERW::DES) - } - #[doc = "Triple DES."] - #[inline] - pub fn tdes(self) -> &'a mut W { - self.variant(CIPHERW::TDES) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "ECB Mode."] - ECB, - #[doc = "CBC Mode."] - CBC, - #[doc = "CFB (AES only)."] - CFB, - #[doc = "OFB (AES only)."] - OFB, - #[doc = "CTR (AES only)."] - CTR, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - MODEW::ECB => 0, - MODEW::CBC => 1, - MODEW::CFB => 2, - MODEW::OFB => 3, - MODEW::CTR => 4, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "ECB Mode."] - #[inline] - pub fn ecb(self) -> &'a mut W { - self.variant(MODEW::ECB) - } - #[doc = "CBC Mode."] - #[inline] - pub fn cbc(self) -> &'a mut W { - self.variant(MODEW::CBC) - } - #[doc = "CFB (AES only)."] - #[inline] - pub fn cfb(self) -> &'a mut W { - self.variant(MODEW::CFB) - } - #[doc = "OFB (AES only)."] - #[inline] - pub fn ofb(self) -> &'a mut W { - self.variant(MODEW::OFB) - } - #[doc = "CTR (AES only)."] - #[inline] - pub fn ctr(self) -> &'a mut W { - self.variant(MODEW::CTR) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Encrypt. Select encryption or decryption of input data."] - #[inline] - pub fn enc(&self) -> ENCR { - ENCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Load Key from crypto DMA. This bit is automatically cleared by hardware after the DMA has completed loading the key. When the DMA operation is done, it sets the appropriate crypto DMA Done flag."] - #[inline] - pub fn key(&self) -> KEYR { - KEYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 2:3 - Source of Random key."] - #[inline] - pub fn src(&self) -> SRCR { - SRCR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 4:6 - Cipher Operation Select. Symmetric Block Cipher algorithm selection or memory operation."] - #[inline] - pub fn cipher(&self) -> CIPHERR { - CIPHERR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:10 - Mode Select. Mode of operation for block cipher or memory operation. DES/TDES cannot be used in CFB, OFB or CTR modes."] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Encrypt. Select encryption or decryption of input data."] - #[inline] - pub fn enc(&mut self) -> _ENCW { - _ENCW { w: self } - } - #[doc = "Bit 1 - Load Key from crypto DMA. This bit is automatically cleared by hardware after the DMA has completed loading the key. When the DMA operation is done, it sets the appropriate crypto DMA Done flag."] - #[inline] - pub fn key(&mut self) -> _KEYW { - _KEYW { w: self } - } - #[doc = "Bits 2:3 - Source of Random key."] - #[inline] - pub fn src(&mut self) -> _SRCW { - _SRCW { w: self } - } - #[doc = "Bits 4:6 - Cipher Operation Select. Symmetric Block Cipher algorithm selection or memory operation."] - #[inline] - pub fn cipher(&mut self) -> _CIPHERW { - _CIPHERW { w: self } - } - #[doc = "Bits 8:10 - Mode Select. Mode of operation for block cipher or memory operation. DES/TDES cannot be used in CFB, OFB or CTR modes."] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - } - } - #[doc = "HASH Control Register."] - pub struct HASH_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HASH Control Register."] - pub mod hash_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HASH_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `INIT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INITR { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl INITR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INITR::NOP => false, - INITR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INITR { - match value { - false => INITR::NOP, - true => INITR::START, - } - } - #[doc = "Checks if the value of the field is `NOP`"] - #[inline] - pub fn is_nop(&self) -> bool { - *self == INITR::NOP - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == INITR::START - } - } - #[doc = "Possible values of the field `XOR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum XORR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl XORR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - XORR::DIS => false, - XORR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> XORR { - match value { - false => XORR::DIS, - true => XORR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == XORR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == XORR::EN - } - } - #[doc = "Possible values of the field `HASH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HASHR { - #[doc = "Disabled."] - DIS, - #[doc = "SHA-1."] - SHA1, - #[doc = "SHA 224."] - SHA224, - #[doc = "SHA 256."] - SHA256, - #[doc = "SHA 384."] - SHA384, - #[doc = "SHA 512."] - SHA512, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl HASHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - HASHR::DIS => 0, - HASHR::SHA1 => 0x01, - HASHR::SHA224 => 0x02, - HASHR::SHA256 => 0x03, - HASHR::SHA384 => 0x04, - HASHR::SHA512 => 0x05, - HASHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> HASHR { - match value { - 0 => HASHR::DIS, - 1 => HASHR::SHA1, - 2 => HASHR::SHA224, - 3 => HASHR::SHA256, - 4 => HASHR::SHA384, - 5 => HASHR::SHA512, - i => HASHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == HASHR::DIS - } - #[doc = "Checks if the value of the field is `SHA1`"] - #[inline] - pub fn is_sha1(&self) -> bool { - *self == HASHR::SHA1 - } - #[doc = "Checks if the value of the field is `SHA224`"] - #[inline] - pub fn is_sha224(&self) -> bool { - *self == HASHR::SHA224 - } - #[doc = "Checks if the value of the field is `SHA256`"] - #[inline] - pub fn is_sha256(&self) -> bool { - *self == HASHR::SHA256 - } - #[doc = "Checks if the value of the field is `SHA384`"] - #[inline] - pub fn is_sha384(&self) -> bool { - *self == HASHR::SHA384 - } - #[doc = "Checks if the value of the field is `SHA512`"] - #[inline] - pub fn is_sha512(&self) -> bool { - *self == HASHR::SHA512 - } - } - #[doc = "Possible values of the field `LAST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LASTR { - #[doc = "No Effect."] - NOEFFECT, - #[doc = "Last Message Data."] - LASTMSGDATA, - } - impl LASTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LASTR::NOEFFECT => false, - LASTR::LASTMSGDATA => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LASTR { - match value { - false => LASTR::NOEFFECT, - true => LASTR::LASTMSGDATA, - } - } - #[doc = "Checks if the value of the field is `NOEFFECT`"] - #[inline] - pub fn is_no_effect(&self) -> bool { - *self == LASTR::NOEFFECT - } - #[doc = "Checks if the value of the field is `LASTMSGDATA`"] - #[inline] - pub fn is_last_msg_data(&self) -> bool { - *self == LASTR::LASTMSGDATA - } - } - #[doc = "Values that can be written to the field `INIT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INITW { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl INITW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INITW::NOP => false, - INITW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INITW<'a> { - w: &'a mut W, - } - impl<'a> _INITW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INITW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn nop(self) -> &'a mut W { - self.variant(INITW::NOP) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(INITW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `XOR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum XORW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl XORW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - XORW::DIS => false, - XORW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _XORW<'a> { - w: &'a mut W, - } - impl<'a> _XORW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: XORW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(XORW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(XORW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HASH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HASHW { - #[doc = "Disabled."] - DIS, - #[doc = "SHA-1."] - SHA1, - #[doc = "SHA 224."] - SHA224, - #[doc = "SHA 256."] - SHA256, - #[doc = "SHA 384."] - SHA384, - #[doc = "SHA 512."] - SHA512, - } - impl HASHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - HASHW::DIS => 0, - HASHW::SHA1 => 1, - HASHW::SHA224 => 2, - HASHW::SHA256 => 3, - HASHW::SHA384 => 4, - HASHW::SHA512 => 5, - } - } - } - #[doc = r" Proxy"] - pub struct _HASHW<'a> { - w: &'a mut W, - } - impl<'a> _HASHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HASHW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(HASHW::DIS) - } - #[doc = "SHA-1."] - #[inline] - pub fn sha1(self) -> &'a mut W { - self.variant(HASHW::SHA1) - } - #[doc = "SHA 224."] - #[inline] - pub fn sha224(self) -> &'a mut W { - self.variant(HASHW::SHA224) - } - #[doc = "SHA 256."] - #[inline] - pub fn sha256(self) -> &'a mut W { - self.variant(HASHW::SHA256) - } - #[doc = "SHA 384."] - #[inline] - pub fn sha384(self) -> &'a mut W { - self.variant(HASHW::SHA384) - } - #[doc = "SHA 512."] - #[inline] - pub fn sha512(self) -> &'a mut W { - self.variant(HASHW::SHA512) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LAST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LASTW { - #[doc = "No Effect."] - NOEFFECT, - #[doc = "Last Message Data."] - LASTMSGDATA, - } - impl LASTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LASTW::NOEFFECT => false, - LASTW::LASTMSGDATA => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LASTW<'a> { - w: &'a mut W, - } - impl<'a> _LASTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LASTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Effect."] - #[inline] - pub fn no_effect(self) -> &'a mut W { - self.variant(LASTW::NOEFFECT) - } - #[doc = "Last Message Data."] - #[inline] - pub fn last_msg_data(self) -> &'a mut W { - self.variant(LASTW::LASTMSGDATA) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Initialize. Initializes hash registers with standard constants."] - #[inline] - pub fn init(&self) -> INITR { - INITR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - XOR data with IV from cipher block. Useful when calculating HMAC to XOR the input pad and output pad."] - #[inline] - pub fn xor(&self) -> XORR { - XORR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 2:4 - Hash function selection."] - #[inline] - pub fn hash(&self) -> HASHR { - HASHR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 5 - Last Message Bit. This bit shall be set along with the HASH_MSG_SZ register prior to hashing the last 512 or 1024-bit block of the message data. It will allow automatic preprocessing of the last message padding, which includes the trailing bit 1, followed by the respective number of zero bits for the last block size and finally the message length represented in bytes. The bit will be automatically cleared at the same time the HASH DONE is set, designating the completion of the last message hash."] - #[inline] - pub fn last(&self) -> LASTR { - LASTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Initialize. Initializes hash registers with standard constants."] - #[inline] - pub fn init(&mut self) -> _INITW { - _INITW { w: self } - } - #[doc = "Bit 1 - XOR data with IV from cipher block. Useful when calculating HMAC to XOR the input pad and output pad."] - #[inline] - pub fn xor(&mut self) -> _XORW { - _XORW { w: self } - } - #[doc = "Bits 2:4 - Hash function selection."] - #[inline] - pub fn hash(&mut self) -> _HASHW { - _HASHW { w: self } - } - #[doc = "Bit 5 - Last Message Bit. This bit shall be set along with the HASH_MSG_SZ register prior to hashing the last 512 or 1024-bit block of the message data. It will allow automatic preprocessing of the last message padding, which includes the trailing bit 1, followed by the respective number of zero bits for the last block size and finally the message length represented in bytes. The bit will be automatically cleared at the same time the HASH DONE is set, designating the completion of the last message hash."] - #[inline] - pub fn last(&mut self) -> _LASTW { - _LASTW { w: self } - } - } - } - #[doc = "CRC Control Register."] - pub struct CRC_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "CRC Control Register."] - pub mod crc_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CRC_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRCR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CRCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRCR::DIS => false, - CRCR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRCR { - match value { - false => CRCR::DIS, - true => CRCR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRCR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CRCR::EN - } - } - #[doc = "Possible values of the field `MSB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MSBR { - #[doc = "LSB First."] - LSBFIRST, - #[doc = "MSB First."] - MSBFIRST, - } - impl MSBR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MSBR::LSBFIRST => false, - MSBR::MSBFIRST => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MSBR { - match value { - false => MSBR::LSBFIRST, - true => MSBR::MSBFIRST, - } - } - #[doc = "Checks if the value of the field is `LSBFIRST`"] - #[inline] - pub fn is_lsb_first(&self) -> bool { - *self == MSBR::LSBFIRST - } - #[doc = "Checks if the value of the field is `MSBFIRST`"] - #[inline] - pub fn is_msb_first(&self) -> bool { - *self == MSBR::MSBFIRST - } - } - #[doc = r" Value of the field"] - pub struct PRNGR { - bits: bool, - } - impl PRNGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ENTR { - bits: bool, - } - impl ENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HAMR { - bits: bool, - } - impl HAMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `CRC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRCW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CRCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRCW::DIS => false, - CRCW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CRCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRCW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CRCW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MSB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MSBW { - #[doc = "LSB First."] - LSBFIRST, - #[doc = "MSB First."] - MSBFIRST, - } - impl MSBW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MSBW::LSBFIRST => false, - MSBW::MSBFIRST => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MSBW<'a> { - w: &'a mut W, - } - impl<'a> _MSBW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MSBW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "LSB First."] - #[inline] - pub fn lsb_first(self) -> &'a mut W { - self.variant(MSBW::LSBFIRST) - } - #[doc = "MSB First."] - #[inline] - pub fn msb_first(self) -> &'a mut W { - self.variant(MSBW::MSBFIRST) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PRNGW<'a> { - w: &'a mut W, - } - impl<'a> _PRNGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ENTW<'a> { - w: &'a mut W, - } - impl<'a> _ENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HAMW<'a> { - w: &'a mut W, - } - impl<'a> _HAMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HRST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HRSTW { - #[doc = "Starts reset operation."] - RESET, - } - impl HRSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HRSTW::RESET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HRSTW<'a> { - w: &'a mut W, - } - impl<'a> _HRSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HRSTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Starts reset operation."] - #[inline] - pub fn reset(self) -> &'a mut W { - self.variant(HRSTW::RESET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Cyclic Redundancy Check Enable. The CRC cannot be enabled if the PRNG is enabled."] - #[inline] - pub fn crc(&self) -> CRCR { - CRCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - MSB select. This bit selects the order of calculating CRC on data."] - #[inline] - pub fn msb(&self) -> MSBR { - MSBR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Pseudo Random Number Generator Enable. If entropy is disabled, this outputs one byte of pseudo random data per clock cycle. If entropy is enabled, data is output at a rate of one bit per clock cycle."] - #[inline] - pub fn prng(&self) -> PRNGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PRNGR { bits } - } - #[doc = "Bit 3 - Entropy Enable. If the PRNG is enabled, this mixes the high frequency ring oscillator with the LFSR. If the PRNG is disabled, the raw entropy data is output at a rate of 1 bit per clock. This makes it possible to characterize the quality of the entropy source."] - #[inline] - pub fn ent(&self) -> ENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ENTR { bits } - } - #[doc = "Bit 4 - Hamming Code Enable. Enable hamming code calculation."] - #[inline] - pub fn ham(&self) -> HAMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HAMR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Cyclic Redundancy Check Enable. The CRC cannot be enabled if the PRNG is enabled."] - #[inline] - pub fn crc(&mut self) -> _CRCW { - _CRCW { w: self } - } - #[doc = "Bit 1 - MSB select. This bit selects the order of calculating CRC on data."] - #[inline] - pub fn msb(&mut self) -> _MSBW { - _MSBW { w: self } - } - #[doc = "Bit 2 - Pseudo Random Number Generator Enable. If entropy is disabled, this outputs one byte of pseudo random data per clock cycle. If entropy is enabled, data is output at a rate of one bit per clock cycle."] - #[inline] - pub fn prng(&mut self) -> _PRNGW { - _PRNGW { w: self } - } - #[doc = "Bit 3 - Entropy Enable. If the PRNG is enabled, this mixes the high frequency ring oscillator with the LFSR. If the PRNG is disabled, the raw entropy data is output at a rate of 1 bit per clock. This makes it possible to characterize the quality of the entropy source."] - #[inline] - pub fn ent(&mut self) -> _ENTW { - _ENTW { w: self } - } - #[doc = "Bit 4 - Hamming Code Enable. Enable hamming code calculation."] - #[inline] - pub fn ham(&mut self) -> _HAMW { - _HAMW { w: self } - } - #[doc = "Bit 5 - Hamming Reset. Reset Hamming code ECC generator for next block."] - #[inline] - pub fn hrst(&mut self) -> _HRSTW { - _HRSTW { w: self } - } - } - } - #[doc = "Crypto DMA Source Address."] - pub struct DMA_SRC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto DMA Source Address."] - pub mod dma_src { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA_SRC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - DMA Source Address."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - DMA Source Address."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Crypto DMA Destination Address."] - pub struct DMA_DEST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto DMA Destination Address."] - pub mod dma_dest { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA_DEST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - DMA Destination Address."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - DMA Destination Address."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Crypto DMA Byte Count."] - pub struct DMA_CNT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto DMA Byte Count."] - pub mod dma_cnt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA_CNT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - DMA Byte Address."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - DMA Byte Address."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "MAA Control Register."] - pub struct MAA_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "MAA Control Register."] - pub mod maa_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MAA_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `STC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STCR { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl STCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STCR::NOP => false, - STCR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STCR { - match value { - false => STCR::NOP, - true => STCR::START, - } - } - #[doc = "Checks if the value of the field is `NOP`"] - #[inline] - pub fn is_nop(&self) -> bool { - *self == STCR::NOP - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == STCR::START - } - } - #[doc = "Possible values of the field `CLC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLCR { - #[doc = "Exponentiation."] - EXP, - #[doc = "Square operation."] - SQ, - #[doc = "Multiplication."] - MUL, - #[doc = "Square followed by a multiplication."] - SQMUL, - #[doc = "Addition."] - ADD, - #[doc = "Subtraction."] - SUB, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl CLCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - CLCR::EXP => 0, - CLCR::SQ => 0x01, - CLCR::MUL => 0x02, - CLCR::SQMUL => 0x03, - CLCR::ADD => 0x04, - CLCR::SUB => 0x05, - CLCR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> CLCR { - match value { - 0 => CLCR::EXP, - 1 => CLCR::SQ, - 2 => CLCR::MUL, - 3 => CLCR::SQMUL, - 4 => CLCR::ADD, - 5 => CLCR::SUB, - i => CLCR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `EXP`"] - #[inline] - pub fn is_exp(&self) -> bool { - *self == CLCR::EXP - } - #[doc = "Checks if the value of the field is `SQ`"] - #[inline] - pub fn is_sq(&self) -> bool { - *self == CLCR::SQ - } - #[doc = "Checks if the value of the field is `MUL`"] - #[inline] - pub fn is_mul(&self) -> bool { - *self == CLCR::MUL - } - #[doc = "Checks if the value of the field is `SQMUL`"] - #[inline] - pub fn is_sq_mul(&self) -> bool { - *self == CLCR::SQMUL - } - #[doc = "Checks if the value of the field is `ADD`"] - #[inline] - pub fn is_add(&self) -> bool { - *self == CLCR::ADD - } - #[doc = "Checks if the value of the field is `SUB`"] - #[inline] - pub fn is_sub(&self) -> bool { - *self == CLCR::SUB - } - } - #[doc = "Possible values of the field `OCALC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OCALCR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl OCALCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - OCALCR::DIS => false, - OCALCR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> OCALCR { - match value { - false => OCALCR::DIS, - true => OCALCR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == OCALCR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == OCALCR::EN - } - } - #[doc = "Possible values of the field `MAAER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MAAERR { - #[doc = "No Error."] - NOERROR, - #[doc = "Error."] - ERROR, - } - impl MAAERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MAAERR::NOERROR => false, - MAAERR::ERROR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MAAERR { - match value { - false => MAAERR::NOERROR, - true => MAAERR::ERROR, - } - } - #[doc = "Checks if the value of the field is `NOERROR`"] - #[inline] - pub fn is_no_error(&self) -> bool { - *self == MAAERR::NOERROR - } - #[doc = "Checks if the value of the field is `ERROR`"] - #[inline] - pub fn is_error(&self) -> bool { - *self == MAAERR::ERROR - } - } - #[doc = r" Value of the field"] - pub struct AMSR { - bits: u8, - } - impl AMSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct BMSR { - bits: u8, - } - impl BMSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct EMSR { - bits: u8, - } - impl EMSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MMSR { - bits: u8, - } - impl MMSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct AMAR { - bits: u8, - } - impl AMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct BMAR { - bits: u8, - } - impl BMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RMAR { - bits: u8, - } - impl RMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TMAR { - bits: u8, - } - impl TMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `STC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STCW { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl STCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STCW::NOP => false, - STCW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STCW<'a> { - w: &'a mut W, - } - impl<'a> _STCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn nop(self) -> &'a mut W { - self.variant(STCW::NOP) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(STCW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CLC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLCW { - #[doc = "Exponentiation."] - EXP, - #[doc = "Square operation."] - SQ, - #[doc = "Multiplication."] - MUL, - #[doc = "Square followed by a multiplication."] - SQMUL, - #[doc = "Addition."] - ADD, - #[doc = "Subtraction."] - SUB, - } - impl CLCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - CLCW::EXP => 0, - CLCW::SQ => 1, - CLCW::MUL => 2, - CLCW::SQMUL => 3, - CLCW::ADD => 4, - CLCW::SUB => 5, - } - } - } - #[doc = r" Proxy"] - pub struct _CLCW<'a> { - w: &'a mut W, - } - impl<'a> _CLCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CLCW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Exponentiation."] - #[inline] - pub fn exp(self) -> &'a mut W { - self.variant(CLCW::EXP) - } - #[doc = "Square operation."] - #[inline] - pub fn sq(self) -> &'a mut W { - self.variant(CLCW::SQ) - } - #[doc = "Multiplication."] - #[inline] - pub fn mul(self) -> &'a mut W { - self.variant(CLCW::MUL) - } - #[doc = "Square followed by a multiplication."] - #[inline] - pub fn sq_mul(self) -> &'a mut W { - self.variant(CLCW::SQMUL) - } - #[doc = "Addition."] - #[inline] - pub fn add(self) -> &'a mut W { - self.variant(CLCW::ADD) - } - #[doc = "Subtraction."] - #[inline] - pub fn sub(self) -> &'a mut W { - self.variant(CLCW::SUB) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `OCALC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OCALCW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl OCALCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - OCALCW::DIS => false, - OCALCW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _OCALCW<'a> { - w: &'a mut W, - } - impl<'a> _OCALCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: OCALCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(OCALCW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(OCALCW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MAAER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MAAERW { - #[doc = "No Error."] - NOERROR, - #[doc = "Error."] - ERROR, - } - impl MAAERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MAAERW::NOERROR => false, - MAAERW::ERROR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MAAERW<'a> { - w: &'a mut W, - } - impl<'a> _MAAERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MAAERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Error."] - #[inline] - pub fn no_error(self) -> &'a mut W { - self.variant(MAAERW::NOERROR) - } - #[doc = "Error."] - #[inline] - pub fn error(self) -> &'a mut W { - self.variant(MAAERW::ERROR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AMSW<'a> { - w: &'a mut W, - } - impl<'a> _AMSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BMSW<'a> { - w: &'a mut W, - } - impl<'a> _BMSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EMSW<'a> { - w: &'a mut W, - } - impl<'a> _EMSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MMSW<'a> { - w: &'a mut W, - } - impl<'a> _MMSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AMAW<'a> { - w: &'a mut W, - } - impl<'a> _AMAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BMAW<'a> { - w: &'a mut W, - } - impl<'a> _BMAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RMAW<'a> { - w: &'a mut W, - } - impl<'a> _RMAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TMAW<'a> { - w: &'a mut W, - } - impl<'a> _TMAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Start Calculation. This bit functions as both the control and the status of the MAA. If the size value in the MAWS register is invalid, the STC bit will be cleared by hardware immediately. Otherwise, the STC bit is automatically cleared following the completion of each calculation or detecting an error. Clearing the STC bit resets the controller to its default state."] - #[inline] - pub fn stc(&self) -> STCR { - STCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 1:3 - Calculation Configuration. These bits select desired calculation."] - #[inline] - pub fn clc(&self) -> CLCR { - CLCR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 4 - Optimized Calculation Control. For optimized calculation, unnecessary multiply operations after normalizing the exponent are skipped."] - #[inline] - pub fn ocalc(&self) -> OCALCR { - OCALCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - MAA Error. The MAAER bit defaults to 0 and can only be set by hardware. Once set, it must be cleared by software otherwise no new operation can be initiated. Software writes 1 to this bit has no effect and MAAER will maintain its original state."] - #[inline] - pub fn maaer(&self) -> MAAERR { - MAAERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:9 - Multiplier A Memory Select. These bits select the starting position of the parameter 'a' within the logical segment specified by AMA."] - #[inline] - pub fn ams(&self) -> AMSR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - AMSR { bits } - } - #[doc = "Bits 10:11 - Multiplicand B Memory Select. These bits select the starting position of the parameter 'b' within the logical segment specified by BMA."] - #[inline] - pub fn bms(&self) -> BMSR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BMSR { bits } - } - #[doc = "Bits 12:13 - Exponent Memory Select. These bits select the starting position of the parameter 'e' within the logical segment specified by EMA."] - #[inline] - pub fn ems(&self) -> EMSR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - EMSR { bits } - } - #[doc = "Bits 14:15 - Modulus Memory Select. These bits select the starting position of the parameter 'm' within the logical segment 5."] - #[inline] - pub fn mms(&self) -> MMSR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - MMSR { bits } - } - #[doc = "Bits 16:19 - Multiplier / Operand A Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'a'."] - #[inline] - pub fn ama(&self) -> AMAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - AMAR { bits } - } - #[doc = "Bits 20:23 - Multiplicand / Operand B Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'b'."] - #[inline] - pub fn bma(&self) -> BMAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BMAR { bits } - } - #[doc = "Bits 24:27 - Result Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'r'."] - #[inline] - pub fn rma(&self) -> RMAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RMAR { bits } - } - #[doc = "Bits 28:31 - Temporary Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 't'."] - #[inline] - pub fn tma(&self) -> TMAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TMAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Start Calculation. This bit functions as both the control and the status of the MAA. If the size value in the MAWS register is invalid, the STC bit will be cleared by hardware immediately. Otherwise, the STC bit is automatically cleared following the completion of each calculation or detecting an error. Clearing the STC bit resets the controller to its default state."] - #[inline] - pub fn stc(&mut self) -> _STCW { - _STCW { w: self } - } - #[doc = "Bits 1:3 - Calculation Configuration. These bits select desired calculation."] - #[inline] - pub fn clc(&mut self) -> _CLCW { - _CLCW { w: self } - } - #[doc = "Bit 4 - Optimized Calculation Control. For optimized calculation, unnecessary multiply operations after normalizing the exponent are skipped."] - #[inline] - pub fn ocalc(&mut self) -> _OCALCW { - _OCALCW { w: self } - } - #[doc = "Bit 7 - MAA Error. The MAAER bit defaults to 0 and can only be set by hardware. Once set, it must be cleared by software otherwise no new operation can be initiated. Software writes 1 to this bit has no effect and MAAER will maintain its original state."] - #[inline] - pub fn maaer(&mut self) -> _MAAERW { - _MAAERW { w: self } - } - #[doc = "Bits 8:9 - Multiplier A Memory Select. These bits select the starting position of the parameter 'a' within the logical segment specified by AMA."] - #[inline] - pub fn ams(&mut self) -> _AMSW { - _AMSW { w: self } - } - #[doc = "Bits 10:11 - Multiplicand B Memory Select. These bits select the starting position of the parameter 'b' within the logical segment specified by BMA."] - #[inline] - pub fn bms(&mut self) -> _BMSW { - _BMSW { w: self } - } - #[doc = "Bits 12:13 - Exponent Memory Select. These bits select the starting position of the parameter 'e' within the logical segment specified by EMA."] - #[inline] - pub fn ems(&mut self) -> _EMSW { - _EMSW { w: self } - } - #[doc = "Bits 14:15 - Modulus Memory Select. These bits select the starting position of the parameter 'm' within the logical segment 5."] - #[inline] - pub fn mms(&mut self) -> _MMSW { - _MMSW { w: self } - } - #[doc = "Bits 16:19 - Multiplier / Operand A Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'a'."] - #[inline] - pub fn ama(&mut self) -> _AMAW { - _AMAW { w: self } - } - #[doc = "Bits 20:23 - Multiplicand / Operand B Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'b'."] - #[inline] - pub fn bma(&mut self) -> _BMAW { - _BMAW { w: self } - } - #[doc = "Bits 24:27 - Result Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 'r'."] - #[inline] - pub fn rma(&mut self) -> _RMAW { - _RMAW { w: self } - } - #[doc = "Bits 28:31 - Temporary Memory Assignment. These bits select the logical cryptographic RAM segment for the parameter 't'."] - #[inline] - pub fn tma(&mut self) -> _TMAW { - _TMAW { w: self } - } - } - } - #[doc = "Crypto Data Input. Data input can be written to this register instead of using the DMA. This register writes to the FIFO. This register occupies four successive words to allow the use of multi-store instructions. Words can be written to any location, they will be placed in the FIFO in the order they are written. The endian swap input control bit affects this register."] - pub struct DIN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto Data Input. Data input can be written to this register instead of using the DMA. This register writes to the FIFO. This register occupies four successive words to allow the use of multi-store instructions. Words can be written to any location, they will be placed in the FIFO in the order they are written. The endian swap input control bit affects this register."] - pub mod din { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DIN { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Crypto Data Input. Input can be written to this register instead of using DMA."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Crypto Data Output. Resulting data from cipher calculation. Data is placed in the lower words of these four registers depending on the algorithm. For block cipher modes, this register holds the result of most recent encryption or decryption operation. These registers are affected by the endian swap bits."] - pub struct DOUT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto Data Output. Resulting data from cipher calculation. Data is placed in the lower words of these four registers depending on the algorithm. For block cipher modes, this register holds the result of most recent encryption or decryption operation. These registers are affected by the endian swap bits."] - pub mod dout { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::DOUT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Crypto Data Output. Resulting data from cipher calculation. Data is placed in the lower words of these four registers depending on algorithm."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - } - #[doc = "CRC Polynomial. The polynomial to be used for Galois Field calculations (CRC or LFSR) should be written to this register. This register is affected by the MSB control bit."] - pub struct CRC_POLY { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "CRC Polynomial. The polynomial to be used for Galois Field calculations (CRC or LFSR) should be written to this register. This register is affected by the MSB control bit."] - pub mod crc_poly { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CRC_POLY { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct POLYR { - bits: u32, - } - impl POLYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _POLYW<'a> { - w: &'a mut W, - } - impl<'a> _POLYW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - CRC Polynomial. The polynomial to be used for Galois Field calculations (CRC or LFSR) should be written to this register. This register is affected by the MSB control bit."] - #[inline] - pub fn poly(&self) -> POLYR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - POLYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0xedb8_8320 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - CRC Polynomial. The polynomial to be used for Galois Field calculations (CRC or LFSR) should be written to this register. This register is affected by the MSB control bit."] - #[inline] - pub fn poly(&mut self) -> _POLYW { - _POLYW { w: self } - } - } - } - #[doc = "CRC Value. This is the state for the Galois Field. This register holds the result of a CRC calculation or the current state of the LFSR. This register is affected by the MSB control bit."] - pub struct CRC_VAL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "CRC Value. This is the state for the Galois Field. This register holds the result of a CRC calculation or the current state of the LFSR. This register is affected by the MSB control bit."] - pub mod crc_val { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CRC_VAL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VALR { - bits: u32, - } - impl VALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _VALW<'a> { - w: &'a mut W, - } - impl<'a> _VALW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - CRC Value. This is the state for the Galois Field. This register holds the result of a CRC calculation or the current state of LFSR. This register is affected by the MSB control bit."] - #[inline] - pub fn val(&self) -> VALR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - VALR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0xffff_ffff } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - CRC Value. This is the state for the Galois Field. This register holds the result of a CRC calculation or the current state of LFSR. This register is affected by the MSB control bit."] - #[inline] - pub fn val(&mut self) -> _VALW { - _VALW { w: self } - } - } - } - #[doc = "Pseudo Random Value. Output of the Galois Field shift register. This holds the resulting pseudo-random number if entropy is disabled or true random number if entropy is enabled."] - pub struct CRC_PRNG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pseudo Random Value. Output of the Galois Field shift register. This holds the resulting pseudo-random number if entropy is disabled or true random number if entropy is enabled."] - pub mod crc_prng { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CRC_PRNG { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct PRNGR { - bits: u32, - } - impl PRNGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Pseudo Random Value. Output of the Galois Field Shift Register. This holds the resulting pseudo-random number if entropy is disabled or true random number if entropy is enabled."] - #[inline] - pub fn prng(&self) -> PRNGR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - PRNGR { bits } - } - } - } - #[doc = "Hamming ECC Register."] - pub struct HAM_ECC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Hamming ECC Register."] - pub mod ham_ecc { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HAM_ECC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ECCR { - bits: u16, - } - impl ECCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = "Possible values of the field `PAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARR { - #[doc = "Even."] - EVEN, - #[doc = "Odd."] - ODD, - } - impl PARR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PARR::EVEN => false, - PARR::ODD => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PARR { - match value { - false => PARR::EVEN, - true => PARR::ODD, - } - } - #[doc = "Checks if the value of the field is `EVEN`"] - #[inline] - pub fn is_even(&self) -> bool { - *self == PARR::EVEN - } - #[doc = "Checks if the value of the field is `ODD`"] - #[inline] - pub fn is_odd(&self) -> bool { - *self == PARR::ODD - } - } - #[doc = r" Proxy"] - pub struct _ECCW<'a> { - w: &'a mut W, - } - impl<'a> _ECCW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARW { - #[doc = "Even."] - EVEN, - #[doc = "Odd."] - ODD, - } - impl PARW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PARW::EVEN => false, - PARW::ODD => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PARW<'a> { - w: &'a mut W, - } - impl<'a> _PARW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PARW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Even."] - #[inline] - pub fn even(self) -> &'a mut W { - self.variant(PARW::EVEN) - } - #[doc = "Odd."] - #[inline] - pub fn odd(self) -> &'a mut W { - self.variant(PARW::ODD) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Hamming ECC Value. These bits are the even parity of their corresponding bit groups."] - #[inline] - pub fn ecc(&self) -> ECCR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - ECCR { bits } - } - #[doc = "Bit 16 - Parity. This is the parity of the entire array."] - #[inline] - pub fn par(&self) -> PARR { - PARR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Hamming ECC Value. These bits are the even parity of their corresponding bit groups."] - #[inline] - pub fn ecc(&mut self) -> _ECCW { - _ECCW { w: self } - } - #[doc = "Bit 16 - Parity. This is the parity of the entire array."] - #[inline] - pub fn par(&mut self) -> _PARW { - _PARW { w: self } - } - } - } - #[doc = "Initial Vector. For block cipher operations that use CBC, CFB, OFB, or CNTR modes, this register holds the initial value. This register is updated with each encryption or decryption operation. This register is affected by the endian swap bits."] - pub struct CIPHER_INIT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Initial Vector. For block cipher operations that use CBC, CFB, OFB, or CNTR modes, this register holds the initial value. This register is updated with each encryption or decryption operation. This register is affected by the endian swap bits."] - pub mod cipher_init { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CIPHER_INIT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IVECR { - bits: u32, - } - impl IVECR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _IVECW<'a> { - w: &'a mut W, - } - impl<'a> _IVECW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Initial Vector. For block cipher operations that use CBC, CFB, OFB, or CNTR modes, this register holds the initial value. This register is updated with each encryption or decryption operation. This register is affected by the endian swap bits."] - #[inline] - pub fn ivec(&self) -> IVECR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - IVECR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Initial Vector. For block cipher operations that use CBC, CFB, OFB, or CNTR modes, this register holds the initial value. This register is updated with each encryption or decryption operation. This register is affected by the endian swap bits."] - #[inline] - pub fn ivec(&mut self) -> _IVECW { - _IVECW { w: self } - } - } - } - #[doc = "Cipher Key. This register holds the key used for block cipher operations. The lower words are used for block ciphers that use shorter key lengths. This register is affected by the endian swap input control bits."] - pub struct CIPHER_KEY { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cipher Key. This register holds the key used for block cipher operations. The lower words are used for block ciphers that use shorter key lengths. This register is affected by the endian swap input control bits."] - pub mod cipher_key { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CIPHER_KEY { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _KEYW<'a> { - w: &'a mut W, - } - impl<'a> _KEYW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Cipher Key. This register holds the key used for block cipher operations. The lower words are used for block ciphers that use shorter kye lengths. This register is affected by the endian swap input control bits."] - #[inline] - pub fn key(&mut self) -> _KEYW { - _KEYW { w: self } - } - } - } - #[doc = "This register holds the calculated hash value. This register is affected by the endian swap bits."] - pub struct HASH_DIGEST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "This register holds the calculated hash value. This register is affected by the endian swap bits."] - pub mod hash_digest { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HASH_DIGEST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct HASHR { - bits: u32, - } - impl HASHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _HASHW<'a> { - w: &'a mut W, - } - impl<'a> _HASHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - This register holds the calculated hash value. This register is affected by the endian swap bits."] - #[inline] - pub fn hash(&self) -> HASHR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - HASHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - This register holds the calculated hash value. This register is affected by the endian swap bits."] - #[inline] - pub fn hash(&mut self) -> _HASHW { - _HASHW { w: self } - } - } - } - #[doc = "Message Size. This register holds the lowest 32-bit of message size in bytes."] - pub struct HASH_MSG_SZ { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Message Size. This register holds the lowest 32-bit of message size in bytes."] - pub mod hash_msg_sz { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HASH_MSG_SZ { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct MSGSZR { - bits: u32, - } - impl MSGSZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _MSGSZW<'a> { - w: &'a mut W, - } - impl<'a> _MSGSZW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Message Size. This register holds the lowest 32-bit of message size in bytes."] - #[inline] - pub fn msgsz(&self) -> MSGSZR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - MSGSZR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Message Size. This register holds the lowest 32-bit of message size in bytes."] - #[inline] - pub fn msgsz(&mut self) -> _MSGSZW { - _MSGSZW { w: self } - } - } - } - #[doc = "MAA Word Size. This register defines the number of bits for a modular operation. This register must be set to a valid value prior to the MAA operation start. Valid values are from 1 to 2048. Invalid values are ignored and will not initiate a MAA operation."] - pub struct MAA_MAWS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "MAA Word Size. This register defines the number of bits for a modular operation. This register must be set to a valid value prior to the MAA operation start. Valid values are from 1 to 2048. Invalid values are ignored and will not initiate a MAA operation."] - pub mod maa_maws { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MAA_MAWS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct MAWSR { - bits: u16, - } - impl MAWSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _MAWSW<'a> { - w: &'a mut W, - } - impl<'a> _MAWSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:11 - MAA Word Size."] - #[inline] - pub fn maws(&self) -> MAWSR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MAWSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:11 - MAA Word Size."] - #[inline] - pub fn maws(&mut self) -> _MAWSW { - _MAWSW { w: self } - } - } - } -} -#[doc = "AES Keys."] -pub struct AES_KEY { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for AES_KEY {} -impl AES_KEY { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const aes_key::RegisterBlock { - 0x4000_5000 as *const _ - } -} -impl Deref for AES_KEY { - type Target = aes_key::RegisterBlock; - fn deref(&self) -> &aes_key::RegisterBlock { - unsafe { &*AES_KEY::ptr() } - } -} -#[doc = "AES Keys."] -pub mod aes_key { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - AES Key 0"] - pub aes_key0: AES_KEY0, - _reserved0: [u8; 124usize], - #[doc = "0x80 - AES Key 1"] - pub aes_key1: AES_KEY1, - _reserved1: [u8; 124usize], - #[doc = "0x100 - AES Key 2"] - pub aes_key2: AES_KEY2, - _reserved2: [u8; 124usize], - #[doc = "0x180 - AES Key 3"] - pub aes_key3: AES_KEY3, - } - #[doc = "AES Key 0"] - pub struct AES_KEY0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "AES Key 0"] - pub mod aes_key0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AES_KEY0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "AES Key 1"] - pub struct AES_KEY1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "AES Key 1"] - pub mod aes_key1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AES_KEY1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "AES Key 2"] - pub struct AES_KEY2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "AES Key 2"] - pub mod aes_key2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AES_KEY2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "AES Key 3"] - pub struct AES_KEY3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "AES Key 3"] - pub mod aes_key3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AES_KEY3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } -} -#[doc = "External Memory Cache Controller Registers."] -pub struct EMCC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for EMCC {} -impl EMCC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const emcc::RegisterBlock { - 0x4003_3000 as *const _ - } -} -impl Deref for EMCC { - type Target = emcc::RegisterBlock; - fn deref(&self) -> &emcc::RegisterBlock { - unsafe { &*EMCC::ptr() } - } -} -#[doc = "External Memory Cache Controller Registers."] -pub mod emcc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Cache ID Register."] - pub cache_id: CACHE_ID, - #[doc = "0x04 - Memory Configuration Register."] - pub memcfg: MEMCFG, - _reserved0: [u8; 248usize], - #[doc = "0x100 - Cache Control and Status Register."] - pub cache_ctrl: CACHE_CTRL, - _reserved1: [u8; 1532usize], - #[doc = "0x700 - Invalidate All Cache Contents. Any time this register location is written (regardless of the data value), the cache controller immediately begins invalidating the entire contents of the cache memory. The cache will be in bypass mode until the invalidate operation is complete. System software can examine the Cache Ready bit (CACHE_CTRL.CACHE_RDY) to determine when the invalidate operation is complete. Note that it is not necessary to disable the cache controller prior to beginning this operation. Reads from this register always return 0."] - pub invalidate: INVALIDATE, - } - #[doc = "Cache ID Register."] - pub struct CACHE_ID { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cache ID Register."] - pub mod cache_id { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CACHE_ID { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct RELNUMR { - bits: u8, - } - impl RELNUMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct PARTNUMR { - bits: u8, - } - impl PARTNUMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CCHIDR { - bits: u8, - } - impl CCHIDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:5 - Release Number. Identifies the RTL release version."] - #[inline] - pub fn relnum(&self) -> RELNUMR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RELNUMR { bits } - } - #[doc = "Bits 6:9 - Part Number. This field reflects the value of C_ID_PART_NUMBER configuration parameter."] - #[inline] - pub fn partnum(&self) -> PARTNUMR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - PARTNUMR { bits } - } - #[doc = "Bits 10:15 - Cache ID. This field reflects the value of the C_ID_CACHEID configuration parameter."] - #[inline] - pub fn cchid(&self) -> CCHIDR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CCHIDR { bits } - } - } - } - #[doc = "Memory Configuration Register."] - pub struct MEMCFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Memory Configuration Register."] - pub mod memcfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::MEMCFG { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct CCHSZR { - bits: u16, - } - impl CCHSZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MEMSZR { - bits: u16, - } - impl MEMSZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Cache Size. Indicates total size in Kbytes of cache."] - #[inline] - pub fn cchsz(&self) -> CCHSZR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CCHSZR { bits } - } - #[doc = "Bits 16:31 - Main Memory Size. Indicates the total size, in units of 128 Kbytes, of code memory accessible to the cache controller."] - #[inline] - pub fn memsz(&self) -> MEMSZR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MEMSZR { bits } - } - } - } - #[doc = "Cache Control and Status Register."] - pub struct CACHE_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cache Control and Status Register."] - pub mod cache_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CACHE_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CACHE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_ENR { - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - DIS, - #[doc = "Cache Enabled."] - EN, - } - impl CACHE_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CACHE_ENR::DIS => false, - CACHE_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CACHE_ENR { - match value { - false => CACHE_ENR::DIS, - true => CACHE_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CACHE_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CACHE_ENR::EN - } - } - #[doc = "Possible values of the field `WRITE_ALLOC_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRITE_ALLOC_ENR { - #[doc = "Write-no-allocate."] - DIS, - #[doc = "Write-allocate enabled."] - EN, - } - impl WRITE_ALLOC_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WRITE_ALLOC_ENR::DIS => false, - WRITE_ALLOC_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WRITE_ALLOC_ENR { - match value { - false => WRITE_ALLOC_ENR::DIS, - true => WRITE_ALLOC_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == WRITE_ALLOC_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == WRITE_ALLOC_ENR::EN - } - } - #[doc = "Possible values of the field `CWFST_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CWFST_DISR { - #[doc = "Critical word first and streaming disabled."] - DIS, - #[doc = "Critical word first and streaming enabled."] - EN, - } - impl CWFST_DISR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CWFST_DISR::DIS => true, - CWFST_DISR::EN => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CWFST_DISR { - match value { - true => CWFST_DISR::DIS, - false => CWFST_DISR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CWFST_DISR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CWFST_DISR::EN - } - } - #[doc = "Possible values of the field `CACHE_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_RDYR { - #[doc = "Not Ready."] - NOTREADY, - #[doc = "Ready."] - READY, - } - impl CACHE_RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CACHE_RDYR::NOTREADY => false, - CACHE_RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CACHE_RDYR { - match value { - false => CACHE_RDYR::NOTREADY, - true => CACHE_RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `NOTREADY`"] - #[inline] - pub fn is_not_ready(&self) -> bool { - *self == CACHE_RDYR::NOTREADY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == CACHE_RDYR::READY - } - } - #[doc = "Values that can be written to the field `CACHE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_ENW { - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - DIS, - #[doc = "Cache Enabled."] - EN, - } - impl CACHE_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CACHE_ENW::DIS => false, - CACHE_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CACHE_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CACHE_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CACHE_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CACHE_ENW::DIS) - } - #[doc = "Cache Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CACHE_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WRITE_ALLOC_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRITE_ALLOC_ENW { - #[doc = "Write-no-allocate."] - DIS, - #[doc = "Write-allocate enabled."] - EN, - } - impl WRITE_ALLOC_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WRITE_ALLOC_ENW::DIS => false, - WRITE_ALLOC_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WRITE_ALLOC_ENW<'a> { - w: &'a mut W, - } - impl<'a> _WRITE_ALLOC_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WRITE_ALLOC_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Write-no-allocate."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(WRITE_ALLOC_ENW::DIS) - } - #[doc = "Write-allocate enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(WRITE_ALLOC_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CWFST_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CWFST_DISW { - #[doc = "Critical word first and streaming disabled."] - DIS, - #[doc = "Critical word first and streaming enabled."] - EN, - } - impl CWFST_DISW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CWFST_DISW::DIS => true, - CWFST_DISW::EN => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CWFST_DISW<'a> { - w: &'a mut W, - } - impl<'a> _CWFST_DISW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CWFST_DISW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Critical word first and streaming disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CWFST_DISW::DIS) - } - #[doc = "Critical word first and streaming enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CWFST_DISW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CACHE_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_RDYW { - #[doc = "Not Ready."] - NOTREADY, - #[doc = "Ready."] - READY, - } - impl CACHE_RDYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CACHE_RDYW::NOTREADY => false, - CACHE_RDYW::READY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CACHE_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _CACHE_RDYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CACHE_RDYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Ready."] - #[inline] - pub fn not_ready(self) -> &'a mut W { - self.variant(CACHE_RDYW::NOTREADY) - } - #[doc = "Ready."] - #[inline] - pub fn ready(self) -> &'a mut W { - self.variant(CACHE_RDYW::READY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Cache Enable. Controls whether the cache is bypassed or is in use. Changing the state of this bit will cause the instruction cache to be flushed and its contents invalidated."] - #[inline] - pub fn cache_en(&self) -> CACHE_ENR { - CACHE_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Write Allocate Enable. This bit only writable while the cache is disabled."] - #[inline] - pub fn write_alloc_en(&self) -> WRITE_ALLOC_ENR { - WRITE_ALLOC_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Critical word first and streaming disable. This bit only writeable while the cache is disabled."] - #[inline] - pub fn cwfst_dis(&self) -> CWFST_DISR { - CWFST_DISR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Cache Ready flag. Cleared by hardware when at any time the cache as a whole is invalidated (including a system reset). When this bit is 0, the cache is effectively in bypass mode (instruction fetches will come from main memory or from the line fill buffer). Set by hardware when the invalidate operation is complete and the cache is ready."] - #[inline] - pub fn cache_rdy(&self) -> CACHE_RDYR { - CACHE_RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Cache Enable. Controls whether the cache is bypassed or is in use. Changing the state of this bit will cause the instruction cache to be flushed and its contents invalidated."] - #[inline] - pub fn cache_en(&mut self) -> _CACHE_ENW { - _CACHE_ENW { w: self } - } - #[doc = "Bit 1 - Write Allocate Enable. This bit only writable while the cache is disabled."] - #[inline] - pub fn write_alloc_en(&mut self) -> _WRITE_ALLOC_ENW { - _WRITE_ALLOC_ENW { w: self } - } - #[doc = "Bit 2 - Critical word first and streaming disable. This bit only writeable while the cache is disabled."] - #[inline] - pub fn cwfst_dis(&mut self) -> _CWFST_DISW { - _CWFST_DISW { w: self } - } - #[doc = "Bit 16 - Cache Ready flag. Cleared by hardware when at any time the cache as a whole is invalidated (including a system reset). When this bit is 0, the cache is effectively in bypass mode (instruction fetches will come from main memory or from the line fill buffer). Set by hardware when the invalidate operation is complete and the cache is ready."] - #[inline] - pub fn cache_rdy(&mut self) -> _CACHE_RDYW { - _CACHE_RDYW { w: self } - } - } - } - #[doc = "Invalidate All Cache Contents. Any time this register location is written (regardless of the data value), the cache controller immediately begins invalidating the entire contents of the cache memory. The cache will be in bypass mode until the invalidate operation is complete. System software can examine the Cache Ready bit (CACHE_CTRL.CACHE_RDY) to determine when the invalidate operation is complete. Note that it is not necessary to disable the cache controller prior to beginning this operation. Reads from this register always return 0."] - pub struct INVALIDATE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Invalidate All Cache Contents. Any time this register location is written (regardless of the data value), the cache controller immediately begins invalidating the entire contents of the cache memory. The cache will be in bypass mode until the invalidate operation is complete. System software can examine the Cache Ready bit (CACHE_CTRL.CACHE_RDY) to determine when the invalidate operation is complete. Note that it is not necessary to disable the cache controller prior to beginning this operation. Reads from this register always return 0."] - pub mod invalidate { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INVALIDATE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IAR { - bits: u32, - } - impl IAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _IAW<'a> { - w: &'a mut W, - } - impl<'a> _IAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Invalidate all cache contents."] - #[inline] - pub fn ia(&self) -> IAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - IAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Invalidate all cache contents."] - #[inline] - pub fn ia(&mut self) -> _IAW { - _IAW { w: self } - } - } - } -} -#[doc = "DMA Controller Fully programmable, chaining capable DMA channels."] -pub struct DMA { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for DMA {} -impl DMA { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const dma::RegisterBlock { - 0x4002_8000 as *const _ - } -} -impl Deref for DMA { - type Target = dma::RegisterBlock; - fn deref(&self) -> &dma::RegisterBlock { - unsafe { &*DMA::ptr() } - } -} -#[doc = "DMA Controller Fully programmable, chaining capable DMA channels."] -pub mod dma { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - DMA Control Register."] - pub cn: CN, - #[doc = "0x04 - DMA Interrupt Register."] - pub intr: INTR, - _reserved0: [u8; 248usize], - #[doc = "0x100 - DMA Channel registers."] - pub ch0: CH, - } - #[doc = r" Register block"] - #[repr(C)] - pub struct CH { - _reserved0: [u8; 256usize], - #[doc = "0x100 - DMA Channel Configuration Register."] - pub cfg: self::ch::CFG, - #[doc = "0x104 - DMA Channel Status Register."] - pub st: self::ch::ST, - #[doc = "0x108 - Source Device Address. If SRCINC=1, the counter bits are incremented by 1,2, or 4, depending on the data width of each AHB cycle. For peripheral transfers, some or all of the actual address bits are fixed. If SRCINC=0, this register remains constant. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with the contents of DMA_SRC_RLD."] - pub src: self::ch::SRC, - #[doc = "0x10c - Destination Device Address. For peripheral transfers, some or all of the actual address bits are fixed. If DSTINC=1, this register is incremented on every AHB write out of the DMA FIFO. They are incremented by 1, 2, or 4, depending on the data width of each AHB cycle. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with DMA_DST_RLD."] - pub dst: self::ch::DST, - #[doc = "0x110 - DMA Counter. The user loads this register with the number of bytes to transfer. This counter decreases on every AHB cycle into the DMA FIFO. The decrement will be 1, 2, or 4 depending on the data width of each AHB cycle. When the counter reaches 0, a count-to-zero condition is triggered."] - pub cnt: self::ch::CNT, - #[doc = "0x114 - Source Address Reload Value. The value of this register is loaded into DMA0_SRC upon a count-to-zero condition."] - pub src_rld: self::ch::SRC_RLD, - #[doc = "0x118 - Destination Address Reload Value. The value of this register is loaded into DMA0_DST upon a count-to-zero condition."] - pub dst_rld: self::ch::DST_RLD, - #[doc = "0x11c - DMA Channel Count Reload Register."] - pub cnt_rld: self::ch::CNT_RLD, - } - #[doc = r" Register block"] - #[doc = "DMA Channel registers."] - pub mod ch { - #[doc = "DMA Channel Configuration Register."] - pub struct CFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Channel Configuration Register."] - pub mod cfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CFG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CHEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CHENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CHENR::DIS => false, - CHENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CHENR { - match value { - false => CHENR::DIS, - true => CHENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CHENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CHENR::EN - } - } - #[doc = "Possible values of the field `RLDEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLDENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RLDENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RLDENR::DIS => false, - RLDENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RLDENR { - match value { - false => RLDENR::DIS, - true => RLDENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RLDENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RLDENR::EN - } - } - #[doc = "Possible values of the field `PRI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PRIR { - #[doc = "Highest Priority."] - HIGH, - #[doc = "Medium High Priority."] - MEDHIGH, - #[doc = "Medium Low Priority."] - MEDLOW, - #[doc = "Lowest Priority."] - LOW, - } - impl PRIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PRIR::HIGH => 0, - PRIR::MEDHIGH => 0x01, - PRIR::MEDLOW => 0x02, - PRIR::LOW => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PRIR { - match value { - 0 => PRIR::HIGH, - 1 => PRIR::MEDHIGH, - 2 => PRIR::MEDLOW, - 3 => PRIR::LOW, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == PRIR::HIGH - } - #[doc = "Checks if the value of the field is `MEDHIGH`"] - #[inline] - pub fn is_med_high(&self) -> bool { - *self == PRIR::MEDHIGH - } - #[doc = "Checks if the value of the field is `MEDLOW`"] - #[inline] - pub fn is_med_low(&self) -> bool { - *self == PRIR::MEDLOW - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == PRIR::LOW - } - } - #[doc = "Possible values of the field `REQSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum REQSELR { - #[doc = "Memory To Memory"] - MEMTOMEM, - #[doc = "SPI0 RX"] - SPI0RX, - #[doc = "SPI1 RX"] - SPI1RX, - #[doc = "SPI2 RX"] - SPI2RX, - #[doc = "UART0 RX"] - UART0RX, - #[doc = "UART1 RX"] - UART1RX, - #[doc = "I2C0 RX"] - I2C0RX, - #[doc = "I2C1 RX"] - I2C1RX, - #[doc = "Analog-to-Digital Converter Channel"] - ADC, - #[doc = "UART2 RX"] - UART2RX, - #[doc = "SPI3 RX"] - SPI3RX, - #[doc = "SPI MSS0 RX"] - SPI_MSS0RX, - #[doc = "USB Endpoint 1 RX"] - USBRXEP1, - #[doc = "USB Endpoint 2 RX"] - USBRXEP2, - #[doc = "USB Endpoint 3 RX"] - USBRXEP3, - #[doc = "USB Endpoint 4 RX"] - USBRXEP4, - #[doc = "USB Endpoint 5 RX"] - USBRXEP5, - #[doc = "USB Endpoint 6 RX"] - USBRXEP6, - #[doc = "USB Endpoint 7 RX"] - USBRXEP7, - #[doc = "USB Endpoint 8 RX"] - USBRXEP8, - #[doc = "USB Endpoint 9 RX"] - USBRXEP9, - #[doc = "USB Endpoint 10 RX"] - USBRXEP10, - #[doc = "USB Endpoint 11 RX"] - USBRXEP11, - #[doc = "SPI0 TX"] - SPI0TX, - #[doc = "SPI1 TX"] - SPI1TX, - #[doc = "SPI2 TX"] - SPI2TX, - #[doc = "UART0 TX"] - UART0TX, - #[doc = "UART1 TX"] - UART1TX, - #[doc = "I2C0 TX"] - I2C0TX, - #[doc = "I2C1 TX"] - I2C1TX, - #[doc = "UART2 TX"] - UART2TX, - #[doc = "SPI3 TX"] - SPI3TX, - #[doc = "SPI MSS0 TX"] - SPI_MSS0TX, - #[doc = "USB Endpoint 1 TX"] - USBTXEP1, - #[doc = "USB Endpoint 2 TX"] - USBTXEP2, - #[doc = "USB Endpoint 3 TX"] - USBTXEP3, - #[doc = "USB Endpoint 4 TX"] - USBTXEP4, - #[doc = "USB Endpoint 5 TX"] - USBTXEP5, - #[doc = "USB Endpoint 6 TX"] - USBTXEP6, - #[doc = "USB Endpoint 7 TX"] - USBTXEP7, - #[doc = "USB Endpoint 8 TX"] - USBTXEP8, - #[doc = "USB Endpoint 9 TX"] - USBTXEP9, - #[doc = "USB Endpoint 10 TX"] - USBTXEP10, - #[doc = "USB Endpoint 11 TX"] - USBTXEP11, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl REQSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - REQSELR::MEMTOMEM => 0, - REQSELR::SPI0RX => 0x01, - REQSELR::SPI1RX => 0x02, - REQSELR::SPI2RX => 0x03, - REQSELR::UART0RX => 0x04, - REQSELR::UART1RX => 0x05, - REQSELR::I2C0RX => 0x07, - REQSELR::I2C1RX => 0x08, - REQSELR::ADC => 0x09, - REQSELR::UART2RX => 0x0e, - REQSELR::SPI3RX => 0x0f, - REQSELR::SPI_MSS0RX => 0x10, - REQSELR::USBRXEP1 => 0x11, - REQSELR::USBRXEP2 => 0x12, - REQSELR::USBRXEP3 => 0x13, - REQSELR::USBRXEP4 => 0x14, - REQSELR::USBRXEP5 => 0x15, - REQSELR::USBRXEP6 => 0x16, - REQSELR::USBRXEP7 => 0x17, - REQSELR::USBRXEP8 => 0x18, - REQSELR::USBRXEP9 => 0x19, - REQSELR::USBRXEP10 => 0x1a, - REQSELR::USBRXEP11 => 0x1b, - REQSELR::SPI0TX => 0x21, - REQSELR::SPI1TX => 0x22, - REQSELR::SPI2TX => 0x23, - REQSELR::UART0TX => 0x24, - REQSELR::UART1TX => 0x25, - REQSELR::I2C0TX => 0x27, - REQSELR::I2C1TX => 0x28, - REQSELR::UART2TX => 0x2e, - REQSELR::SPI3TX => 0x2f, - REQSELR::SPI_MSS0TX => 0x30, - REQSELR::USBTXEP1 => 0x31, - REQSELR::USBTXEP2 => 0x32, - REQSELR::USBTXEP3 => 0x33, - REQSELR::USBTXEP4 => 0x34, - REQSELR::USBTXEP5 => 0x35, - REQSELR::USBTXEP6 => 0x36, - REQSELR::USBTXEP7 => 0x37, - REQSELR::USBTXEP8 => 0x38, - REQSELR::USBTXEP9 => 0x39, - REQSELR::USBTXEP10 => 0x3a, - REQSELR::USBTXEP11 => 0x3b, - REQSELR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> REQSELR { - match value { - 0 => REQSELR::MEMTOMEM, - 1 => REQSELR::SPI0RX, - 2 => REQSELR::SPI1RX, - 3 => REQSELR::SPI2RX, - 4 => REQSELR::UART0RX, - 5 => REQSELR::UART1RX, - 7 => REQSELR::I2C0RX, - 8 => REQSELR::I2C1RX, - 9 => REQSELR::ADC, - 14 => REQSELR::UART2RX, - 15 => REQSELR::SPI3RX, - 16 => REQSELR::SPI_MSS0RX, - 17 => REQSELR::USBRXEP1, - 18 => REQSELR::USBRXEP2, - 19 => REQSELR::USBRXEP3, - 20 => REQSELR::USBRXEP4, - 21 => REQSELR::USBRXEP5, - 22 => REQSELR::USBRXEP6, - 23 => REQSELR::USBRXEP7, - 24 => REQSELR::USBRXEP8, - 25 => REQSELR::USBRXEP9, - 26 => REQSELR::USBRXEP10, - 27 => REQSELR::USBRXEP11, - 33 => REQSELR::SPI0TX, - 34 => REQSELR::SPI1TX, - 35 => REQSELR::SPI2TX, - 36 => REQSELR::UART0TX, - 37 => REQSELR::UART1TX, - 39 => REQSELR::I2C0TX, - 40 => REQSELR::I2C1TX, - 46 => REQSELR::UART2TX, - 47 => REQSELR::SPI3TX, - 48 => REQSELR::SPI_MSS0TX, - 49 => REQSELR::USBTXEP1, - 50 => REQSELR::USBTXEP2, - 51 => REQSELR::USBTXEP3, - 52 => REQSELR::USBTXEP4, - 53 => REQSELR::USBTXEP5, - 54 => REQSELR::USBTXEP6, - 55 => REQSELR::USBTXEP7, - 56 => REQSELR::USBTXEP8, - 57 => REQSELR::USBTXEP9, - 58 => REQSELR::USBTXEP10, - 59 => REQSELR::USBTXEP11, - i => REQSELR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `MEMTOMEM`"] - #[inline] - pub fn is_memtomem(&self) -> bool { - *self == REQSELR::MEMTOMEM - } - #[doc = "Checks if the value of the field is `SPI0RX`"] - #[inline] - pub fn is_spi0rx(&self) -> bool { - *self == REQSELR::SPI0RX - } - #[doc = "Checks if the value of the field is `SPI1RX`"] - #[inline] - pub fn is_spi1rx(&self) -> bool { - *self == REQSELR::SPI1RX - } - #[doc = "Checks if the value of the field is `SPI2RX`"] - #[inline] - pub fn is_spi2rx(&self) -> bool { - *self == REQSELR::SPI2RX - } - #[doc = "Checks if the value of the field is `UART0RX`"] - #[inline] - pub fn is_uart0rx(&self) -> bool { - *self == REQSELR::UART0RX - } - #[doc = "Checks if the value of the field is `UART1RX`"] - #[inline] - pub fn is_uart1rx(&self) -> bool { - *self == REQSELR::UART1RX - } - #[doc = "Checks if the value of the field is `I2C0RX`"] - #[inline] - pub fn is_i2c0rx(&self) -> bool { - *self == REQSELR::I2C0RX - } - #[doc = "Checks if the value of the field is `I2C1RX`"] - #[inline] - pub fn is_i2c1rx(&self) -> bool { - *self == REQSELR::I2C1RX - } - #[doc = "Checks if the value of the field is `ADC`"] - #[inline] - pub fn is_adc(&self) -> bool { - *self == REQSELR::ADC - } - #[doc = "Checks if the value of the field is `UART2RX`"] - #[inline] - pub fn is_uart2rx(&self) -> bool { - *self == REQSELR::UART2RX - } - #[doc = "Checks if the value of the field is `SPI3RX`"] - #[inline] - pub fn is_spi3rx(&self) -> bool { - *self == REQSELR::SPI3RX - } - #[doc = "Checks if the value of the field is `SPI_MSS0RX`"] - #[inline] - pub fn is_spi_mss0rx(&self) -> bool { - *self == REQSELR::SPI_MSS0RX - } - #[doc = "Checks if the value of the field is `USBRXEP1`"] - #[inline] - pub fn is_usbrxep1(&self) -> bool { - *self == REQSELR::USBRXEP1 - } - #[doc = "Checks if the value of the field is `USBRXEP2`"] - #[inline] - pub fn is_usbrxep2(&self) -> bool { - *self == REQSELR::USBRXEP2 - } - #[doc = "Checks if the value of the field is `USBRXEP3`"] - #[inline] - pub fn is_usbrxep3(&self) -> bool { - *self == REQSELR::USBRXEP3 - } - #[doc = "Checks if the value of the field is `USBRXEP4`"] - #[inline] - pub fn is_usbrxep4(&self) -> bool { - *self == REQSELR::USBRXEP4 - } - #[doc = "Checks if the value of the field is `USBRXEP5`"] - #[inline] - pub fn is_usbrxep5(&self) -> bool { - *self == REQSELR::USBRXEP5 - } - #[doc = "Checks if the value of the field is `USBRXEP6`"] - #[inline] - pub fn is_usbrxep6(&self) -> bool { - *self == REQSELR::USBRXEP6 - } - #[doc = "Checks if the value of the field is `USBRXEP7`"] - #[inline] - pub fn is_usbrxep7(&self) -> bool { - *self == REQSELR::USBRXEP7 - } - #[doc = "Checks if the value of the field is `USBRXEP8`"] - #[inline] - pub fn is_usbrxep8(&self) -> bool { - *self == REQSELR::USBRXEP8 - } - #[doc = "Checks if the value of the field is `USBRXEP9`"] - #[inline] - pub fn is_usbrxep9(&self) -> bool { - *self == REQSELR::USBRXEP9 - } - #[doc = "Checks if the value of the field is `USBRXEP10`"] - #[inline] - pub fn is_usbrxep10(&self) -> bool { - *self == REQSELR::USBRXEP10 - } - #[doc = "Checks if the value of the field is `USBRXEP11`"] - #[inline] - pub fn is_usbrxep11(&self) -> bool { - *self == REQSELR::USBRXEP11 - } - #[doc = "Checks if the value of the field is `SPI0TX`"] - #[inline] - pub fn is_spi0tx(&self) -> bool { - *self == REQSELR::SPI0TX - } - #[doc = "Checks if the value of the field is `SPI1TX`"] - #[inline] - pub fn is_spi1tx(&self) -> bool { - *self == REQSELR::SPI1TX - } - #[doc = "Checks if the value of the field is `SPI2TX`"] - #[inline] - pub fn is_spi2tx(&self) -> bool { - *self == REQSELR::SPI2TX - } - #[doc = "Checks if the value of the field is `UART0TX`"] - #[inline] - pub fn is_uart0tx(&self) -> bool { - *self == REQSELR::UART0TX - } - #[doc = "Checks if the value of the field is `UART1TX`"] - #[inline] - pub fn is_uart1tx(&self) -> bool { - *self == REQSELR::UART1TX - } - #[doc = "Checks if the value of the field is `I2C0TX`"] - #[inline] - pub fn is_i2c0tx(&self) -> bool { - *self == REQSELR::I2C0TX - } - #[doc = "Checks if the value of the field is `I2C1TX`"] - #[inline] - pub fn is_i2c1tx(&self) -> bool { - *self == REQSELR::I2C1TX - } - #[doc = "Checks if the value of the field is `UART2TX`"] - #[inline] - pub fn is_uart2tx(&self) -> bool { - *self == REQSELR::UART2TX - } - #[doc = "Checks if the value of the field is `SPI3TX`"] - #[inline] - pub fn is_spi3tx(&self) -> bool { - *self == REQSELR::SPI3TX - } - #[doc = "Checks if the value of the field is `SPI_MSS0TX`"] - #[inline] - pub fn is_spi_mss0tx(&self) -> bool { - *self == REQSELR::SPI_MSS0TX - } - #[doc = "Checks if the value of the field is `USBTXEP1`"] - #[inline] - pub fn is_usbtxep1(&self) -> bool { - *self == REQSELR::USBTXEP1 - } - #[doc = "Checks if the value of the field is `USBTXEP2`"] - #[inline] - pub fn is_usbtxep2(&self) -> bool { - *self == REQSELR::USBTXEP2 - } - #[doc = "Checks if the value of the field is `USBTXEP3`"] - #[inline] - pub fn is_usbtxep3(&self) -> bool { - *self == REQSELR::USBTXEP3 - } - #[doc = "Checks if the value of the field is `USBTXEP4`"] - #[inline] - pub fn is_usbtxep4(&self) -> bool { - *self == REQSELR::USBTXEP4 - } - #[doc = "Checks if the value of the field is `USBTXEP5`"] - #[inline] - pub fn is_usbtxep5(&self) -> bool { - *self == REQSELR::USBTXEP5 - } - #[doc = "Checks if the value of the field is `USBTXEP6`"] - #[inline] - pub fn is_usbtxep6(&self) -> bool { - *self == REQSELR::USBTXEP6 - } - #[doc = "Checks if the value of the field is `USBTXEP7`"] - #[inline] - pub fn is_usbtxep7(&self) -> bool { - *self == REQSELR::USBTXEP7 - } - #[doc = "Checks if the value of the field is `USBTXEP8`"] - #[inline] - pub fn is_usbtxep8(&self) -> bool { - *self == REQSELR::USBTXEP8 - } - #[doc = "Checks if the value of the field is `USBTXEP9`"] - #[inline] - pub fn is_usbtxep9(&self) -> bool { - *self == REQSELR::USBTXEP9 - } - #[doc = "Checks if the value of the field is `USBTXEP10`"] - #[inline] - pub fn is_usbtxep10(&self) -> bool { - *self == REQSELR::USBTXEP10 - } - #[doc = "Checks if the value of the field is `USBTXEP11`"] - #[inline] - pub fn is_usbtxep11(&self) -> bool { - *self == REQSELR::USBTXEP11 - } - } - #[doc = "Possible values of the field `REQWAIT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum REQWAITR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl REQWAITR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - REQWAITR::DIS => false, - REQWAITR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> REQWAITR { - match value { - false => REQWAITR::DIS, - true => REQWAITR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == REQWAITR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == REQWAITR::EN - } - } - #[doc = "Possible values of the field `TOSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TOSELR { - #[doc = "Timeout of 3 to 4 prescale clocks."] - TO4, - #[doc = "Timeout of 7 to 8 prescale clocks."] - TO8, - #[doc = "Timeout of 15 to 16 prescale clocks."] - TO16, - #[doc = "Timeout of 31 to 32 prescale clocks."] - TO32, - #[doc = "Timeout of 63 to 64 prescale clocks."] - TO64, - #[doc = "Timeout of 127 to 128 prescale clocks."] - TO128, - #[doc = "Timeout of 255 to 256 prescale clocks."] - TO256, - #[doc = "Timeout of 511 to 512 prescale clocks."] - TO512, - } - impl TOSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - TOSELR::TO4 => 0, - TOSELR::TO8 => 0x01, - TOSELR::TO16 => 0x02, - TOSELR::TO32 => 0x03, - TOSELR::TO64 => 0x04, - TOSELR::TO128 => 0x05, - TOSELR::TO256 => 0x06, - TOSELR::TO512 => 0x07, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> TOSELR { - match value { - 0 => TOSELR::TO4, - 1 => TOSELR::TO8, - 2 => TOSELR::TO16, - 3 => TOSELR::TO32, - 4 => TOSELR::TO64, - 5 => TOSELR::TO128, - 6 => TOSELR::TO256, - 7 => TOSELR::TO512, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `TO4`"] - #[inline] - pub fn is_to4(&self) -> bool { - *self == TOSELR::TO4 - } - #[doc = "Checks if the value of the field is `TO8`"] - #[inline] - pub fn is_to8(&self) -> bool { - *self == TOSELR::TO8 - } - #[doc = "Checks if the value of the field is `TO16`"] - #[inline] - pub fn is_to16(&self) -> bool { - *self == TOSELR::TO16 - } - #[doc = "Checks if the value of the field is `TO32`"] - #[inline] - pub fn is_to32(&self) -> bool { - *self == TOSELR::TO32 - } - #[doc = "Checks if the value of the field is `TO64`"] - #[inline] - pub fn is_to64(&self) -> bool { - *self == TOSELR::TO64 - } - #[doc = "Checks if the value of the field is `TO128`"] - #[inline] - pub fn is_to128(&self) -> bool { - *self == TOSELR::TO128 - } - #[doc = "Checks if the value of the field is `TO256`"] - #[inline] - pub fn is_to256(&self) -> bool { - *self == TOSELR::TO256 - } - #[doc = "Checks if the value of the field is `TO512`"] - #[inline] - pub fn is_to512(&self) -> bool { - *self == TOSELR::TO512 - } - } - #[doc = "Possible values of the field `PSSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PSSELR { - #[doc = "Disable timer."] - DIS, - #[doc = "hclk / 256."] - DIV256, - #[doc = "hclk / 64k."] - DIV64K, - #[doc = "hclk / 16M."] - DIV16M, - } - impl PSSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PSSELR::DIS => 0, - PSSELR::DIV256 => 0x01, - PSSELR::DIV64K => 0x02, - PSSELR::DIV16M => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PSSELR { - match value { - 0 => PSSELR::DIS, - 1 => PSSELR::DIV256, - 2 => PSSELR::DIV64K, - 3 => PSSELR::DIV16M, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PSSELR::DIS - } - #[doc = "Checks if the value of the field is `DIV256`"] - #[inline] - pub fn is_div256(&self) -> bool { - *self == PSSELR::DIV256 - } - #[doc = "Checks if the value of the field is `DIV64K`"] - #[inline] - pub fn is_div64k(&self) -> bool { - *self == PSSELR::DIV64K - } - #[doc = "Checks if the value of the field is `DIV16M`"] - #[inline] - pub fn is_div16m(&self) -> bool { - *self == PSSELR::DIV16M - } - } - #[doc = "Possible values of the field `SRCWD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCWDR { - #[doc = "Byte."] - BYTE, - #[doc = "Halfword."] - HALFWORD, - #[doc = "Word."] - WORD, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SRCWDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SRCWDR::BYTE => 0, - SRCWDR::HALFWORD => 0x01, - SRCWDR::WORD => 0x02, - SRCWDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SRCWDR { - match value { - 0 => SRCWDR::BYTE, - 1 => SRCWDR::HALFWORD, - 2 => SRCWDR::WORD, - i => SRCWDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `BYTE`"] - #[inline] - pub fn is_byte(&self) -> bool { - *self == SRCWDR::BYTE - } - #[doc = "Checks if the value of the field is `HALFWORD`"] - #[inline] - pub fn is_half_word(&self) -> bool { - *self == SRCWDR::HALFWORD - } - #[doc = "Checks if the value of the field is `WORD`"] - #[inline] - pub fn is_word(&self) -> bool { - *self == SRCWDR::WORD - } - } - #[doc = "Possible values of the field `SRCINC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCINCR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl SRCINCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRCINCR::DIS => false, - SRCINCR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRCINCR { - match value { - false => SRCINCR::DIS, - true => SRCINCR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SRCINCR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SRCINCR::EN - } - } - #[doc = "Possible values of the field `DSTWD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSTWDR { - #[doc = "Byte."] - BYTE, - #[doc = "Halfword."] - HALFWORD, - #[doc = "Word."] - WORD, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl DSTWDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - DSTWDR::BYTE => 0, - DSTWDR::HALFWORD => 0x01, - DSTWDR::WORD => 0x02, - DSTWDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> DSTWDR { - match value { - 0 => DSTWDR::BYTE, - 1 => DSTWDR::HALFWORD, - 2 => DSTWDR::WORD, - i => DSTWDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `BYTE`"] - #[inline] - pub fn is_byte(&self) -> bool { - *self == DSTWDR::BYTE - } - #[doc = "Checks if the value of the field is `HALFWORD`"] - #[inline] - pub fn is_half_word(&self) -> bool { - *self == DSTWDR::HALFWORD - } - #[doc = "Checks if the value of the field is `WORD`"] - #[inline] - pub fn is_word(&self) -> bool { - *self == DSTWDR::WORD - } - } - #[doc = "Possible values of the field `DSTINC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSTINCR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl DSTINCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DSTINCR::DIS => false, - DSTINCR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DSTINCR { - match value { - false => DSTINCR::DIS, - true => DSTINCR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DSTINCR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DSTINCR::EN - } - } - #[doc = r" Value of the field"] - pub struct BRSTR { - bits: u8, - } - impl BRSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `CHDIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHDIENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CHDIENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CHDIENR::DIS => false, - CHDIENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CHDIENR { - match value { - false => CHDIENR::DIS, - true => CHDIENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CHDIENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CHDIENR::EN - } - } - #[doc = "Possible values of the field `CTZIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CTZIENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CTZIENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CTZIENR::DIS => false, - CTZIENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CTZIENR { - match value { - false => CTZIENR::DIS, - true => CTZIENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CTZIENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CTZIENR::EN - } - } - #[doc = "Values that can be written to the field `CHEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CHENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CHENW::DIS => false, - CHENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CHENW<'a> { - w: &'a mut W, - } - impl<'a> _CHENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CHENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CHENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CHENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RLDEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLDENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RLDENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RLDENW::DIS => false, - RLDENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RLDENW<'a> { - w: &'a mut W, - } - impl<'a> _RLDENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RLDENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RLDENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RLDENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PRI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PRIW { - #[doc = "Highest Priority."] - HIGH, - #[doc = "Medium High Priority."] - MEDHIGH, - #[doc = "Medium Low Priority."] - MEDLOW, - #[doc = "Lowest Priority."] - LOW, - } - impl PRIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PRIW::HIGH => 0, - PRIW::MEDHIGH => 1, - PRIW::MEDLOW => 2, - PRIW::LOW => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _PRIW<'a> { - w: &'a mut W, - } - impl<'a> _PRIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PRIW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Highest Priority."] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(PRIW::HIGH) - } - #[doc = "Medium High Priority."] - #[inline] - pub fn med_high(self) -> &'a mut W { - self.variant(PRIW::MEDHIGH) - } - #[doc = "Medium Low Priority."] - #[inline] - pub fn med_low(self) -> &'a mut W { - self.variant(PRIW::MEDLOW) - } - #[doc = "Lowest Priority."] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(PRIW::LOW) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `REQSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum REQSELW { - #[doc = "Memory To Memory"] - MEMTOMEM, - #[doc = "SPI0 RX"] - SPI0RX, - #[doc = "SPI1 RX"] - SPI1RX, - #[doc = "SPI2 RX"] - SPI2RX, - #[doc = "UART0 RX"] - UART0RX, - #[doc = "UART1 RX"] - UART1RX, - #[doc = "I2C0 RX"] - I2C0RX, - #[doc = "I2C1 RX"] - I2C1RX, - #[doc = "Analog-to-Digital Converter Channel"] - ADC, - #[doc = "UART2 RX"] - UART2RX, - #[doc = "SPI3 RX"] - SPI3RX, - #[doc = "SPI MSS0 RX"] - SPI_MSS0RX, - #[doc = "USB Endpoint 1 RX"] - USBRXEP1, - #[doc = "USB Endpoint 2 RX"] - USBRXEP2, - #[doc = "USB Endpoint 3 RX"] - USBRXEP3, - #[doc = "USB Endpoint 4 RX"] - USBRXEP4, - #[doc = "USB Endpoint 5 RX"] - USBRXEP5, - #[doc = "USB Endpoint 6 RX"] - USBRXEP6, - #[doc = "USB Endpoint 7 RX"] - USBRXEP7, - #[doc = "USB Endpoint 8 RX"] - USBRXEP8, - #[doc = "USB Endpoint 9 RX"] - USBRXEP9, - #[doc = "USB Endpoint 10 RX"] - USBRXEP10, - #[doc = "USB Endpoint 11 RX"] - USBRXEP11, - #[doc = "SPI0 TX"] - SPI0TX, - #[doc = "SPI1 TX"] - SPI1TX, - #[doc = "SPI2 TX"] - SPI2TX, - #[doc = "UART0 TX"] - UART0TX, - #[doc = "UART1 TX"] - UART1TX, - #[doc = "I2C0 TX"] - I2C0TX, - #[doc = "I2C1 TX"] - I2C1TX, - #[doc = "UART2 TX"] - UART2TX, - #[doc = "SPI3 TX"] - SPI3TX, - #[doc = "SPI MSS0 TX"] - SPI_MSS0TX, - #[doc = "USB Endpoint 1 TX"] - USBTXEP1, - #[doc = "USB Endpoint 2 TX"] - USBTXEP2, - #[doc = "USB Endpoint 3 TX"] - USBTXEP3, - #[doc = "USB Endpoint 4 TX"] - USBTXEP4, - #[doc = "USB Endpoint 5 TX"] - USBTXEP5, - #[doc = "USB Endpoint 6 TX"] - USBTXEP6, - #[doc = "USB Endpoint 7 TX"] - USBTXEP7, - #[doc = "USB Endpoint 8 TX"] - USBTXEP8, - #[doc = "USB Endpoint 9 TX"] - USBTXEP9, - #[doc = "USB Endpoint 10 TX"] - USBTXEP10, - #[doc = "USB Endpoint 11 TX"] - USBTXEP11, - } - impl REQSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - REQSELW::MEMTOMEM => 0, - REQSELW::SPI0RX => 1, - REQSELW::SPI1RX => 2, - REQSELW::SPI2RX => 3, - REQSELW::UART0RX => 4, - REQSELW::UART1RX => 5, - REQSELW::I2C0RX => 7, - REQSELW::I2C1RX => 8, - REQSELW::ADC => 9, - REQSELW::UART2RX => 14, - REQSELW::SPI3RX => 15, - REQSELW::SPI_MSS0RX => 16, - REQSELW::USBRXEP1 => 17, - REQSELW::USBRXEP2 => 18, - REQSELW::USBRXEP3 => 19, - REQSELW::USBRXEP4 => 20, - REQSELW::USBRXEP5 => 21, - REQSELW::USBRXEP6 => 22, - REQSELW::USBRXEP7 => 23, - REQSELW::USBRXEP8 => 24, - REQSELW::USBRXEP9 => 25, - REQSELW::USBRXEP10 => 26, - REQSELW::USBRXEP11 => 27, - REQSELW::SPI0TX => 33, - REQSELW::SPI1TX => 34, - REQSELW::SPI2TX => 35, - REQSELW::UART0TX => 36, - REQSELW::UART1TX => 37, - REQSELW::I2C0TX => 39, - REQSELW::I2C1TX => 40, - REQSELW::UART2TX => 46, - REQSELW::SPI3TX => 47, - REQSELW::SPI_MSS0TX => 48, - REQSELW::USBTXEP1 => 49, - REQSELW::USBTXEP2 => 50, - REQSELW::USBTXEP3 => 51, - REQSELW::USBTXEP4 => 52, - REQSELW::USBTXEP5 => 53, - REQSELW::USBTXEP6 => 54, - REQSELW::USBTXEP7 => 55, - REQSELW::USBTXEP8 => 56, - REQSELW::USBTXEP9 => 57, - REQSELW::USBTXEP10 => 58, - REQSELW::USBTXEP11 => 59, - } - } - } - #[doc = r" Proxy"] - pub struct _REQSELW<'a> { - w: &'a mut W, - } - impl<'a> _REQSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: REQSELW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Memory To Memory"] - #[inline] - pub fn memtomem(self) -> &'a mut W { - self.variant(REQSELW::MEMTOMEM) - } - #[doc = "SPI0 RX"] - #[inline] - pub fn spi0rx(self) -> &'a mut W { - self.variant(REQSELW::SPI0RX) - } - #[doc = "SPI1 RX"] - #[inline] - pub fn spi1rx(self) -> &'a mut W { - self.variant(REQSELW::SPI1RX) - } - #[doc = "SPI2 RX"] - #[inline] - pub fn spi2rx(self) -> &'a mut W { - self.variant(REQSELW::SPI2RX) - } - #[doc = "UART0 RX"] - #[inline] - pub fn uart0rx(self) -> &'a mut W { - self.variant(REQSELW::UART0RX) - } - #[doc = "UART1 RX"] - #[inline] - pub fn uart1rx(self) -> &'a mut W { - self.variant(REQSELW::UART1RX) - } - #[doc = "I2C0 RX"] - #[inline] - pub fn i2c0rx(self) -> &'a mut W { - self.variant(REQSELW::I2C0RX) - } - #[doc = "I2C1 RX"] - #[inline] - pub fn i2c1rx(self) -> &'a mut W { - self.variant(REQSELW::I2C1RX) - } - #[doc = "Analog-to-Digital Converter Channel"] - #[inline] - pub fn adc(self) -> &'a mut W { - self.variant(REQSELW::ADC) - } - #[doc = "UART2 RX"] - #[inline] - pub fn uart2rx(self) -> &'a mut W { - self.variant(REQSELW::UART2RX) - } - #[doc = "SPI3 RX"] - #[inline] - pub fn spi3rx(self) -> &'a mut W { - self.variant(REQSELW::SPI3RX) - } - #[doc = "SPI MSS0 RX"] - #[inline] - pub fn spi_mss0rx(self) -> &'a mut W { - self.variant(REQSELW::SPI_MSS0RX) - } - #[doc = "USB Endpoint 1 RX"] - #[inline] - pub fn usbrxep1(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP1) - } - #[doc = "USB Endpoint 2 RX"] - #[inline] - pub fn usbrxep2(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP2) - } - #[doc = "USB Endpoint 3 RX"] - #[inline] - pub fn usbrxep3(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP3) - } - #[doc = "USB Endpoint 4 RX"] - #[inline] - pub fn usbrxep4(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP4) - } - #[doc = "USB Endpoint 5 RX"] - #[inline] - pub fn usbrxep5(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP5) - } - #[doc = "USB Endpoint 6 RX"] - #[inline] - pub fn usbrxep6(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP6) - } - #[doc = "USB Endpoint 7 RX"] - #[inline] - pub fn usbrxep7(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP7) - } - #[doc = "USB Endpoint 8 RX"] - #[inline] - pub fn usbrxep8(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP8) - } - #[doc = "USB Endpoint 9 RX"] - #[inline] - pub fn usbrxep9(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP9) - } - #[doc = "USB Endpoint 10 RX"] - #[inline] - pub fn usbrxep10(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP10) - } - #[doc = "USB Endpoint 11 RX"] - #[inline] - pub fn usbrxep11(self) -> &'a mut W { - self.variant(REQSELW::USBRXEP11) - } - #[doc = "SPI0 TX"] - #[inline] - pub fn spi0tx(self) -> &'a mut W { - self.variant(REQSELW::SPI0TX) - } - #[doc = "SPI1 TX"] - #[inline] - pub fn spi1tx(self) -> &'a mut W { - self.variant(REQSELW::SPI1TX) - } - #[doc = "SPI2 TX"] - #[inline] - pub fn spi2tx(self) -> &'a mut W { - self.variant(REQSELW::SPI2TX) - } - #[doc = "UART0 TX"] - #[inline] - pub fn uart0tx(self) -> &'a mut W { - self.variant(REQSELW::UART0TX) - } - #[doc = "UART1 TX"] - #[inline] - pub fn uart1tx(self) -> &'a mut W { - self.variant(REQSELW::UART1TX) - } - #[doc = "I2C0 TX"] - #[inline] - pub fn i2c0tx(self) -> &'a mut W { - self.variant(REQSELW::I2C0TX) - } - #[doc = "I2C1 TX"] - #[inline] - pub fn i2c1tx(self) -> &'a mut W { - self.variant(REQSELW::I2C1TX) - } - #[doc = "UART2 TX"] - #[inline] - pub fn uart2tx(self) -> &'a mut W { - self.variant(REQSELW::UART2TX) - } - #[doc = "SPI3 TX"] - #[inline] - pub fn spi3tx(self) -> &'a mut W { - self.variant(REQSELW::SPI3TX) - } - #[doc = "SPI MSS0 TX"] - #[inline] - pub fn spi_mss0tx(self) -> &'a mut W { - self.variant(REQSELW::SPI_MSS0TX) - } - #[doc = "USB Endpoint 1 TX"] - #[inline] - pub fn usbtxep1(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP1) - } - #[doc = "USB Endpoint 2 TX"] - #[inline] - pub fn usbtxep2(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP2) - } - #[doc = "USB Endpoint 3 TX"] - #[inline] - pub fn usbtxep3(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP3) - } - #[doc = "USB Endpoint 4 TX"] - #[inline] - pub fn usbtxep4(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP4) - } - #[doc = "USB Endpoint 5 TX"] - #[inline] - pub fn usbtxep5(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP5) - } - #[doc = "USB Endpoint 6 TX"] - #[inline] - pub fn usbtxep6(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP6) - } - #[doc = "USB Endpoint 7 TX"] - #[inline] - pub fn usbtxep7(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP7) - } - #[doc = "USB Endpoint 8 TX"] - #[inline] - pub fn usbtxep8(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP8) - } - #[doc = "USB Endpoint 9 TX"] - #[inline] - pub fn usbtxep9(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP9) - } - #[doc = "USB Endpoint 10 TX"] - #[inline] - pub fn usbtxep10(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP10) - } - #[doc = "USB Endpoint 11 TX"] - #[inline] - pub fn usbtxep11(self) -> &'a mut W { - self.variant(REQSELW::USBTXEP11) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `REQWAIT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum REQWAITW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl REQWAITW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - REQWAITW::DIS => false, - REQWAITW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _REQWAITW<'a> { - w: &'a mut W, - } - impl<'a> _REQWAITW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: REQWAITW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(REQWAITW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(REQWAITW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TOSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TOSELW { - #[doc = "Timeout of 3 to 4 prescale clocks."] - TO4, - #[doc = "Timeout of 7 to 8 prescale clocks."] - TO8, - #[doc = "Timeout of 15 to 16 prescale clocks."] - TO16, - #[doc = "Timeout of 31 to 32 prescale clocks."] - TO32, - #[doc = "Timeout of 63 to 64 prescale clocks."] - TO64, - #[doc = "Timeout of 127 to 128 prescale clocks."] - TO128, - #[doc = "Timeout of 255 to 256 prescale clocks."] - TO256, - #[doc = "Timeout of 511 to 512 prescale clocks."] - TO512, - } - impl TOSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - TOSELW::TO4 => 0, - TOSELW::TO8 => 1, - TOSELW::TO16 => 2, - TOSELW::TO32 => 3, - TOSELW::TO64 => 4, - TOSELW::TO128 => 5, - TOSELW::TO256 => 6, - TOSELW::TO512 => 7, - } - } - } - #[doc = r" Proxy"] - pub struct _TOSELW<'a> { - w: &'a mut W, - } - impl<'a> _TOSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TOSELW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Timeout of 3 to 4 prescale clocks."] - #[inline] - pub fn to4(self) -> &'a mut W { - self.variant(TOSELW::TO4) - } - #[doc = "Timeout of 7 to 8 prescale clocks."] - #[inline] - pub fn to8(self) -> &'a mut W { - self.variant(TOSELW::TO8) - } - #[doc = "Timeout of 15 to 16 prescale clocks."] - #[inline] - pub fn to16(self) -> &'a mut W { - self.variant(TOSELW::TO16) - } - #[doc = "Timeout of 31 to 32 prescale clocks."] - #[inline] - pub fn to32(self) -> &'a mut W { - self.variant(TOSELW::TO32) - } - #[doc = "Timeout of 63 to 64 prescale clocks."] - #[inline] - pub fn to64(self) -> &'a mut W { - self.variant(TOSELW::TO64) - } - #[doc = "Timeout of 127 to 128 prescale clocks."] - #[inline] - pub fn to128(self) -> &'a mut W { - self.variant(TOSELW::TO128) - } - #[doc = "Timeout of 255 to 256 prescale clocks."] - #[inline] - pub fn to256(self) -> &'a mut W { - self.variant(TOSELW::TO256) - } - #[doc = "Timeout of 511 to 512 prescale clocks."] - #[inline] - pub fn to512(self) -> &'a mut W { - self.variant(TOSELW::TO512) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PSSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PSSELW { - #[doc = "Disable timer."] - DIS, - #[doc = "hclk / 256."] - DIV256, - #[doc = "hclk / 64k."] - DIV64K, - #[doc = "hclk / 16M."] - DIV16M, - } - impl PSSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PSSELW::DIS => 0, - PSSELW::DIV256 => 1, - PSSELW::DIV64K => 2, - PSSELW::DIV16M => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _PSSELW<'a> { - w: &'a mut W, - } - impl<'a> _PSSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PSSELW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Disable timer."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PSSELW::DIS) - } - #[doc = "hclk / 256."] - #[inline] - pub fn div256(self) -> &'a mut W { - self.variant(PSSELW::DIV256) - } - #[doc = "hclk / 64k."] - #[inline] - pub fn div64k(self) -> &'a mut W { - self.variant(PSSELW::DIV64K) - } - #[doc = "hclk / 16M."] - #[inline] - pub fn div16m(self) -> &'a mut W { - self.variant(PSSELW::DIV16M) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRCWD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCWDW { - #[doc = "Byte."] - BYTE, - #[doc = "Halfword."] - HALFWORD, - #[doc = "Word."] - WORD, - } - impl SRCWDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SRCWDW::BYTE => 0, - SRCWDW::HALFWORD => 1, - SRCWDW::WORD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _SRCWDW<'a> { - w: &'a mut W, - } - impl<'a> _SRCWDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRCWDW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Byte."] - #[inline] - pub fn byte(self) -> &'a mut W { - self.variant(SRCWDW::BYTE) - } - #[doc = "Halfword."] - #[inline] - pub fn half_word(self) -> &'a mut W { - self.variant(SRCWDW::HALFWORD) - } - #[doc = "Word."] - #[inline] - pub fn word(self) -> &'a mut W { - self.variant(SRCWDW::WORD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRCINC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCINCW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl SRCINCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRCINCW::DIS => false, - SRCINCW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRCINCW<'a> { - w: &'a mut W, - } - impl<'a> _SRCINCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRCINCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SRCINCW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SRCINCW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DSTWD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSTWDW { - #[doc = "Byte."] - BYTE, - #[doc = "Halfword."] - HALFWORD, - #[doc = "Word."] - WORD, - } - impl DSTWDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - DSTWDW::BYTE => 0, - DSTWDW::HALFWORD => 1, - DSTWDW::WORD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _DSTWDW<'a> { - w: &'a mut W, - } - impl<'a> _DSTWDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DSTWDW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Byte."] - #[inline] - pub fn byte(self) -> &'a mut W { - self.variant(DSTWDW::BYTE) - } - #[doc = "Halfword."] - #[inline] - pub fn half_word(self) -> &'a mut W { - self.variant(DSTWDW::HALFWORD) - } - #[doc = "Word."] - #[inline] - pub fn word(self) -> &'a mut W { - self.variant(DSTWDW::WORD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DSTINC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSTINCW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl DSTINCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DSTINCW::DIS => false, - DSTINCW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DSTINCW<'a> { - w: &'a mut W, - } - impl<'a> _DSTINCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DSTINCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DSTINCW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DSTINCW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BRSTW<'a> { - w: &'a mut W, - } - impl<'a> _BRSTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CHDIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHDIENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CHDIENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CHDIENW::DIS => false, - CHDIENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CHDIENW<'a> { - w: &'a mut W, - } - impl<'a> _CHDIENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CHDIENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CHDIENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CHDIENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 30; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CTZIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CTZIENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CTZIENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CTZIENW::DIS => false, - CTZIENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CTZIENW<'a> { - w: &'a mut W, - } - impl<'a> _CTZIENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CTZIENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CTZIENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CTZIENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Channel Enable. This bit is automatically cleared when DMA_ST.CH_ST changes from 1 to 0."] - #[inline] - pub fn chen(&self) -> CHENR { - CHENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Reload Enable. Setting this bit to 1 enables DMA_SRC, DMA_DST and DMA_CNT to be reloaded with their corresponding reload registers upon count-to-zero. This bit is also writeable in the Count Reload Register. Refer to the description on Buffer Chaining for use of this bit. If buffer chaining is not used this bit must be written with a 0. This bit should be set after the reload registers have been programmed."] - #[inline] - pub fn rlden(&self) -> RLDENR { - RLDENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 2:3 - DMA Priority."] - #[inline] - pub fn pri(&self) -> PRIR { - PRIR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 4:9 - Request Select. Select DMA request line for this channel. If memory-to-memory is selected, the channel operates as if the request is always active."] - #[inline] - pub fn reqsel(&self) -> REQSELR { - REQSELR::_from({ - const MASK: u8 = 0x3f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 10 - Request Wait Enable. When enabled, delay timer start until DMA request transitions from active to inactive."] - #[inline] - pub fn reqwait(&self) -> REQWAITR { - REQWAITR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 11:13 - Time-Out Select. Selects the number of prescale clocks seen by the channel timer before a time-out conditions is generated for this channel. Important note: since the prescaler runs independent of the individual channel timers, the actual number of Pre-Scale clock edges seen has a margin of error equal to a single Pre-Scale clock."] - #[inline] - pub fn tosel(&self) -> TOSELR { - TOSELR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 14:15 - Pre-Scale Select. Selects the Pre-Scale divider for timer clock input."] - #[inline] - pub fn pssel(&self) -> PSSELR { - PSSELR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:17 - Source Width. In most cases, this will be the data width of each AHB transactions. However, the width will be reduced in the cases where DMA_CNT indicates a smaller value."] - #[inline] - pub fn srcwd(&self) -> SRCWDR { - SRCWDR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 18 - Source Increment Enable. This bit enables DMA_SRC increment upon every AHB transaction. This bit is forced to 0 for DMA receive from peripherals."] - #[inline] - pub fn srcinc(&self) -> SRCINCR { - SRCINCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 20:21 - Destination Width. Indicates the width of the each AHB transactions to the destination peripheral or memory. (The actual width may be less than this if there are insufficient bytes in the DMA FIFO for the full width)."] - #[inline] - pub fn dstwd(&self) -> DSTWDR { - DSTWDR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 22 - Destination Increment Enable. This bit enables DMA_DST increment upon every AHB transaction. This bit is forced to 0 for DMA transmit to peripherals."] - #[inline] - pub fn dstinc(&self) -> DSTINCR { - DSTINCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 24:28 - Burst Size. The number of bytes to be transferred into and out of the DMA FIFO in a single burst. Burst size equals 1 + value stored in this field."] - #[inline] - pub fn brst(&self) -> BRSTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BRSTR { bits } - } - #[doc = "Bit 30 - Channel Disable Interrupt Enable. When enabled, the IPEND will be set to 1 whenever CH_ST changes from 1 to 0."] - #[inline] - pub fn chdien(&self) -> CHDIENR { - CHDIENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 31 - Count-to-zero Interrupts Enable. When enabled, the IPEND will be set to 1 whenever a count-to-zero event occurs."] - #[inline] - pub fn ctzien(&self) -> CTZIENR { - CTZIENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Channel Enable. This bit is automatically cleared when DMA_ST.CH_ST changes from 1 to 0."] - #[inline] - pub fn chen(&mut self) -> _CHENW { - _CHENW { w: self } - } - #[doc = "Bit 1 - Reload Enable. Setting this bit to 1 enables DMA_SRC, DMA_DST and DMA_CNT to be reloaded with their corresponding reload registers upon count-to-zero. This bit is also writeable in the Count Reload Register. Refer to the description on Buffer Chaining for use of this bit. If buffer chaining is not used this bit must be written with a 0. This bit should be set after the reload registers have been programmed."] - #[inline] - pub fn rlden(&mut self) -> _RLDENW { - _RLDENW { w: self } - } - #[doc = "Bits 2:3 - DMA Priority."] - #[inline] - pub fn pri(&mut self) -> _PRIW { - _PRIW { w: self } - } - #[doc = "Bits 4:9 - Request Select. Select DMA request line for this channel. If memory-to-memory is selected, the channel operates as if the request is always active."] - #[inline] - pub fn reqsel(&mut self) -> _REQSELW { - _REQSELW { w: self } - } - #[doc = "Bit 10 - Request Wait Enable. When enabled, delay timer start until DMA request transitions from active to inactive."] - #[inline] - pub fn reqwait(&mut self) -> _REQWAITW { - _REQWAITW { w: self } - } - #[doc = "Bits 11:13 - Time-Out Select. Selects the number of prescale clocks seen by the channel timer before a time-out conditions is generated for this channel. Important note: since the prescaler runs independent of the individual channel timers, the actual number of Pre-Scale clock edges seen has a margin of error equal to a single Pre-Scale clock."] - #[inline] - pub fn tosel(&mut self) -> _TOSELW { - _TOSELW { w: self } - } - #[doc = "Bits 14:15 - Pre-Scale Select. Selects the Pre-Scale divider for timer clock input."] - #[inline] - pub fn pssel(&mut self) -> _PSSELW { - _PSSELW { w: self } - } - #[doc = "Bits 16:17 - Source Width. In most cases, this will be the data width of each AHB transactions. However, the width will be reduced in the cases where DMA_CNT indicates a smaller value."] - #[inline] - pub fn srcwd(&mut self) -> _SRCWDW { - _SRCWDW { w: self } - } - #[doc = "Bit 18 - Source Increment Enable. This bit enables DMA_SRC increment upon every AHB transaction. This bit is forced to 0 for DMA receive from peripherals."] - #[inline] - pub fn srcinc(&mut self) -> _SRCINCW { - _SRCINCW { w: self } - } - #[doc = "Bits 20:21 - Destination Width. Indicates the width of the each AHB transactions to the destination peripheral or memory. (The actual width may be less than this if there are insufficient bytes in the DMA FIFO for the full width)."] - #[inline] - pub fn dstwd(&mut self) -> _DSTWDW { - _DSTWDW { w: self } - } - #[doc = "Bit 22 - Destination Increment Enable. This bit enables DMA_DST increment upon every AHB transaction. This bit is forced to 0 for DMA transmit to peripherals."] - #[inline] - pub fn dstinc(&mut self) -> _DSTINCW { - _DSTINCW { w: self } - } - #[doc = "Bits 24:28 - Burst Size. The number of bytes to be transferred into and out of the DMA FIFO in a single burst. Burst size equals 1 + value stored in this field."] - #[inline] - pub fn brst(&mut self) -> _BRSTW { - _BRSTW { w: self } - } - #[doc = "Bit 30 - Channel Disable Interrupt Enable. When enabled, the IPEND will be set to 1 whenever CH_ST changes from 1 to 0."] - #[inline] - pub fn chdien(&mut self) -> _CHDIENW { - _CHDIENW { w: self } - } - #[doc = "Bit 31 - Count-to-zero Interrupts Enable. When enabled, the IPEND will be set to 1 whenever a count-to-zero event occurs."] - #[inline] - pub fn ctzien(&mut self) -> _CTZIENW { - _CTZIENW { w: self } - } - } - } - #[doc = "DMA Channel Status Register."] - pub struct ST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Channel Status Register."] - pub mod st { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CH_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CH_STR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CH_STR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CH_STR::DIS => false, - CH_STR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CH_STR { - match value { - false => CH_STR::DIS, - true => CH_STR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CH_STR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CH_STR::EN - } - } - #[doc = "Possible values of the field `IPEND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IPENDR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl IPENDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - IPENDR::INACTIVE => false, - IPENDR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> IPENDR { - match value { - false => IPENDR::INACTIVE, - true => IPENDR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == IPENDR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == IPENDR::PENDING - } - } - #[doc = "Possible values of the field `CTZ_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CTZ_STR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl CTZ_STR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CTZ_STR::NOEVENT => false, - CTZ_STR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CTZ_STR { - match value { - false => CTZ_STR::NOEVENT, - true => CTZ_STR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == CTZ_STR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == CTZ_STR::OCCURRED - } - } - #[doc = "Possible values of the field `RLD_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLD_STR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl RLD_STR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RLD_STR::NOEVENT => false, - RLD_STR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RLD_STR { - match value { - false => RLD_STR::NOEVENT, - true => RLD_STR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == RLD_STR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == RLD_STR::OCCURRED - } - } - #[doc = "Possible values of the field `BUS_ERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUS_ERRR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BUS_ERRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUS_ERRR::NOEVENT => false, - BUS_ERRR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUS_ERRR { - match value { - false => BUS_ERRR::NOEVENT, - true => BUS_ERRR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BUS_ERRR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BUS_ERRR::OCCURRED - } - } - #[doc = "Possible values of the field `TO_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_STR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl TO_STR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TO_STR::NOEVENT => false, - TO_STR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TO_STR { - match value { - false => TO_STR::NOEVENT, - true => TO_STR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == TO_STR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == TO_STR::OCCURRED - } - } - #[doc = "Values that can be written to the field `CTZ_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CTZ_STW { - #[doc = "Clears the interrupt flag"] - CLEAR, - } - impl CTZ_STW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CTZ_STW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CTZ_STW<'a> { - w: &'a mut W, - } - impl<'a> _CTZ_STW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CTZ_STW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clears the interrupt flag"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(CTZ_STW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RLD_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLD_STW { - #[doc = "Clears the interrupt flag"] - CLEAR, - } - impl RLD_STW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RLD_STW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RLD_STW<'a> { - w: &'a mut W, - } - impl<'a> _RLD_STW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RLD_STW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clears the interrupt flag"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RLD_STW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BUS_ERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUS_ERRW { - #[doc = "Clears the interrupt flag"] - CLEAR, - } - impl BUS_ERRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BUS_ERRW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BUS_ERRW<'a> { - w: &'a mut W, - } - impl<'a> _BUS_ERRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BUS_ERRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clears the interrupt flag"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(BUS_ERRW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TO_ST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_STW { - #[doc = "Clears the interrupt flag"] - CLEAR, - } - impl TO_STW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TO_STW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TO_STW<'a> { - w: &'a mut W, - } - impl<'a> _TO_STW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TO_STW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clears the interrupt flag"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TO_STW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Channel Status. This bit is used to indicate to the programmer when it is safe to change the configuration, address, and count registers for the channel. Whenever this bit is cleared by hardware, the DMA_CFG.CHEN bit is also cleared (if not cleared already)."] - #[inline] - pub fn ch_st(&self) -> CH_STR { - CH_STR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Channel Interrupt."] - #[inline] - pub fn ipend(&self) -> IPENDR { - IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Count-to-Zero (CTZ) Status"] - #[inline] - pub fn ctz_st(&self) -> CTZ_STR { - CTZ_STR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Reload Status."] - #[inline] - pub fn rld_st(&self) -> RLD_STR { - RLD_STR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Bus Error. Indicates that an AHB abort was received and the channel has been disabled."] - #[inline] - pub fn bus_err(&self) -> BUS_ERRR { - BUS_ERRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Time-Out Status."] - #[inline] - pub fn to_st(&self) -> TO_STR { - TO_STR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 2 - Count-to-Zero (CTZ) Status"] - #[inline] - pub fn ctz_st(&mut self) -> _CTZ_STW { - _CTZ_STW { w: self } - } - #[doc = "Bit 3 - Reload Status."] - #[inline] - pub fn rld_st(&mut self) -> _RLD_STW { - _RLD_STW { w: self } - } - #[doc = "Bit 4 - Bus Error. Indicates that an AHB abort was received and the channel has been disabled."] - #[inline] - pub fn bus_err(&mut self) -> _BUS_ERRW { - _BUS_ERRW { w: self } - } - #[doc = "Bit 6 - Time-Out Status."] - #[inline] - pub fn to_st(&mut self) -> _TO_STW { - _TO_STW { w: self } - } - } - } - #[doc = "Source Device Address. If SRCINC=1, the counter bits are incremented by 1,2, or 4, depending on the data width of each AHB cycle. For peripheral transfers, some or all of the actual address bits are fixed. If SRCINC=0, this register remains constant. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with the contents of DMA_SRC_RLD."] - pub struct SRC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Source Device Address. If SRCINC=1, the counter bits are incremented by 1,2, or 4, depending on the data width of each AHB cycle. For peripheral transfers, some or all of the actual address bits are fixed. If SRCINC=0, this register remains constant. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with the contents of DMA_SRC_RLD."] - pub mod src { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31"] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31"] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Destination Device Address. For peripheral transfers, some or all of the actual address bits are fixed. If DSTINC=1, this register is incremented on every AHB write out of the DMA FIFO. They are incremented by 1, 2, or 4, depending on the data width of each AHB cycle. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with DMA_DST_RLD."] - pub struct DST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Destination Device Address. For peripheral transfers, some or all of the actual address bits are fixed. If DSTINC=1, this register is incremented on every AHB write out of the DMA FIFO. They are incremented by 1, 2, or 4, depending on the data width of each AHB cycle. In the case where a count-to-zero condition occurs while RLDEN=1, the register is reloaded with DMA_DST_RLD."] - pub mod dst { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31"] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31"] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "DMA Counter. The user loads this register with the number of bytes to transfer. This counter decreases on every AHB cycle into the DMA FIFO. The decrement will be 1, 2, or 4 depending on the data width of each AHB cycle. When the counter reaches 0, a count-to-zero condition is triggered."] - pub struct CNT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Counter. The user loads this register with the number of bytes to transfer. This counter decreases on every AHB cycle into the DMA FIFO. The decrement will be 1, 2, or 4 depending on the data width of each AHB cycle. When the counter reaches 0, a count-to-zero condition is triggered."] - pub mod cnt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CNT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CNTR { - bits: u32, - } - impl CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CNTW<'a> { - w: &'a mut W, - } - impl<'a> _CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:23 - DMA Counter."] - #[inline] - pub fn cnt(&self) -> CNTR { - let bits = { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - CNTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:23 - DMA Counter."] - #[inline] - pub fn cnt(&mut self) -> _CNTW { - _CNTW { w: self } - } - } - } - #[doc = "Source Address Reload Value. The value of this register is loaded into DMA0_SRC upon a count-to-zero condition."] - pub struct SRC_RLD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Source Address Reload Value. The value of this register is loaded into DMA0_SRC upon a count-to-zero condition."] - pub mod src_rld { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRC_RLD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SRC_RLDR { - bits: u32, - } - impl SRC_RLDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _SRC_RLDW<'a> { - w: &'a mut W, - } - impl<'a> _SRC_RLDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:30 - Source Address Reload Value."] - #[inline] - pub fn src_rld(&self) -> SRC_RLDR { - let bits = { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - SRC_RLDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:30 - Source Address Reload Value."] - #[inline] - pub fn src_rld(&mut self) -> _SRC_RLDW { - _SRC_RLDW { w: self } - } - } - } - #[doc = "Destination Address Reload Value. The value of this register is loaded into DMA0_DST upon a count-to-zero condition."] - pub struct DST_RLD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Destination Address Reload Value. The value of this register is loaded into DMA0_DST upon a count-to-zero condition."] - pub mod dst_rld { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DST_RLD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DST_RLDR { - bits: u32, - } - impl DST_RLDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DST_RLDW<'a> { - w: &'a mut W, - } - impl<'a> _DST_RLDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:30 - Destination Address Reload Value."] - #[inline] - pub fn dst_rld(&self) -> DST_RLDR { - let bits = { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DST_RLDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:30 - Destination Address Reload Value."] - #[inline] - pub fn dst_rld(&mut self) -> _DST_RLDW { - _DST_RLDW { w: self } - } - } - } - #[doc = "DMA Channel Count Reload Register."] - pub struct CNT_RLD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Channel Count Reload Register."] - pub mod cnt_rld { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CNT_RLD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CNT_RLDR { - bits: u32, - } - impl CNT_RLDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = "Possible values of the field `RLDEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLDENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RLDENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RLDENR::DIS => false, - RLDENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RLDENR { - match value { - false => RLDENR::DIS, - true => RLDENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RLDENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RLDENR::EN - } - } - #[doc = r" Proxy"] - pub struct _CNT_RLDW<'a> { - w: &'a mut W, - } - impl<'a> _CNT_RLDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RLDEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RLDENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RLDENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RLDENW::DIS => false, - RLDENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RLDENW<'a> { - w: &'a mut W, - } - impl<'a> _RLDENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RLDENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RLDENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RLDENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:23 - Count Reload Value. The value of this register is loaded into DMA0_CNT upon a count-to-zero condition."] - #[inline] - pub fn cnt_rld(&self) -> CNT_RLDR { - let bits = { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - CNT_RLDR { bits } - } - #[doc = "Bit 31 - Reload Enable. This bit should be set after the address reload registers have been programmed. This bit is automatically cleared to 0 when reload occurs."] - #[inline] - pub fn rlden(&self) -> RLDENR { - RLDENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:23 - Count Reload Value. The value of this register is loaded into DMA0_CNT upon a count-to-zero condition."] - #[inline] - pub fn cnt_rld(&mut self) -> _CNT_RLDW { - _CNT_RLDW { w: self } - } - #[doc = "Bit 31 - Reload Enable. This bit should be set after the address reload registers have been programmed. This bit is automatically cleared to 0 when reload occurs."] - #[inline] - pub fn rlden(&mut self) -> _RLDENW { - _RLDENW { w: self } - } - } - } - } - #[doc = "DMA Control Register."] - pub struct CN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Control Register."] - pub mod cn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CH0_IEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CH0_IENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CH0_IENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CH0_IENR::DIS => false, - CH0_IENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CH0_IENR { - match value { - false => CH0_IENR::DIS, - true => CH0_IENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CH0_IENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CH0_IENR::EN - } - } - #[doc = r" Value of the field"] - pub struct CH1_IENR { - bits: bool, - } - impl CH1_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH2_IENR { - bits: bool, - } - impl CH2_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH3_IENR { - bits: bool, - } - impl CH3_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH4_IENR { - bits: bool, - } - impl CH4_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH5_IENR { - bits: bool, - } - impl CH5_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH6_IENR { - bits: bool, - } - impl CH6_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH7_IENR { - bits: bool, - } - impl CH7_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH8_IENR { - bits: bool, - } - impl CH8_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH9_IENR { - bits: bool, - } - impl CH9_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH10_IENR { - bits: bool, - } - impl CH10_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH11_IENR { - bits: bool, - } - impl CH11_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH12_IENR { - bits: bool, - } - impl CH12_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH13_IENR { - bits: bool, - } - impl CH13_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH14_IENR { - bits: bool, - } - impl CH14_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CH15_IENR { - bits: bool, - } - impl CH15_IENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `CH0_IEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CH0_IENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl CH0_IENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CH0_IENW::DIS => false, - CH0_IENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CH0_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH0_IENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CH0_IENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CH0_IENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CH0_IENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH1_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH1_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH2_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH2_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH3_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH3_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH4_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH4_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH5_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH5_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH6_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH6_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH7_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH7_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH8_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH8_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH9_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH9_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH10_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH10_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH11_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH11_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH12_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH12_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH13_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH13_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH14_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH14_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CH15_IENW<'a> { - w: &'a mut W, - } - impl<'a> _CH15_IENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Channel 0 Interrupt Enable."] - #[inline] - pub fn ch0_ien(&self) -> CH0_IENR { - CH0_IENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Channel 1 Interrupt Enable."] - #[inline] - pub fn ch1_ien(&self) -> CH1_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH1_IENR { bits } - } - #[doc = "Bit 2 - Channel 2 Interrupt Enable."] - #[inline] - pub fn ch2_ien(&self) -> CH2_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH2_IENR { bits } - } - #[doc = "Bit 3 - Channel 3 Interrupt Enable."] - #[inline] - pub fn ch3_ien(&self) -> CH3_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH3_IENR { bits } - } - #[doc = "Bit 4 - Channel 4 Interrupt Enable."] - #[inline] - pub fn ch4_ien(&self) -> CH4_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH4_IENR { bits } - } - #[doc = "Bit 5 - Channel 5 Interrupt Enable."] - #[inline] - pub fn ch5_ien(&self) -> CH5_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH5_IENR { bits } - } - #[doc = "Bit 6 - Channel 6 Interrupt Enable."] - #[inline] - pub fn ch6_ien(&self) -> CH6_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH6_IENR { bits } - } - #[doc = "Bit 7 - Channel 7 Interrupt Enable."] - #[inline] - pub fn ch7_ien(&self) -> CH7_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH7_IENR { bits } - } - #[doc = "Bit 8 - Channel 8 Interrupt Enable."] - #[inline] - pub fn ch8_ien(&self) -> CH8_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH8_IENR { bits } - } - #[doc = "Bit 9 - Channel 9 Interrupt Enable."] - #[inline] - pub fn ch9_ien(&self) -> CH9_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH9_IENR { bits } - } - #[doc = "Bit 10 - Channel 10 Interrupt Enable."] - #[inline] - pub fn ch10_ien(&self) -> CH10_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH10_IENR { bits } - } - #[doc = "Bit 11 - Channel 11 Interrupt Enable."] - #[inline] - pub fn ch11_ien(&self) -> CH11_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH11_IENR { bits } - } - #[doc = "Bit 12 - Channel 12 Interrupt Enable."] - #[inline] - pub fn ch12_ien(&self) -> CH12_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH12_IENR { bits } - } - #[doc = "Bit 13 - Channel 13 Interrupt Enable."] - #[inline] - pub fn ch13_ien(&self) -> CH13_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH13_IENR { bits } - } - #[doc = "Bit 14 - Channel 14 Interrupt Enable."] - #[inline] - pub fn ch14_ien(&self) -> CH14_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH14_IENR { bits } - } - #[doc = "Bit 15 - Channel 15 Interrupt Enable."] - #[inline] - pub fn ch15_ien(&self) -> CH15_IENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CH15_IENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Channel 0 Interrupt Enable."] - #[inline] - pub fn ch0_ien(&mut self) -> _CH0_IENW { - _CH0_IENW { w: self } - } - #[doc = "Bit 1 - Channel 1 Interrupt Enable."] - #[inline] - pub fn ch1_ien(&mut self) -> _CH1_IENW { - _CH1_IENW { w: self } - } - #[doc = "Bit 2 - Channel 2 Interrupt Enable."] - #[inline] - pub fn ch2_ien(&mut self) -> _CH2_IENW { - _CH2_IENW { w: self } - } - #[doc = "Bit 3 - Channel 3 Interrupt Enable."] - #[inline] - pub fn ch3_ien(&mut self) -> _CH3_IENW { - _CH3_IENW { w: self } - } - #[doc = "Bit 4 - Channel 4 Interrupt Enable."] - #[inline] - pub fn ch4_ien(&mut self) -> _CH4_IENW { - _CH4_IENW { w: self } - } - #[doc = "Bit 5 - Channel 5 Interrupt Enable."] - #[inline] - pub fn ch5_ien(&mut self) -> _CH5_IENW { - _CH5_IENW { w: self } - } - #[doc = "Bit 6 - Channel 6 Interrupt Enable."] - #[inline] - pub fn ch6_ien(&mut self) -> _CH6_IENW { - _CH6_IENW { w: self } - } - #[doc = "Bit 7 - Channel 7 Interrupt Enable."] - #[inline] - pub fn ch7_ien(&mut self) -> _CH7_IENW { - _CH7_IENW { w: self } - } - #[doc = "Bit 8 - Channel 8 Interrupt Enable."] - #[inline] - pub fn ch8_ien(&mut self) -> _CH8_IENW { - _CH8_IENW { w: self } - } - #[doc = "Bit 9 - Channel 9 Interrupt Enable."] - #[inline] - pub fn ch9_ien(&mut self) -> _CH9_IENW { - _CH9_IENW { w: self } - } - #[doc = "Bit 10 - Channel 10 Interrupt Enable."] - #[inline] - pub fn ch10_ien(&mut self) -> _CH10_IENW { - _CH10_IENW { w: self } - } - #[doc = "Bit 11 - Channel 11 Interrupt Enable."] - #[inline] - pub fn ch11_ien(&mut self) -> _CH11_IENW { - _CH11_IENW { w: self } - } - #[doc = "Bit 12 - Channel 12 Interrupt Enable."] - #[inline] - pub fn ch12_ien(&mut self) -> _CH12_IENW { - _CH12_IENW { w: self } - } - #[doc = "Bit 13 - Channel 13 Interrupt Enable."] - #[inline] - pub fn ch13_ien(&mut self) -> _CH13_IENW { - _CH13_IENW { w: self } - } - #[doc = "Bit 14 - Channel 14 Interrupt Enable."] - #[inline] - pub fn ch14_ien(&mut self) -> _CH14_IENW { - _CH14_IENW { w: self } - } - #[doc = "Bit 15 - Channel 15 Interrupt Enable."] - #[inline] - pub fn ch15_ien(&mut self) -> _CH15_IENW { - _CH15_IENW { w: self } - } - } - } - #[doc = "DMA Interrupt Register."] - pub struct INTR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Interrupt Register."] - pub mod intr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::INTR { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `CH0_IPEND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CH0_IPENDR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl CH0_IPENDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CH0_IPENDR::INACTIVE => false, - CH0_IPENDR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CH0_IPENDR { - match value { - false => CH0_IPENDR::INACTIVE, - true => CH0_IPENDR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == CH0_IPENDR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == CH0_IPENDR::PENDING - } - } - #[doc = "Possible values of the field `CH1_IPEND`"] - pub type CH1_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH2_IPEND`"] - pub type CH2_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH3_IPEND`"] - pub type CH3_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH4_IPEND`"] - pub type CH4_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH5_IPEND`"] - pub type CH5_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH6_IPEND`"] - pub type CH6_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH7_IPEND`"] - pub type CH7_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH8_IPEND`"] - pub type CH8_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH9_IPEND`"] - pub type CH9_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH10_IPEND`"] - pub type CH10_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH11_IPEND`"] - pub type CH11_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH12_IPEND`"] - pub type CH12_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH13_IPEND`"] - pub type CH13_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH14_IPEND`"] - pub type CH14_IPENDR = CH0_IPENDR; - #[doc = "Possible values of the field `CH15_IPEND`"] - pub type CH15_IPENDR = CH0_IPENDR; - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Channel Interrupt. To clear an interrupt, all active interrupt bits of the DMA_ST must be cleared. The interrupt bits are set only if their corresponding interrupt enable bits are set in DMA_CN."] - #[inline] - pub fn ch0_ipend(&self) -> CH0_IPENDR { - CH0_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1"] - #[inline] - pub fn ch1_ipend(&self) -> CH1_IPENDR { - CH1_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2"] - #[inline] - pub fn ch2_ipend(&self) -> CH2_IPENDR { - CH2_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3"] - #[inline] - pub fn ch3_ipend(&self) -> CH3_IPENDR { - CH3_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4"] - #[inline] - pub fn ch4_ipend(&self) -> CH4_IPENDR { - CH4_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5"] - #[inline] - pub fn ch5_ipend(&self) -> CH5_IPENDR { - CH5_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6"] - #[inline] - pub fn ch6_ipend(&self) -> CH6_IPENDR { - CH6_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7"] - #[inline] - pub fn ch7_ipend(&self) -> CH7_IPENDR { - CH7_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8"] - #[inline] - pub fn ch8_ipend(&self) -> CH8_IPENDR { - CH8_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9"] - #[inline] - pub fn ch9_ipend(&self) -> CH9_IPENDR { - CH9_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10"] - #[inline] - pub fn ch10_ipend(&self) -> CH10_IPENDR { - CH10_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11"] - #[inline] - pub fn ch11_ipend(&self) -> CH11_IPENDR { - CH11_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12"] - #[inline] - pub fn ch12_ipend(&self) -> CH12_IPENDR { - CH12_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13"] - #[inline] - pub fn ch13_ipend(&self) -> CH13_IPENDR { - CH13_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14"] - #[inline] - pub fn ch14_ipend(&self) -> CH14_IPENDR { - CH14_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15"] - #[inline] - pub fn ch15_ipend(&self) -> CH15_IPENDR { - CH15_IPENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } -} -#[doc = "Flash Memory Control."] -pub struct FLC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for FLC {} -impl FLC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const flc::RegisterBlock { - 0x4002_9000 as *const _ - } -} -impl Deref for FLC { - type Target = flc::RegisterBlock; - fn deref(&self) -> &flc::RegisterBlock { - unsafe { &*FLC::ptr() } - } -} -#[doc = "Flash Memory Control."] -pub mod flc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Flash Write Address."] - pub addr: ADDR, - #[doc = "0x04 - Flash Clock Divide. The clock (PLL0) is divided by this value to generate a 1 MHz clock for Flash controller."] - pub clkdiv: CLKDIV, - #[doc = "0x08 - Flash Control Register."] - pub cn: CN, - _reserved0: [u8; 24usize], - #[doc = "0x24 - Flash Interrupt Register."] - pub intr: INTR, - _reserved1: [u8; 8usize], - #[doc = "0x30 - Flash Write Data."] - pub data: [DATA; 4], - #[doc = "0x40 - Access Control Register. Writing the ACNTL register with the following values in the order shown, allows read and write access to the system and user Information block: pflc-acntl = 0x3a7f5ca3; pflc-acntl = 0xa1e34f20; pflc-acntl = 0x9608b2c1. When unlocked, a write of any word will disable access to system and user information block. Readback of this register is always zero."] - pub acntl: ACNTL, - } - #[doc = "Flash Write Address."] - pub struct ADDR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash Write Address."] - pub mod addr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ADDR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Address for next operation."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Address for next operation."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Flash Clock Divide. The clock (PLL0) is divided by this value to generate a 1 MHz clock for Flash controller."] - pub struct CLKDIV { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash Clock Divide. The clock (PLL0) is divided by this value to generate a 1 MHz clock for Flash controller."] - pub mod clkdiv { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLKDIV { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CLKDIVR { - bits: u8, - } - impl CLKDIVR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CLKDIVW<'a> { - w: &'a mut W, - } - impl<'a> _CLKDIVW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Flash Clock Divide. The clock is divided by this value to generate a 1MHz clock for flash controller."] - #[inline] - pub fn clkdiv(&self) -> CLKDIVR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CLKDIVR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x64 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Flash Clock Divide. The clock is divided by this value to generate a 1MHz clock for flash controller."] - #[inline] - pub fn clkdiv(&mut self) -> _CLKDIVW { - _CLKDIVW { w: self } - } - } - } - #[doc = "Flash Control Register."] - pub struct CN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash Control Register."] - pub mod cn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `WR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRR { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl WRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WRR::COMPLETE => false, - WRR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WRR { - match value { - false => WRR::COMPLETE, - true => WRR::START, - } - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == WRR::COMPLETE - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == WRR::START - } - } - #[doc = r" Value of the field"] - pub struct MER { - bits: bool, - } - impl MER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PGER { - bits: bool, - } - impl PGER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `WDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WDTHR { - #[doc = "128-bit."] - SIZE128, - #[doc = "32-bit."] - SIZE32, - } - impl WDTHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WDTHR::SIZE128 => false, - WDTHR::SIZE32 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WDTHR { - match value { - false => WDTHR::SIZE128, - true => WDTHR::SIZE32, - } - } - #[doc = "Checks if the value of the field is `SIZE128`"] - #[inline] - pub fn is_size128(&self) -> bool { - *self == WDTHR::SIZE128 - } - #[doc = "Checks if the value of the field is `SIZE32`"] - #[inline] - pub fn is_size32(&self) -> bool { - *self == WDTHR::SIZE32 - } - } - #[doc = "Possible values of the field `ERASE_CODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ERASE_CODER { - #[doc = "No operation."] - NOP, - #[doc = "Enable Page Erase."] - ERASEPAGE, - #[doc = "Enable Mass Erase. The debug port must be enabled."] - ERASEALL, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl ERASE_CODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - ERASE_CODER::NOP => 0, - ERASE_CODER::ERASEPAGE => 0x55, - ERASE_CODER::ERASEALL => 0xaa, - ERASE_CODER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> ERASE_CODER { - match value { - 0 => ERASE_CODER::NOP, - 85 => ERASE_CODER::ERASEPAGE, - 170 => ERASE_CODER::ERASEALL, - i => ERASE_CODER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NOP`"] - #[inline] - pub fn is_nop(&self) -> bool { - *self == ERASE_CODER::NOP - } - #[doc = "Checks if the value of the field is `ERASEPAGE`"] - #[inline] - pub fn is_erase_page(&self) -> bool { - *self == ERASE_CODER::ERASEPAGE - } - #[doc = "Checks if the value of the field is `ERASEALL`"] - #[inline] - pub fn is_erase_all(&self) -> bool { - *self == ERASE_CODER::ERASEALL - } - } - #[doc = "Possible values of the field `PEND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PENDR { - #[doc = "Idle."] - IDLE, - #[doc = "Busy."] - BUSY, - } - impl PENDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PENDR::IDLE => false, - PENDR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PENDR { - match value { - false => PENDR::IDLE, - true => PENDR::BUSY, - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == PENDR::IDLE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == PENDR::BUSY - } - } - #[doc = "Possible values of the field `LVE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LVER { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl LVER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LVER::DIS => false, - LVER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LVER { - match value { - false => LVER::DIS, - true => LVER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LVER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LVER::EN - } - } - #[doc = "Possible values of the field `BRST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BRSTR { - #[doc = "Disable."] - DISABLE, - #[doc = "Enable."] - ENABLE, - } - impl BRSTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BRSTR::DISABLE => false, - BRSTR::ENABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BRSTR { - match value { - false => BRSTR::DISABLE, - true => BRSTR::ENABLE, - } - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == BRSTR::DISABLE - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == BRSTR::ENABLE - } - } - #[doc = "Possible values of the field `UNLOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum UNLOCKR { - #[doc = "Flash Unlocked."] - UNLOCKED, - #[doc = "Flash Locked."] - LOCKED, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl UNLOCKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - UNLOCKR::UNLOCKED => 0x02, - UNLOCKR::LOCKED => 0x03, - UNLOCKR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> UNLOCKR { - match value { - 2 => UNLOCKR::UNLOCKED, - 3 => UNLOCKR::LOCKED, - i => UNLOCKR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `UNLOCKED`"] - #[inline] - pub fn is_unlocked(&self) -> bool { - *self == UNLOCKR::UNLOCKED - } - #[doc = "Checks if the value of the field is `LOCKED`"] - #[inline] - pub fn is_locked(&self) -> bool { - *self == UNLOCKR::LOCKED - } - } - #[doc = "Values that can be written to the field `WR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WRW { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl WRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WRW::COMPLETE => false, - WRW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WRW<'a> { - w: &'a mut W, - } - impl<'a> _WRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn complete(self) -> &'a mut W { - self.variant(WRW::COMPLETE) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(WRW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MEW<'a> { - w: &'a mut W, - } - impl<'a> _MEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PGEW<'a> { - w: &'a mut W, - } - impl<'a> _PGEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WDTHW { - #[doc = "128-bit."] - SIZE128, - #[doc = "32-bit."] - SIZE32, - } - impl WDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WDTHW::SIZE128 => false, - WDTHW::SIZE32 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WDTHW<'a> { - w: &'a mut W, - } - impl<'a> _WDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WDTHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "128-bit."] - #[inline] - pub fn size128(self) -> &'a mut W { - self.variant(WDTHW::SIZE128) - } - #[doc = "32-bit."] - #[inline] - pub fn size32(self) -> &'a mut W { - self.variant(WDTHW::SIZE32) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ERASE_CODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ERASE_CODEW { - #[doc = "No operation."] - NOP, - #[doc = "Enable Page Erase."] - ERASEPAGE, - #[doc = "Enable Mass Erase. The debug port must be enabled."] - ERASEALL, - } - impl ERASE_CODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - ERASE_CODEW::NOP => 0, - ERASE_CODEW::ERASEPAGE => 85, - ERASE_CODEW::ERASEALL => 170, - } - } - } - #[doc = r" Proxy"] - pub struct _ERASE_CODEW<'a> { - w: &'a mut W, - } - impl<'a> _ERASE_CODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ERASE_CODEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "No operation."] - #[inline] - pub fn nop(self) -> &'a mut W { - self.variant(ERASE_CODEW::NOP) - } - #[doc = "Enable Page Erase."] - #[inline] - pub fn erase_page(self) -> &'a mut W { - self.variant(ERASE_CODEW::ERASEPAGE) - } - #[doc = "Enable Mass Erase. The debug port must be enabled."] - #[inline] - pub fn erase_all(self) -> &'a mut W { - self.variant(ERASE_CODEW::ERASEALL) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BRST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BRSTW { - #[doc = "Disable."] - DISABLE, - #[doc = "Enable."] - ENABLE, - } - impl BRSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BRSTW::DISABLE => false, - BRSTW::ENABLE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BRSTW<'a> { - w: &'a mut W, - } - impl<'a> _BRSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BRSTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(BRSTW::DISABLE) - } - #[doc = "Enable."] - #[inline] - pub fn enable(self) -> &'a mut W { - self.variant(BRSTW::ENABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `UNLOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum UNLOCKW { - #[doc = "Flash Unlocked."] - UNLOCKED, - #[doc = "Flash Locked."] - LOCKED, - } - impl UNLOCKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - UNLOCKW::UNLOCKED => 2, - UNLOCKW::LOCKED => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _UNLOCKW<'a> { - w: &'a mut W, - } - impl<'a> _UNLOCKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: UNLOCKW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Flash Unlocked."] - #[inline] - pub fn unlocked(self) -> &'a mut W { - self.variant(UNLOCKW::UNLOCKED) - } - #[doc = "Flash Locked."] - #[inline] - pub fn locked(self) -> &'a mut W { - self.variant(UNLOCKW::LOCKED) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Write. This bit is automatically cleared after the operation."] - #[inline] - pub fn wr(&self) -> WRR { - WRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Mass Erase. This bit is automatically cleared after the operation."] - #[inline] - pub fn me(&self) -> MER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - MER { bits } - } - #[doc = "Bit 2 - Page Erase. This bit is automatically cleared after the operation."] - #[inline] - pub fn pge(&self) -> PGER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PGER { bits } - } - #[doc = "Bit 4 - Data Width. This bits selects write data width."] - #[inline] - pub fn wdth(&self) -> WDTHR { - WDTHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:15 - Erase Code. The ERASE_CODE must be set up property before erase operation can be initiated. These bits are automatically cleared after the operation is complete."] - #[inline] - pub fn erase_code(&self) -> ERASE_CODER { - ERASE_CODER::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 24 - Flash Pending. When Flash operation is in progress (busy), Flash reads and writes will fail. When PEND is set, write to all Flash registers, with exception of the Flash interrupt register, are ignored."] - #[inline] - pub fn pend(&self) -> PENDR { - PENDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 25 - Low Voltage Read Enable"] - #[inline] - pub fn lve(&self) -> LVER { - LVER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 27 - Burst Mode Enable."] - #[inline] - pub fn brst(&self) -> BRSTR { - BRSTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 28:31 - Flash Unlock. The correct unlock code must be written to these four bits before any Flash write or erase operation is allowed."] - #[inline] - pub fn unlock(&self) -> UNLOCKR { - UNLOCKR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Write. This bit is automatically cleared after the operation."] - #[inline] - pub fn wr(&mut self) -> _WRW { - _WRW { w: self } - } - #[doc = "Bit 1 - Mass Erase. This bit is automatically cleared after the operation."] - #[inline] - pub fn me(&mut self) -> _MEW { - _MEW { w: self } - } - #[doc = "Bit 2 - Page Erase. This bit is automatically cleared after the operation."] - #[inline] - pub fn pge(&mut self) -> _PGEW { - _PGEW { w: self } - } - #[doc = "Bit 4 - Data Width. This bits selects write data width."] - #[inline] - pub fn wdth(&mut self) -> _WDTHW { - _WDTHW { w: self } - } - #[doc = "Bits 8:15 - Erase Code. The ERASE_CODE must be set up property before erase operation can be initiated. These bits are automatically cleared after the operation is complete."] - #[inline] - pub fn erase_code(&mut self) -> _ERASE_CODEW { - _ERASE_CODEW { w: self } - } - #[doc = "Bit 27 - Burst Mode Enable."] - #[inline] - pub fn brst(&mut self) -> _BRSTW { - _BRSTW { w: self } - } - #[doc = "Bits 28:31 - Flash Unlock. The correct unlock code must be written to these four bits before any Flash write or erase operation is allowed."] - #[inline] - pub fn unlock(&mut self) -> _UNLOCKW { - _UNLOCKW { w: self } - } - } - } - #[doc = "Flash Interrupt Register."] - pub struct INTR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash Interrupt Register."] - pub mod intr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONER { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DONER::INACTIVE => false, - DONER::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DONER { - match value { - false => DONER::INACTIVE, - true => DONER::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == DONER::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == DONER::PENDING - } - } - #[doc = "Possible values of the field `AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AFR { - #[doc = "No Failure."] - NOERROR, - #[doc = "Failure occurs."] - ERROR, - } - impl AFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AFR::NOERROR => false, - AFR::ERROR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AFR { - match value { - false => AFR::NOERROR, - true => AFR::ERROR, - } - } - #[doc = "Checks if the value of the field is `NOERROR`"] - #[inline] - pub fn is_no_error(&self) -> bool { - *self == AFR::NOERROR - } - #[doc = "Checks if the value of the field is `ERROR`"] - #[inline] - pub fn is_error(&self) -> bool { - *self == AFR::ERROR - } - } - #[doc = "Possible values of the field `DONEIE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONEIER { - #[doc = "Disable."] - DISABLE, - #[doc = "Enable."] - ENABLE, - } - impl DONEIER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DONEIER::DISABLE => false, - DONEIER::ENABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DONEIER { - match value { - false => DONEIER::DISABLE, - true => DONEIER::ENABLE, - } - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == DONEIER::DISABLE - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == DONEIER::ENABLE - } - } - #[doc = r" Value of the field"] - pub struct AFIER { - bits: bool, - } - impl AFIER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONEW { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DONEW::INACTIVE => false, - DONEW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DONEW<'a> { - w: &'a mut W, - } - impl<'a> _DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No interrupt is pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(DONEW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(DONEW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AFW { - #[doc = "No Failure."] - NOERROR, - #[doc = "Failure occurs."] - ERROR, - } - impl AFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AFW::NOERROR => false, - AFW::ERROR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AFW<'a> { - w: &'a mut W, - } - impl<'a> _AFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Failure."] - #[inline] - pub fn no_error(self) -> &'a mut W { - self.variant(AFW::NOERROR) - } - #[doc = "Failure occurs."] - #[inline] - pub fn error(self) -> &'a mut W { - self.variant(AFW::ERROR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DONEIE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONEIEW { - #[doc = "Disable."] - DISABLE, - #[doc = "Enable."] - ENABLE, - } - impl DONEIEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DONEIEW::DISABLE => false, - DONEIEW::ENABLE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DONEIEW<'a> { - w: &'a mut W, - } - impl<'a> _DONEIEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DONEIEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(DONEIEW::DISABLE) - } - #[doc = "Enable."] - #[inline] - pub fn enable(self) -> &'a mut W { - self.variant(DONEIEW::ENABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AFIEW<'a> { - w: &'a mut W, - } - impl<'a> _AFIEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Flash Done Interrupt. This bit is set to 1 upon Flash write or erase completion."] - #[inline] - pub fn done(&self) -> DONER { - DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Flash Access Fail. This bit is set when an attempt is made to write the flash while the flash is busy or the flash is locked. This bit can only be set to 1 by hardware."] - #[inline] - pub fn af(&self) -> AFR { - AFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Flash Done Interrupt Enable."] - #[inline] - pub fn doneie(&self) -> DONEIER { - DONEIER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9"] - #[inline] - pub fn afie(&self) -> AFIER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AFIER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Flash Done Interrupt. This bit is set to 1 upon Flash write or erase completion."] - #[inline] - pub fn done(&mut self) -> _DONEW { - _DONEW { w: self } - } - #[doc = "Bit 1 - Flash Access Fail. This bit is set when an attempt is made to write the flash while the flash is busy or the flash is locked. This bit can only be set to 1 by hardware."] - #[inline] - pub fn af(&mut self) -> _AFW { - _AFW { w: self } - } - #[doc = "Bit 8 - Flash Done Interrupt Enable."] - #[inline] - pub fn doneie(&mut self) -> _DONEIEW { - _DONEIEW { w: self } - } - #[doc = "Bit 9"] - #[inline] - pub fn afie(&mut self) -> _AFIEW { - _AFIEW { w: self } - } - } - } - #[doc = "Flash Write Data."] - pub struct DATA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash Write Data."] - pub mod data { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DATA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Data next operation."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Data next operation."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Access Control Register. Writing the ACNTL register with the following values in the order shown, allows read and write access to the system and user Information block: pflc-acntl = 0x3a7f5ca3; pflc-acntl = 0xa1e34f20; pflc-acntl = 0x9608b2c1. When unlocked, a write of any word will disable access to system and user information block. Readback of this register is always zero."] - pub struct ACNTL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Access Control Register. Writing the ACNTL register with the following values in the order shown, allows read and write access to the system and user Information block: pflc-acntl = 0x3a7f5ca3; pflc-acntl = 0xa1e34f20; pflc-acntl = 0x9608b2c1. When unlocked, a write of any word will disable access to system and user information block. Readback of this register is always zero."] - pub mod acntl { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ACNTL { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _ACNTLW<'a> { - w: &'a mut W, - } - impl<'a> _ACNTLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Access control."] - #[inline] - pub fn acntl(&mut self) -> _ACNTLW { - _ACNTLW { w: self } - } - } - } -} -#[doc = "Global Control Registers."] -pub struct GCR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for GCR {} -impl GCR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const gcr::RegisterBlock { - 0x4000_0000 as *const _ - } -} -impl Deref for GCR { - type Target = gcr::RegisterBlock; - fn deref(&self) -> &gcr::RegisterBlock { - unsafe { &*GCR::ptr() } - } -} -#[doc = "Global Control Registers."] -pub mod gcr { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - System Control."] - pub scon: SCON, - #[doc = "0x04 - Reset."] - pub rstr0: RSTR0, - #[doc = "0x08 - Clock Control."] - pub clkcn: CLKCN, - #[doc = "0x0c - Power Management."] - pub pm: PM, - _reserved0: [u8; 8usize], - #[doc = "0x18 - Peripheral Clock Divider."] - pub pckdiv: PCKDIV, - _reserved1: [u8; 8usize], - #[doc = "0x24 - Peripheral Clock Disable."] - pub perckcn0: PERCKCN0, - #[doc = "0x28 - Memory Clock Control Register."] - pub memckcn: MEMCKCN, - #[doc = "0x2c - Memory Zeroize Control."] - pub memzcn: MEMZCN, - _reserved2: [u8; 4usize], - #[doc = "0x34 - Smart Card Clock Control."] - pub scck: SCCK, - #[doc = "0x38 - Master Priority Control Register 0."] - pub mpri0: MPRI0, - #[doc = "0x3c - Mater Priority Control Register 1."] - pub mpri1: MPRI1, - #[doc = "0x40 - System Status Register."] - pub sysst: SYSST, - #[doc = "0x44 - Reset 1."] - pub rstr1: RSTR1, - #[doc = "0x48 - Peripheral Clock Disable."] - pub perckcn1: PERCKCN1, - #[doc = "0x4c - Event Enable Register."] - pub evten: EVTEN, - #[doc = "0x50 - Revision Register."] - pub revision: REVISION, - #[doc = "0x54 - System Status Interrupt Enable Register."] - pub syssie: SYSSIE, - _reserved3: [u8; 12usize], - #[doc = "0x64 - ECC Error Register"] - pub eccerr: ECCERR, - #[doc = "0x68 - ECC Not Double Error Detect Register"] - pub eccnded: ECCNDED, - #[doc = "0x6c - ECC IRQ Enable Register"] - pub eccirqen: ECCIRQEN, - #[doc = "0x70 - ECC Error Address Register"] - pub eccerrad: ECCERRAD, - #[doc = "0x74 - BTLE LDO Control Register"] - pub btleldocn: BTLELDOCN, - #[doc = "0x78 - BTLE LDO Delay Register"] - pub btleldodly: BTLELDODLY, - _reserved4: [u8; 4usize], - #[doc = "0x80 - General Purpose Register 0"] - pub gp0: GP0, - #[doc = "0x84 - APB Asynchronous Bridge Select Register"] - pub apbasync: APBASYNC, - } - #[doc = "System Control."] - pub struct SCON { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "System Control."] - pub mod scon { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SCON { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `BSTAPEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BSTAPENR { - #[doc = "Boundary Scan TAP port disabled."] - DIS, - #[doc = "Boundary Scan TAP port enabled."] - EN, - } - impl BSTAPENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BSTAPENR::DIS => false, - BSTAPENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BSTAPENR { - match value { - false => BSTAPENR::DIS, - true => BSTAPENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BSTAPENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BSTAPENR::EN - } - } - #[doc = "Possible values of the field `SBUSARB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SBUSARBR { - #[doc = "Fixed Burst abritration."] - FIX, - #[doc = "Round-robin scheme."] - ROUND, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SBUSARBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SBUSARBR::FIX => 0, - SBUSARBR::ROUND => 0x01, - SBUSARBR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SBUSARBR { - match value { - 0 => SBUSARBR::FIX, - 1 => SBUSARBR::ROUND, - i => SBUSARBR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `FIX`"] - #[inline] - pub fn is_fix(&self) -> bool { - *self == SBUSARBR::FIX - } - #[doc = "Checks if the value of the field is `ROUND`"] - #[inline] - pub fn is_round(&self) -> bool { - *self == SBUSARBR::ROUND - } - } - #[doc = "Possible values of the field `FLASH_PAGE_FLIP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLASH_PAGE_FLIPR { - #[doc = "Physical layout matches logical layout."] - NORMAL, - #[doc = "Bottom half mapped to logical top half and vice versa."] - SWAPPED, - } - impl FLASH_PAGE_FLIPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FLASH_PAGE_FLIPR::NORMAL => false, - FLASH_PAGE_FLIPR::SWAPPED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FLASH_PAGE_FLIPR { - match value { - false => FLASH_PAGE_FLIPR::NORMAL, - true => FLASH_PAGE_FLIPR::SWAPPED, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == FLASH_PAGE_FLIPR::NORMAL - } - #[doc = "Checks if the value of the field is `SWAPPED`"] - #[inline] - pub fn is_swapped(&self) -> bool { - *self == FLASH_PAGE_FLIPR::SWAPPED - } - } - #[doc = "Possible values of the field `CCACHE_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CCACHE_FLUSHR { - #[doc = "Normal Code Cache Operation"] - NORMAL, - #[doc = "Code Caches and CPU instruction buffer are flushed "] - FLUSH, - } - impl CCACHE_FLUSHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CCACHE_FLUSHR::NORMAL => false, - CCACHE_FLUSHR::FLUSH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CCACHE_FLUSHR { - match value { - false => CCACHE_FLUSHR::NORMAL, - true => CCACHE_FLUSHR::FLUSH, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == CCACHE_FLUSHR::NORMAL - } - #[doc = "Checks if the value of the field is `FLUSH`"] - #[inline] - pub fn is_flush(&self) -> bool { - *self == CCACHE_FLUSHR::FLUSH - } - } - #[doc = "Possible values of the field `DCACHE_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DCACHE_FLUSHR { - #[doc = "Normal System Cache Operation"] - NORMAL, - #[doc = "System Cache is flushed "] - FLUSH, - } - impl DCACHE_FLUSHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DCACHE_FLUSHR::NORMAL => false, - DCACHE_FLUSHR::FLUSH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DCACHE_FLUSHR { - match value { - false => DCACHE_FLUSHR::NORMAL, - true => DCACHE_FLUSHR::FLUSH, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == DCACHE_FLUSHR::NORMAL - } - #[doc = "Checks if the value of the field is `FLUSH`"] - #[inline] - pub fn is_flush(&self) -> bool { - *self == DCACHE_FLUSHR::FLUSH - } - } - #[doc = "Possible values of the field `DCACHE_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DCACHE_DISR { - #[doc = "Is enabled."] - EN, - #[doc = "Is Disabled."] - DIS, - } - impl DCACHE_DISR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DCACHE_DISR::EN => false, - DCACHE_DISR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DCACHE_DISR { - match value { - false => DCACHE_DISR::EN, - true => DCACHE_DISR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DCACHE_DISR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DCACHE_DISR::DIS - } - } - #[doc = "Possible values of the field `CCHK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CCHKR { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl CCHKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CCHKR::COMPLETE => false, - CCHKR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CCHKR { - match value { - false => CCHKR::COMPLETE, - true => CCHKR::START, - } - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == CCHKR::COMPLETE - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == CCHKR::START - } - } - #[doc = "Possible values of the field `CHKRES`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHKRESR { - #[doc = "ROM Checksum Correct."] - PASS, - #[doc = "ROM Checksum Fail."] - FAIL, - } - impl CHKRESR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CHKRESR::PASS => false, - CHKRESR::FAIL => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CHKRESR { - match value { - false => CHKRESR::PASS, - true => CHKRESR::FAIL, - } - } - #[doc = "Checks if the value of the field is `PASS`"] - #[inline] - pub fn is_pass(&self) -> bool { - *self == CHKRESR::PASS - } - #[doc = "Checks if the value of the field is `FAIL`"] - #[inline] - pub fn is_fail(&self) -> bool { - *self == CHKRESR::FAIL - } - } - #[doc = "Possible values of the field `OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OVRR { - #[doc = "0.9V +/- 10%"] - _0_9V, - #[doc = "1.0V +/- 10%"] - _1_0V, - #[doc = "1.1V +/- 10%"] - _1_1V, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl OVRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - OVRR::_0_9V => 0, - OVRR::_1_0V => 0x01, - OVRR::_1_1V => 0x02, - OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> OVRR { - match value { - 0 => OVRR::_0_9V, - 1 => OVRR::_1_0V, - 2 => OVRR::_1_1V, - i => OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0_9V`"] - #[inline] - pub fn is_0_9v(&self) -> bool { - *self == OVRR::_0_9V - } - #[doc = "Checks if the value of the field is `_1_0V`"] - #[inline] - pub fn is_1_0v(&self) -> bool { - *self == OVRR::_1_0V - } - #[doc = "Checks if the value of the field is `_1_1V`"] - #[inline] - pub fn is_1_1v(&self) -> bool { - *self == OVRR::_1_1V - } - } - #[doc = "Values that can be written to the field `BSTAPEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BSTAPENW { - #[doc = "Boundary Scan TAP port disabled."] - DIS, - #[doc = "Boundary Scan TAP port enabled."] - EN, - } - impl BSTAPENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BSTAPENW::DIS => false, - BSTAPENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BSTAPENW<'a> { - w: &'a mut W, - } - impl<'a> _BSTAPENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BSTAPENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Boundary Scan TAP port disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BSTAPENW::DIS) - } - #[doc = "Boundary Scan TAP port enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BSTAPENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SBUSARB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SBUSARBW { - #[doc = "Fixed Burst abritration."] - FIX, - #[doc = "Round-robin scheme."] - ROUND, - } - impl SBUSARBW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SBUSARBW::FIX => 0, - SBUSARBW::ROUND => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _SBUSARBW<'a> { - w: &'a mut W, - } - impl<'a> _SBUSARBW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SBUSARBW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Fixed Burst abritration."] - #[inline] - pub fn fix(self) -> &'a mut W { - self.variant(SBUSARBW::FIX) - } - #[doc = "Round-robin scheme."] - #[inline] - pub fn round(self) -> &'a mut W { - self.variant(SBUSARBW::ROUND) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FLASH_PAGE_FLIP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLASH_PAGE_FLIPW { - #[doc = "Physical layout matches logical layout."] - NORMAL, - #[doc = "Bottom half mapped to logical top half and vice versa."] - SWAPPED, - } - impl FLASH_PAGE_FLIPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FLASH_PAGE_FLIPW::NORMAL => false, - FLASH_PAGE_FLIPW::SWAPPED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FLASH_PAGE_FLIPW<'a> { - w: &'a mut W, - } - impl<'a> _FLASH_PAGE_FLIPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FLASH_PAGE_FLIPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Physical layout matches logical layout."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(FLASH_PAGE_FLIPW::NORMAL) - } - #[doc = "Bottom half mapped to logical top half and vice versa."] - #[inline] - pub fn swapped(self) -> &'a mut W { - self.variant(FLASH_PAGE_FLIPW::SWAPPED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CCACHE_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CCACHE_FLUSHW { - #[doc = "Normal Code Cache Operation"] - NORMAL, - #[doc = "Code Caches and CPU instruction buffer are flushed "] - FLUSH, - } - impl CCACHE_FLUSHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CCACHE_FLUSHW::NORMAL => false, - CCACHE_FLUSHW::FLUSH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CCACHE_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _CCACHE_FLUSHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CCACHE_FLUSHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Code Cache Operation"] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(CCACHE_FLUSHW::NORMAL) - } - #[doc = "Code Caches and CPU instruction buffer are flushed"] - #[inline] - pub fn flush(self) -> &'a mut W { - self.variant(CCACHE_FLUSHW::FLUSH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DCACHE_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DCACHE_FLUSHW { - #[doc = "Normal System Cache Operation"] - NORMAL, - #[doc = "System Cache is flushed "] - FLUSH, - } - impl DCACHE_FLUSHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DCACHE_FLUSHW::NORMAL => false, - DCACHE_FLUSHW::FLUSH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DCACHE_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _DCACHE_FLUSHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DCACHE_FLUSHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal System Cache Operation"] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(DCACHE_FLUSHW::NORMAL) - } - #[doc = "System Cache is flushed"] - #[inline] - pub fn flush(self) -> &'a mut W { - self.variant(DCACHE_FLUSHW::FLUSH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DCACHE_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DCACHE_DISW { - #[doc = "Is enabled."] - EN, - #[doc = "Is Disabled."] - DIS, - } - impl DCACHE_DISW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DCACHE_DISW::EN => false, - DCACHE_DISW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DCACHE_DISW<'a> { - w: &'a mut W, - } - impl<'a> _DCACHE_DISW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DCACHE_DISW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DCACHE_DISW::EN) - } - #[doc = "Is Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DCACHE_DISW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CCHK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CCHKW { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl CCHKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CCHKW::COMPLETE => false, - CCHKW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CCHKW<'a> { - w: &'a mut W, - } - impl<'a> _CCHKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CCHKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn complete(self) -> &'a mut W { - self.variant(CCHKW::COMPLETE) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(CCHKW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CHKRES`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHKRESW { - #[doc = "ROM Checksum Correct."] - PASS, - #[doc = "ROM Checksum Fail."] - FAIL, - } - impl CHKRESW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CHKRESW::PASS => false, - CHKRESW::FAIL => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CHKRESW<'a> { - w: &'a mut W, - } - impl<'a> _CHKRESW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CHKRESW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "ROM Checksum Correct."] - #[inline] - pub fn pass(self) -> &'a mut W { - self.variant(CHKRESW::PASS) - } - #[doc = "ROM Checksum Fail."] - #[inline] - pub fn fail(self) -> &'a mut W { - self.variant(CHKRESW::FAIL) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OVRW { - #[doc = "0.9V +/- 10%"] - _0_9V, - #[doc = "1.0V +/- 10%"] - _1_0V, - #[doc = "1.1V +/- 10%"] - _1_1V, - } - impl OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - OVRW::_0_9V => 0, - OVRW::_1_0V => 1, - OVRW::_1_1V => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _OVRW<'a> { - w: &'a mut W, - } - impl<'a> _OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: OVRW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "0.9V +/- 10%"] - #[inline] - pub fn _0_9v(self) -> &'a mut W { - self.variant(OVRW::_0_9V) - } - #[doc = "1.0V +/- 10%"] - #[inline] - pub fn _1_0v(self) -> &'a mut W { - self.variant(OVRW::_1_0V) - } - #[doc = "1.1V +/- 10%"] - #[inline] - pub fn _1_1v(self) -> &'a mut W { - self.variant(OVRW::_1_1V) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Boundary Scan TAP enable. When enabled, the JTAG port is connected to the Boundary Scan TAP. Otherwise, the port is connected to the ARM ICE function. This bit is reset by the POR. Reset value and access depend on the part number."] - #[inline] - pub fn bstapen(&self) -> BSTAPENR { - BSTAPENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 1:2 - System bus abritration scheme. These bits are used to select between Fixed-burst abritration and Round-Robin scheme. The Round-Robin scheme is selected by default. These bits are reset by the system reset."] - #[inline] - pub fn sbusarb(&self) -> SBUSARBR { - SBUSARBR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 4 - Flips the Flash bottom and top halves. (Depending on the total flash size, each half is either 256K or 512K). Initiating a flash page flip will cause a flush of both the data buffer on the DCODE bus and the internal instruction buffer."] - #[inline] - pub fn flash_page_flip(&self) -> FLASH_PAGE_FLIPR { - FLASH_PAGE_FLIPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Code Cache Flush. This bit is used to flush the code caches and the instruction buffer of the Cortex-M4."] - #[inline] - pub fn ccache_flush(&self) -> CCACHE_FLUSHR { - CCACHE_FLUSHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Data Cache Flush. The system cache(s) will be flushed when this bit is set."] - #[inline] - pub fn dcache_flush(&self) -> DCACHE_FLUSHR { - DCACHE_FLUSHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Data Cache Disable. The system cache(s) will be completely disabled when this bit is set."] - #[inline] - pub fn dcache_dis(&self) -> DCACHE_DISR { - DCACHE_DISR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Compute ROM Checksum. This bit is self-cleared when calculation is completed. Once set, software clearing this bit is ignored and the bit will remain set until the operation is completed."] - #[inline] - pub fn cchk(&self) -> CCHKR { - CCHKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - ROM Checksum Result. This bit is only valid when CHKRD=1."] - #[inline] - pub fn chkres(&self) -> CHKRESR { - CHKRESR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:17 - Operating Voltage Range. Setting these bits according to the VCore voltage allows the on-chip Random-Access memories to operate in their optimal timing range."] - #[inline] - pub fn ovr(&self) -> OVRR { - OVRR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Boundary Scan TAP enable. When enabled, the JTAG port is connected to the Boundary Scan TAP. Otherwise, the port is connected to the ARM ICE function. This bit is reset by the POR. Reset value and access depend on the part number."] - #[inline] - pub fn bstapen(&mut self) -> _BSTAPENW { - _BSTAPENW { w: self } - } - #[doc = "Bits 1:2 - System bus abritration scheme. These bits are used to select between Fixed-burst abritration and Round-Robin scheme. The Round-Robin scheme is selected by default. These bits are reset by the system reset."] - #[inline] - pub fn sbusarb(&mut self) -> _SBUSARBW { - _SBUSARBW { w: self } - } - #[doc = "Bit 4 - Flips the Flash bottom and top halves. (Depending on the total flash size, each half is either 256K or 512K). Initiating a flash page flip will cause a flush of both the data buffer on the DCODE bus and the internal instruction buffer."] - #[inline] - pub fn flash_page_flip(&mut self) -> _FLASH_PAGE_FLIPW { - _FLASH_PAGE_FLIPW { w: self } - } - #[doc = "Bit 6 - Code Cache Flush. This bit is used to flush the code caches and the instruction buffer of the Cortex-M4."] - #[inline] - pub fn ccache_flush(&mut self) -> _CCACHE_FLUSHW { - _CCACHE_FLUSHW { w: self } - } - #[doc = "Bit 7 - Data Cache Flush. The system cache(s) will be flushed when this bit is set."] - #[inline] - pub fn dcache_flush(&mut self) -> _DCACHE_FLUSHW { - _DCACHE_FLUSHW { w: self } - } - #[doc = "Bit 9 - Data Cache Disable. The system cache(s) will be completely disabled when this bit is set."] - #[inline] - pub fn dcache_dis(&mut self) -> _DCACHE_DISW { - _DCACHE_DISW { w: self } - } - #[doc = "Bit 13 - Compute ROM Checksum. This bit is self-cleared when calculation is completed. Once set, software clearing this bit is ignored and the bit will remain set until the operation is completed."] - #[inline] - pub fn cchk(&mut self) -> _CCHKW { - _CCHKW { w: self } - } - #[doc = "Bit 15 - ROM Checksum Result. This bit is only valid when CHKRD=1."] - #[inline] - pub fn chkres(&mut self) -> _CHKRESW { - _CHKRESW { w: self } - } - #[doc = "Bits 16:17 - Operating Voltage Range. Setting these bits according to the VCore voltage allows the on-chip Random-Access memories to operate in their optimal timing range."] - #[inline] - pub fn ovr(&mut self) -> _OVRW { - _OVRW { w: self } - } - } - } - #[doc = "Reset."] - pub struct RSTR0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Reset."] - pub mod rstr0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RSTR0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAR { - #[doc = "Reset complete."] - RESET_DONE, - #[doc = "Starts Reset or indicates reset in progress."] - BUSY, - } - impl DMAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMAR::RESET_DONE => false, - DMAR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMAR { - match value { - false => DMAR::RESET_DONE, - true => DMAR::BUSY, - } - } - #[doc = "Checks if the value of the field is `RESET_DONE`"] - #[inline] - pub fn is_reset_done(&self) -> bool { - *self == DMAR::RESET_DONE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == DMAR::BUSY - } - } - #[doc = r" Value of the field"] - pub struct WDTR { - bits: bool, - } - impl WDTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct GPIO0R { - bits: bool, - } - impl GPIO0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct GPIO1R { - bits: bool, - } - impl GPIO1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER0R { - bits: bool, - } - impl TIMER0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER1R { - bits: bool, - } - impl TIMER1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER2R { - bits: bool, - } - impl TIMER2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER3R { - bits: bool, - } - impl TIMER3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER4R { - bits: bool, - } - impl TIMER4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER5R { - bits: bool, - } - impl TIMER5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UART0R { - bits: bool, - } - impl UART0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UART1R { - bits: bool, - } - impl UART1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPI0R { - bits: bool, - } - impl SPI0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPI1R { - bits: bool, - } - impl SPI1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct I2C0R { - bits: bool, - } - impl I2C0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RTCR { - bits: bool, - } - impl RTCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CRYPTOR { - bits: bool, - } - impl CRYPTOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SMPHRR { - bits: bool, - } - impl SMPHRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct USBR { - bits: bool, - } - impl USBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TRNGR { - bits: bool, - } - impl TRNGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADCR { - bits: bool, - } - impl ADCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMA1R { - bits: bool, - } - impl DMA1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UART2R { - bits: bool, - } - impl UART2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRSTR { - bits: bool, - } - impl SRSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PRSTR { - bits: bool, - } - impl PRSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSTEMR { - bits: bool, - } - impl SYSTEMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `DMA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAW { - #[doc = "Reset complete."] - RESET_DONE, - #[doc = "Starts Reset or indicates reset in progress."] - BUSY, - } - impl DMAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMAW::RESET_DONE => false, - DMAW::BUSY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DMAW<'a> { - w: &'a mut W, - } - impl<'a> _DMAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Reset complete."] - #[inline] - pub fn reset_done(self) -> &'a mut W { - self.variant(DMAW::RESET_DONE) - } - #[doc = "Starts Reset or indicates reset in progress."] - #[inline] - pub fn busy(self) -> &'a mut W { - self.variant(DMAW::BUSY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDTW<'a> { - w: &'a mut W, - } - impl<'a> _WDTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _GPIO0W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _GPIO1W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER0W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER1W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER2W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER3W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER4W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TIMER5W<'a> { - w: &'a mut W, - } - impl<'a> _TIMER5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UART0W<'a> { - w: &'a mut W, - } - impl<'a> _UART0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UART1W<'a> { - w: &'a mut W, - } - impl<'a> _UART1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPI0W<'a> { - w: &'a mut W, - } - impl<'a> _SPI0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPI1W<'a> { - w: &'a mut W, - } - impl<'a> _SPI1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _I2C0W<'a> { - w: &'a mut W, - } - impl<'a> _I2C0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RTCW<'a> { - w: &'a mut W, - } - impl<'a> _RTCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SMPHRW<'a> { - w: &'a mut W, - } - impl<'a> _SMPHRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBW<'a> { - w: &'a mut W, - } - impl<'a> _USBW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TRNGW<'a> { - w: &'a mut W, - } - impl<'a> _TRNGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADCW<'a> { - w: &'a mut W, - } - impl<'a> _ADCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMA1W<'a> { - w: &'a mut W, - } - impl<'a> _DMA1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UART2W<'a> { - w: &'a mut W, - } - impl<'a> _UART2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRSTW<'a> { - w: &'a mut W, - } - impl<'a> _SRSTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PRSTW<'a> { - w: &'a mut W, - } - impl<'a> _PRSTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 30; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSTEMW<'a> { - w: &'a mut W, - } - impl<'a> _SYSTEMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - DMA Reset."] - #[inline] - pub fn dma(&self) -> DMAR { - DMAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Watchdog Timer Reset."] - #[inline] - pub fn wdt(&self) -> WDTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDTR { bits } - } - #[doc = "Bit 2 - GPIO0 Reset. Setting this bit to 1 resets GPIO0 pins to their default states."] - #[inline] - pub fn gpio0(&self) -> GPIO0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - GPIO0R { bits } - } - #[doc = "Bit 3 - GPIO1 Reset. Setting this bit to 1 resets GPIO1 pins to their default states."] - #[inline] - pub fn gpio1(&self) -> GPIO1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - GPIO1R { bits } - } - #[doc = "Bit 5 - Timer0 Reset. Setting this bit to 1 resets Timer 0 blocks."] - #[inline] - pub fn timer0(&self) -> TIMER0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER0R { bits } - } - #[doc = "Bit 6 - Timer1 Reset. Setting this bit to 1 resets Timer 1 blocks."] - #[inline] - pub fn timer1(&self) -> TIMER1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER1R { bits } - } - #[doc = "Bit 7 - Timer2 Reset. Setting this bit to 1 resets Timer 2 blocks."] - #[inline] - pub fn timer2(&self) -> TIMER2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER2R { bits } - } - #[doc = "Bit 8 - Timer3 Reset. Setting this bit to 1 resets Timer 3 blocks."] - #[inline] - pub fn timer3(&self) -> TIMER3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER3R { bits } - } - #[doc = "Bit 9 - Timer3 Reset. Setting this bit to 1 resets Timer 4 blocks."] - #[inline] - pub fn timer4(&self) -> TIMER4R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER4R { bits } - } - #[doc = "Bit 10 - Timer3 Reset. Setting this bit to 1 resets Timer 5 blocks."] - #[inline] - pub fn timer5(&self) -> TIMER5R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TIMER5R { bits } - } - #[doc = "Bit 11 - UART0 Reset. Setting this bit to 1 resets all UART 0 blocks."] - #[inline] - pub fn uart0(&self) -> UART0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - UART0R { bits } - } - #[doc = "Bit 12 - UART1 Reset. Setting this bit to 1 resets all UART 1 blocks."] - #[inline] - pub fn uart1(&self) -> UART1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - UART1R { bits } - } - #[doc = "Bit 13 - SPI0 Reset. Setting this bit to 1 resets all SPI 0 blocks."] - #[inline] - pub fn spi0(&self) -> SPI0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPI0R { bits } - } - #[doc = "Bit 14 - SPI1 Reset. Setting this bit to 1 resets all SPI 1 blocks."] - #[inline] - pub fn spi1(&self) -> SPI1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPI1R { bits } - } - #[doc = "Bit 16 - I2C0 Reset."] - #[inline] - pub fn i2c0(&self) -> I2C0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - I2C0R { bits } - } - #[doc = "Bit 17 - Real Time Clock Reset."] - #[inline] - pub fn rtc(&self) -> RTCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RTCR { bits } - } - #[doc = "Bit 18 - Cryptographic Reset. Setting this bit to 1 resets the AES block, the SHA block and the DES block."] - #[inline] - pub fn crypto(&self) -> CRYPTOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CRYPTOR { bits } - } - #[doc = "Bit 22 - SMPHR Reset. Setting this bit to 1 resets the SMPHR block."] - #[inline] - pub fn smphr(&self) -> SMPHRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SMPHRR { bits } - } - #[doc = "Bit 23 - USB Reset. Setting this bit resets both USB blocks."] - #[inline] - pub fn usb(&self) -> USBR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBR { bits } - } - #[doc = "Bit 24 - TRNG Reset."] - #[inline] - pub fn trng(&self) -> TRNGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TRNGR { bits } - } - #[doc = "Bit 26 - Analog to Digital Reset."] - #[inline] - pub fn adc(&self) -> ADCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ADCR { bits } - } - #[doc = "Bit 27 - DMA 1 Reset."] - #[inline] - pub fn dma1(&self) -> DMA1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DMA1R { bits } - } - #[doc = "Bit 28 - UART2 Reset. Setting this bit to 1 resets all UART 2 blocks."] - #[inline] - pub fn uart2(&self) -> UART2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - UART2R { bits } - } - #[doc = "Bit 29 - Soft Reset. Setting this bit to 1 resets everything except the CPU and the watchdog timer."] - #[inline] - pub fn srst(&self) -> SRSTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRSTR { bits } - } - #[doc = "Bit 30 - Peripheral Reset. Setting this bit to 1 resets all peripherals. The CPU core, the watchdog timer, and all GPIO pins are unaffected by this reset."] - #[inline] - pub fn prst(&self) -> PRSTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PRSTR { bits } - } - #[doc = "Bit 31 - System Reset. Setting this bit to 1 resets the CPU core and all peripherals, including the watchdog timer."] - #[inline] - pub fn system(&self) -> SYSTEMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSTEMR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - DMA Reset."] - #[inline] - pub fn dma(&mut self) -> _DMAW { - _DMAW { w: self } - } - #[doc = "Bit 1 - Watchdog Timer Reset."] - #[inline] - pub fn wdt(&mut self) -> _WDTW { - _WDTW { w: self } - } - #[doc = "Bit 2 - GPIO0 Reset. Setting this bit to 1 resets GPIO0 pins to their default states."] - #[inline] - pub fn gpio0(&mut self) -> _GPIO0W { - _GPIO0W { w: self } - } - #[doc = "Bit 3 - GPIO1 Reset. Setting this bit to 1 resets GPIO1 pins to their default states."] - #[inline] - pub fn gpio1(&mut self) -> _GPIO1W { - _GPIO1W { w: self } - } - #[doc = "Bit 5 - Timer0 Reset. Setting this bit to 1 resets Timer 0 blocks."] - #[inline] - pub fn timer0(&mut self) -> _TIMER0W { - _TIMER0W { w: self } - } - #[doc = "Bit 6 - Timer1 Reset. Setting this bit to 1 resets Timer 1 blocks."] - #[inline] - pub fn timer1(&mut self) -> _TIMER1W { - _TIMER1W { w: self } - } - #[doc = "Bit 7 - Timer2 Reset. Setting this bit to 1 resets Timer 2 blocks."] - #[inline] - pub fn timer2(&mut self) -> _TIMER2W { - _TIMER2W { w: self } - } - #[doc = "Bit 8 - Timer3 Reset. Setting this bit to 1 resets Timer 3 blocks."] - #[inline] - pub fn timer3(&mut self) -> _TIMER3W { - _TIMER3W { w: self } - } - #[doc = "Bit 9 - Timer3 Reset. Setting this bit to 1 resets Timer 4 blocks."] - #[inline] - pub fn timer4(&mut self) -> _TIMER4W { - _TIMER4W { w: self } - } - #[doc = "Bit 10 - Timer3 Reset. Setting this bit to 1 resets Timer 5 blocks."] - #[inline] - pub fn timer5(&mut self) -> _TIMER5W { - _TIMER5W { w: self } - } - #[doc = "Bit 11 - UART0 Reset. Setting this bit to 1 resets all UART 0 blocks."] - #[inline] - pub fn uart0(&mut self) -> _UART0W { - _UART0W { w: self } - } - #[doc = "Bit 12 - UART1 Reset. Setting this bit to 1 resets all UART 1 blocks."] - #[inline] - pub fn uart1(&mut self) -> _UART1W { - _UART1W { w: self } - } - #[doc = "Bit 13 - SPI0 Reset. Setting this bit to 1 resets all SPI 0 blocks."] - #[inline] - pub fn spi0(&mut self) -> _SPI0W { - _SPI0W { w: self } - } - #[doc = "Bit 14 - SPI1 Reset. Setting this bit to 1 resets all SPI 1 blocks."] - #[inline] - pub fn spi1(&mut self) -> _SPI1W { - _SPI1W { w: self } - } - #[doc = "Bit 16 - I2C0 Reset."] - #[inline] - pub fn i2c0(&mut self) -> _I2C0W { - _I2C0W { w: self } - } - #[doc = "Bit 17 - Real Time Clock Reset."] - #[inline] - pub fn rtc(&mut self) -> _RTCW { - _RTCW { w: self } - } - #[doc = "Bit 18 - Cryptographic Reset. Setting this bit to 1 resets the AES block, the SHA block and the DES block."] - #[inline] - pub fn crypto(&mut self) -> _CRYPTOW { - _CRYPTOW { w: self } - } - #[doc = "Bit 22 - SMPHR Reset. Setting this bit to 1 resets the SMPHR block."] - #[inline] - pub fn smphr(&mut self) -> _SMPHRW { - _SMPHRW { w: self } - } - #[doc = "Bit 23 - USB Reset. Setting this bit resets both USB blocks."] - #[inline] - pub fn usb(&mut self) -> _USBW { - _USBW { w: self } - } - #[doc = "Bit 24 - TRNG Reset."] - #[inline] - pub fn trng(&mut self) -> _TRNGW { - _TRNGW { w: self } - } - #[doc = "Bit 26 - Analog to Digital Reset."] - #[inline] - pub fn adc(&mut self) -> _ADCW { - _ADCW { w: self } - } - #[doc = "Bit 27 - DMA 1 Reset."] - #[inline] - pub fn dma1(&mut self) -> _DMA1W { - _DMA1W { w: self } - } - #[doc = "Bit 28 - UART2 Reset. Setting this bit to 1 resets all UART 2 blocks."] - #[inline] - pub fn uart2(&mut self) -> _UART2W { - _UART2W { w: self } - } - #[doc = "Bit 29 - Soft Reset. Setting this bit to 1 resets everything except the CPU and the watchdog timer."] - #[inline] - pub fn srst(&mut self) -> _SRSTW { - _SRSTW { w: self } - } - #[doc = "Bit 30 - Peripheral Reset. Setting this bit to 1 resets all peripherals. The CPU core, the watchdog timer, and all GPIO pins are unaffected by this reset."] - #[inline] - pub fn prst(&mut self) -> _PRSTW { - _PRSTW { w: self } - } - #[doc = "Bit 31 - System Reset. Setting this bit to 1 resets the CPU core and all peripherals, including the watchdog timer."] - #[inline] - pub fn system(&mut self) -> _SYSTEMW { - _SYSTEMW { w: self } - } - } - } - #[doc = "Clock Control."] - pub struct CLKCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Clock Control."] - pub mod clkcn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLKCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `PSC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PSCR { - #[doc = "Divide by 1."] - DIV1, - #[doc = "Divide by 2."] - DIV2, - #[doc = "Divide by 4."] - DIV4, - #[doc = "Divide by 8."] - DIV8, - #[doc = "Divide by 16."] - DIV16, - #[doc = "Divide by 32."] - DIV32, - #[doc = "Divide by 64."] - DIV64, - #[doc = "Divide by 128."] - DIV128, - } - impl PSCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PSCR::DIV1 => 0, - PSCR::DIV2 => 0x01, - PSCR::DIV4 => 0x02, - PSCR::DIV8 => 0x03, - PSCR::DIV16 => 0x04, - PSCR::DIV32 => 0x05, - PSCR::DIV64 => 0x06, - PSCR::DIV128 => 0x07, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PSCR { - match value { - 0 => PSCR::DIV1, - 1 => PSCR::DIV2, - 2 => PSCR::DIV4, - 3 => PSCR::DIV8, - 4 => PSCR::DIV16, - 5 => PSCR::DIV32, - 6 => PSCR::DIV64, - 7 => PSCR::DIV128, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `DIV1`"] - #[inline] - pub fn is_div1(&self) -> bool { - *self == PSCR::DIV1 - } - #[doc = "Checks if the value of the field is `DIV2`"] - #[inline] - pub fn is_div2(&self) -> bool { - *self == PSCR::DIV2 - } - #[doc = "Checks if the value of the field is `DIV4`"] - #[inline] - pub fn is_div4(&self) -> bool { - *self == PSCR::DIV4 - } - #[doc = "Checks if the value of the field is `DIV8`"] - #[inline] - pub fn is_div8(&self) -> bool { - *self == PSCR::DIV8 - } - #[doc = "Checks if the value of the field is `DIV16`"] - #[inline] - pub fn is_div16(&self) -> bool { - *self == PSCR::DIV16 - } - #[doc = "Checks if the value of the field is `DIV32`"] - #[inline] - pub fn is_div32(&self) -> bool { - *self == PSCR::DIV32 - } - #[doc = "Checks if the value of the field is `DIV64`"] - #[inline] - pub fn is_div64(&self) -> bool { - *self == PSCR::DIV64 - } - #[doc = "Checks if the value of the field is `DIV128`"] - #[inline] - pub fn is_div128(&self) -> bool { - *self == PSCR::DIV128 - } - } - #[doc = "Possible values of the field `CLKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLKSELR { - #[doc = "HIRC Clock"] - HIRC, - #[doc = "32MHz Crystal is used for the system clock."] - XTAL32M, - #[doc = "8kHz LIRC is used for the system clock."] - LIRC8, - #[doc = "The internal 96 MHz oscillator is used for the system clock."] - HIRC96, - #[doc = "The internal 8 MHz oscillator is used for the system clock."] - HIRC8, - #[doc = " 32kHz is used for the system clock."] - XTAL32K, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl CLKSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - CLKSELR::HIRC => 0, - CLKSELR::XTAL32M => 0x02, - CLKSELR::LIRC8 => 0x03, - CLKSELR::HIRC96 => 0x04, - CLKSELR::HIRC8 => 0x05, - CLKSELR::XTAL32K => 0x06, - CLKSELR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> CLKSELR { - match value { - 0 => CLKSELR::HIRC, - 2 => CLKSELR::XTAL32M, - 3 => CLKSELR::LIRC8, - 4 => CLKSELR::HIRC96, - 5 => CLKSELR::HIRC8, - 6 => CLKSELR::XTAL32K, - i => CLKSELR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `HIRC`"] - #[inline] - pub fn is_hirc(&self) -> bool { - *self == CLKSELR::HIRC - } - #[doc = "Checks if the value of the field is `XTAL32M`"] - #[inline] - pub fn is_xtal32m(&self) -> bool { - *self == CLKSELR::XTAL32M - } - #[doc = "Checks if the value of the field is `LIRC8`"] - #[inline] - pub fn is_lirc8(&self) -> bool { - *self == CLKSELR::LIRC8 - } - #[doc = "Checks if the value of the field is `HIRC96`"] - #[inline] - pub fn is_hirc96(&self) -> bool { - *self == CLKSELR::HIRC96 - } - #[doc = "Checks if the value of the field is `HIRC8`"] - #[inline] - pub fn is_hirc8(&self) -> bool { - *self == CLKSELR::HIRC8 - } - #[doc = "Checks if the value of the field is `XTAL32K`"] - #[inline] - pub fn is_xtal32k(&self) -> bool { - *self == CLKSELR::XTAL32K - } - } - #[doc = "Possible values of the field `CKRDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CKRDYR { - #[doc = "Switchover to the new clock source (as selected by CLKSEL) has not yet occurred."] - BUSY, - #[doc = "System clock running from CLKSEL clock source."] - READY, - } - impl CKRDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CKRDYR::BUSY => false, - CKRDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CKRDYR { - match value { - false => CKRDYR::BUSY, - true => CKRDYR::READY, - } - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == CKRDYR::BUSY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == CKRDYR::READY - } - } - #[doc = "Possible values of the field `CCD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CCDR { - #[doc = "The cryptographic accelerator clock is running in non-divided mode."] - NON_DIV, - #[doc = "The cryptographic accelerator clock is running in divided mode."] - DIV, - } - impl CCDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CCDR::NON_DIV => false, - CCDR::DIV => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CCDR { - match value { - false => CCDR::NON_DIV, - true => CCDR::DIV, - } - } - #[doc = "Checks if the value of the field is `NON_DIV`"] - #[inline] - pub fn is_non_div(&self) -> bool { - *self == CCDR::NON_DIV - } - #[doc = "Checks if the value of the field is `DIV`"] - #[inline] - pub fn is_div(&self) -> bool { - *self == CCDR::DIV - } - } - #[doc = "Possible values of the field `X32M_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32M_ENR { - #[doc = "Is Disabled."] - DIS, - #[doc = "Is Enabled."] - EN, - } - impl X32M_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - X32M_ENR::DIS => false, - X32M_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> X32M_ENR { - match value { - false => X32M_ENR::DIS, - true => X32M_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == X32M_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == X32M_ENR::EN - } - } - #[doc = "Possible values of the field `X32K_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32K_ENR { - #[doc = "Is Disabled."] - DIS, - #[doc = "Is Enabled."] - EN, - } - impl X32K_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - X32K_ENR::DIS => false, - X32K_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> X32K_ENR { - match value { - false => X32K_ENR::DIS, - true => X32K_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == X32K_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == X32K_ENR::EN - } - } - #[doc = r" Value of the field"] - pub struct HIRC_ENR { - bits: bool, - } - impl HIRC_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HIRC96M_ENR { - bits: bool, - } - impl HIRC96M_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HIRC8M_ENR { - bits: bool, - } - impl HIRC8M_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `HIRC8M_VS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIRC8M_VSR { - #[doc = "VCore Supply"] - VCOR, - #[doc = "Dedicated 1v regulated supply."] - _1V, - } - impl HIRC8M_VSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HIRC8M_VSR::VCOR => false, - HIRC8M_VSR::_1V => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HIRC8M_VSR { - match value { - false => HIRC8M_VSR::VCOR, - true => HIRC8M_VSR::_1V, - } - } - #[doc = "Checks if the value of the field is `VCOR`"] - #[inline] - pub fn is_vcor(&self) -> bool { - *self == HIRC8M_VSR::VCOR - } - #[doc = "Checks if the value of the field is `_1V`"] - #[inline] - pub fn is_1v(&self) -> bool { - *self == HIRC8M_VSR::_1V - } - } - #[doc = "Possible values of the field `X32M_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32M_RDYR { - #[doc = "Is not Ready."] - NOT, - #[doc = "Is Ready."] - READY, - } - impl X32M_RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - X32M_RDYR::NOT => false, - X32M_RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> X32M_RDYR { - match value { - false => X32M_RDYR::NOT, - true => X32M_RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == X32M_RDYR::NOT - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == X32M_RDYR::READY - } - } - #[doc = "Possible values of the field `X32K_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32K_RDYR { - #[doc = "Is not Ready."] - NOT, - #[doc = "Is Ready."] - READY, - } - impl X32K_RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - X32K_RDYR::NOT => false, - X32K_RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> X32K_RDYR { - match value { - false => X32K_RDYR::NOT, - true => X32K_RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == X32K_RDYR::NOT - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == X32K_RDYR::READY - } - } - #[doc = r" Value of the field"] - pub struct HIRC_RDYR { - bits: bool, - } - impl HIRC_RDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HIRC96M_RDYR { - bits: bool, - } - impl HIRC96M_RDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HIRC8M_RDYR { - bits: bool, - } - impl HIRC8M_RDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LIRC8K_RDYR { - bits: bool, - } - impl LIRC8K_RDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LIRC6K_RDYR { - bits: bool, - } - impl LIRC6K_RDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `PSC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PSCW { - #[doc = "Divide by 1."] - DIV1, - #[doc = "Divide by 2."] - DIV2, - #[doc = "Divide by 4."] - DIV4, - #[doc = "Divide by 8."] - DIV8, - #[doc = "Divide by 16."] - DIV16, - #[doc = "Divide by 32."] - DIV32, - #[doc = "Divide by 64."] - DIV64, - #[doc = "Divide by 128."] - DIV128, - } - impl PSCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PSCW::DIV1 => 0, - PSCW::DIV2 => 1, - PSCW::DIV4 => 2, - PSCW::DIV8 => 3, - PSCW::DIV16 => 4, - PSCW::DIV32 => 5, - PSCW::DIV64 => 6, - PSCW::DIV128 => 7, - } - } - } - #[doc = r" Proxy"] - pub struct _PSCW<'a> { - w: &'a mut W, - } - impl<'a> _PSCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PSCW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Divide by 1."] - #[inline] - pub fn div1(self) -> &'a mut W { - self.variant(PSCW::DIV1) - } - #[doc = "Divide by 2."] - #[inline] - pub fn div2(self) -> &'a mut W { - self.variant(PSCW::DIV2) - } - #[doc = "Divide by 4."] - #[inline] - pub fn div4(self) -> &'a mut W { - self.variant(PSCW::DIV4) - } - #[doc = "Divide by 8."] - #[inline] - pub fn div8(self) -> &'a mut W { - self.variant(PSCW::DIV8) - } - #[doc = "Divide by 16."] - #[inline] - pub fn div16(self) -> &'a mut W { - self.variant(PSCW::DIV16) - } - #[doc = "Divide by 32."] - #[inline] - pub fn div32(self) -> &'a mut W { - self.variant(PSCW::DIV32) - } - #[doc = "Divide by 64."] - #[inline] - pub fn div64(self) -> &'a mut W { - self.variant(PSCW::DIV64) - } - #[doc = "Divide by 128."] - #[inline] - pub fn div128(self) -> &'a mut W { - self.variant(PSCW::DIV128) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CLKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLKSELW { - #[doc = "HIRC Clock"] - HIRC, - #[doc = "32MHz Crystal is used for the system clock."] - XTAL32M, - #[doc = "8kHz LIRC is used for the system clock."] - LIRC8, - #[doc = "The internal 96 MHz oscillator is used for the system clock."] - HIRC96, - #[doc = "The internal 8 MHz oscillator is used for the system clock."] - HIRC8, - #[doc = " 32kHz is used for the system clock."] - XTAL32K, - } - impl CLKSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - CLKSELW::HIRC => 0, - CLKSELW::XTAL32M => 2, - CLKSELW::LIRC8 => 3, - CLKSELW::HIRC96 => 4, - CLKSELW::HIRC8 => 5, - CLKSELW::XTAL32K => 6, - } - } - } - #[doc = r" Proxy"] - pub struct _CLKSELW<'a> { - w: &'a mut W, - } - impl<'a> _CLKSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CLKSELW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "HIRC Clock"] - #[inline] - pub fn hirc(self) -> &'a mut W { - self.variant(CLKSELW::HIRC) - } - #[doc = "32MHz Crystal is used for the system clock."] - #[inline] - pub fn xtal32m(self) -> &'a mut W { - self.variant(CLKSELW::XTAL32M) - } - #[doc = "8kHz LIRC is used for the system clock."] - #[inline] - pub fn lirc8(self) -> &'a mut W { - self.variant(CLKSELW::LIRC8) - } - #[doc = "The internal 96 MHz oscillator is used for the system clock."] - #[inline] - pub fn hirc96(self) -> &'a mut W { - self.variant(CLKSELW::HIRC96) - } - #[doc = "The internal 8 MHz oscillator is used for the system clock."] - #[inline] - pub fn hirc8(self) -> &'a mut W { - self.variant(CLKSELW::HIRC8) - } - #[doc = "32kHz is used for the system clock."] - #[inline] - pub fn xtal32k(self) -> &'a mut W { - self.variant(CLKSELW::XTAL32K) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `X32M_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32M_ENW { - #[doc = "Is Disabled."] - DIS, - #[doc = "Is Enabled."] - EN, - } - impl X32M_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - X32M_ENW::DIS => false, - X32M_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _X32M_ENW<'a> { - w: &'a mut W, - } - impl<'a> _X32M_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: X32M_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Is Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(X32M_ENW::DIS) - } - #[doc = "Is Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(X32M_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `X32K_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32K_ENW { - #[doc = "Is Disabled."] - DIS, - #[doc = "Is Enabled."] - EN, - } - impl X32K_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - X32K_ENW::DIS => false, - X32K_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _X32K_ENW<'a> { - w: &'a mut W, - } - impl<'a> _X32K_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: X32K_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Is Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(X32K_ENW::DIS) - } - #[doc = "Is Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(X32K_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC_ENW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC96M_ENW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC96M_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC8M_ENW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC8M_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HIRC8M_VS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIRC8M_VSW { - #[doc = "VCore Supply"] - VCOR, - #[doc = "Dedicated 1v regulated supply."] - _1V, - } - impl HIRC8M_VSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HIRC8M_VSW::VCOR => false, - HIRC8M_VSW::_1V => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HIRC8M_VSW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC8M_VSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HIRC8M_VSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "VCore Supply"] - #[inline] - pub fn vcor(self) -> &'a mut W { - self.variant(HIRC8M_VSW::VCOR) - } - #[doc = "Dedicated 1v regulated supply."] - #[inline] - pub fn _1v(self) -> &'a mut W { - self.variant(HIRC8M_VSW::_1V) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC_RDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC96M_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC96M_RDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC8M_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC8M_RDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LIRC8K_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _LIRC8K_RDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LIRC6K_RDYW<'a> { - w: &'a mut W, - } - impl<'a> _LIRC6K_RDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 30; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 6:8 - Prescaler Select. This 3 bit field sets the system operating frequency by controlling the prescaler that divides the output of the PLL0."] - #[inline] - pub fn psc(&self) -> PSCR { - PSCR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 9:11 - Clock Source Select. This 3 bit field selects the source for the system clock."] - #[inline] - pub fn clksel(&self) -> CLKSELR { - CLKSELR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 13 - Clock Ready. This read only bit reflects whether the currently selected system clock source is running."] - #[inline] - pub fn ckrdy(&self) -> CKRDYR { - CKRDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Cryptographic clock divider"] - #[inline] - pub fn ccd(&self) -> CCDR { - CCDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - 32MHz Crystal Oscillator Enable."] - #[inline] - pub fn x32m_en(&self) -> X32M_ENR { - X32M_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - 32kHz Crystal Oscillator Enable."] - #[inline] - pub fn x32k_en(&self) -> X32K_ENR { - X32K_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - 60MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc_en(&self) -> HIRC_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC_ENR { bits } - } - #[doc = "Bit 19 - 96MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc96m_en(&self) -> HIRC96M_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC96M_ENR { bits } - } - #[doc = "Bit 20 - 8MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc8m_en(&self) -> HIRC8M_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC8M_ENR { bits } - } - #[doc = "Bit 21 - 8MHz High Frequency Internal Reference Clock Voltage Select. This register bit is used to select the power supply to the HIRC8M."] - #[inline] - pub fn hirc8m_vs(&self) -> HIRC8M_VSR { - HIRC8M_VSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 24 - 32MHz Crystal Oscillator Ready"] - #[inline] - pub fn x32m_rdy(&self) -> X32M_RDYR { - X32M_RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 25 - 32kHz Crystal Oscillator Ready"] - #[inline] - pub fn x32k_rdy(&self) -> X32K_RDYR { - X32K_RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 26 - 60MHz HIRC Ready."] - #[inline] - pub fn hirc_rdy(&self) -> HIRC_RDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC_RDYR { bits } - } - #[doc = "Bit 27 - 96MHz HIRC Ready."] - #[inline] - pub fn hirc96m_rdy(&self) -> HIRC96M_RDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC96M_RDYR { bits } - } - #[doc = "Bit 28 - 8MHz HIRC Ready."] - #[inline] - pub fn hirc8m_rdy(&self) -> HIRC8M_RDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC8M_RDYR { bits } - } - #[doc = "Bit 29 - 8kHz Low Frequency Reference Clock Ready."] - #[inline] - pub fn lirc8k_rdy(&self) -> LIRC8K_RDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LIRC8K_RDYR { bits } - } - #[doc = "Bit 30 - 6kHz Low Frequency Reference Clock Ready."] - #[inline] - pub fn lirc6k_rdy(&self) -> LIRC6K_RDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LIRC6K_RDYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x08 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 6:8 - Prescaler Select. This 3 bit field sets the system operating frequency by controlling the prescaler that divides the output of the PLL0."] - #[inline] - pub fn psc(&mut self) -> _PSCW { - _PSCW { w: self } - } - #[doc = "Bits 9:11 - Clock Source Select. This 3 bit field selects the source for the system clock."] - #[inline] - pub fn clksel(&mut self) -> _CLKSELW { - _CLKSELW { w: self } - } - #[doc = "Bit 16 - 32MHz Crystal Oscillator Enable."] - #[inline] - pub fn x32m_en(&mut self) -> _X32M_ENW { - _X32M_ENW { w: self } - } - #[doc = "Bit 17 - 32kHz Crystal Oscillator Enable."] - #[inline] - pub fn x32k_en(&mut self) -> _X32K_ENW { - _X32K_ENW { w: self } - } - #[doc = "Bit 18 - 60MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc_en(&mut self) -> _HIRC_ENW { - _HIRC_ENW { w: self } - } - #[doc = "Bit 19 - 96MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc96m_en(&mut self) -> _HIRC96M_ENW { - _HIRC96M_ENW { w: self } - } - #[doc = "Bit 20 - 8MHz High Frequency Internal Reference Clock Enable."] - #[inline] - pub fn hirc8m_en(&mut self) -> _HIRC8M_ENW { - _HIRC8M_ENW { w: self } - } - #[doc = "Bit 21 - 8MHz High Frequency Internal Reference Clock Voltage Select. This register bit is used to select the power supply to the HIRC8M."] - #[inline] - pub fn hirc8m_vs(&mut self) -> _HIRC8M_VSW { - _HIRC8M_VSW { w: self } - } - #[doc = "Bit 26 - 60MHz HIRC Ready."] - #[inline] - pub fn hirc_rdy(&mut self) -> _HIRC_RDYW { - _HIRC_RDYW { w: self } - } - #[doc = "Bit 27 - 96MHz HIRC Ready."] - #[inline] - pub fn hirc96m_rdy(&mut self) -> _HIRC96M_RDYW { - _HIRC96M_RDYW { w: self } - } - #[doc = "Bit 28 - 8MHz HIRC Ready."] - #[inline] - pub fn hirc8m_rdy(&mut self) -> _HIRC8M_RDYW { - _HIRC8M_RDYW { w: self } - } - #[doc = "Bit 29 - 8kHz Low Frequency Reference Clock Ready."] - #[inline] - pub fn lirc8k_rdy(&mut self) -> _LIRC8K_RDYW { - _LIRC8K_RDYW { w: self } - } - #[doc = "Bit 30 - 6kHz Low Frequency Reference Clock Ready."] - #[inline] - pub fn lirc6k_rdy(&mut self) -> _LIRC6K_RDYW { - _LIRC6K_RDYW { w: self } - } - } - } - #[doc = "Power Management."] - pub struct PM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Power Management."] - pub mod pm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "Active Mode."] - ACTIVE, - #[doc = "DeepSleep Mode."] - DEEPSLEEP, - #[doc = "Shutdown Mode."] - SHUTDOWN, - #[doc = "Backup Mode."] - BACKUP, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - MODER::ACTIVE => 0, - MODER::DEEPSLEEP => 0x02, - MODER::SHUTDOWN => 0x03, - MODER::BACKUP => 0x04, - MODER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> MODER { - match value { - 0 => MODER::ACTIVE, - 2 => MODER::DEEPSLEEP, - 3 => MODER::SHUTDOWN, - 4 => MODER::BACKUP, - i => MODER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `ACTIVE`"] - #[inline] - pub fn is_active(&self) -> bool { - *self == MODER::ACTIVE - } - #[doc = "Checks if the value of the field is `DEEPSLEEP`"] - #[inline] - pub fn is_deepsleep(&self) -> bool { - *self == MODER::DEEPSLEEP - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == MODER::SHUTDOWN - } - #[doc = "Checks if the value of the field is `BACKUP`"] - #[inline] - pub fn is_backup(&self) -> bool { - *self == MODER::BACKUP - } - } - #[doc = "Possible values of the field `GPIOWKEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIOWKENR { - #[doc = "Wake Up Disable."] - DIS, - #[doc = "Wake Up Enable."] - EN, - } - impl GPIOWKENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GPIOWKENR::DIS => false, - GPIOWKENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GPIOWKENR { - match value { - false => GPIOWKENR::DIS, - true => GPIOWKENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GPIOWKENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIOWKENR::EN - } - } - #[doc = r" Value of the field"] - pub struct RTCWKENR { - bits: bool, - } - impl RTCWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct USBWKENR { - bits: bool, - } - impl USBWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WUTWKENR { - bits: bool, - } - impl WUTWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDMAWKENR { - bits: bool, - } - impl SDMAWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `HIRCPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIRCPDR { - #[doc = "Mode is Active."] - ACTIVE, - #[doc = "Powered down in DEEPSLEEP."] - DEEPSLEEP, - } - impl HIRCPDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HIRCPDR::ACTIVE => false, - HIRCPDR::DEEPSLEEP => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HIRCPDR { - match value { - false => HIRCPDR::ACTIVE, - true => HIRCPDR::DEEPSLEEP, - } - } - #[doc = "Checks if the value of the field is `ACTIVE`"] - #[inline] - pub fn is_active(&self) -> bool { - *self == HIRCPDR::ACTIVE - } - #[doc = "Checks if the value of the field is `DEEPSLEEP`"] - #[inline] - pub fn is_deepsleep(&self) -> bool { - *self == HIRCPDR::DEEPSLEEP - } - } - #[doc = r" Value of the field"] - pub struct HIRC96MPDR { - bits: bool, - } - impl HIRC96MPDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HIRC8MPDR { - bits: bool, - } - impl HIRC8MPDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "Active Mode."] - ACTIVE, - #[doc = "DeepSleep Mode."] - DEEPSLEEP, - #[doc = "Shutdown Mode."] - SHUTDOWN, - #[doc = "Backup Mode."] - BACKUP, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - MODEW::ACTIVE => 0, - MODEW::DEEPSLEEP => 2, - MODEW::SHUTDOWN => 3, - MODEW::BACKUP => 4, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Active Mode."] - #[inline] - pub fn active(self) -> &'a mut W { - self.variant(MODEW::ACTIVE) - } - #[doc = "DeepSleep Mode."] - #[inline] - pub fn deepsleep(self) -> &'a mut W { - self.variant(MODEW::DEEPSLEEP) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(MODEW::SHUTDOWN) - } - #[doc = "Backup Mode."] - #[inline] - pub fn backup(self) -> &'a mut W { - self.variant(MODEW::BACKUP) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `GPIOWKEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIOWKENW { - #[doc = "Wake Up Disable."] - DIS, - #[doc = "Wake Up Enable."] - EN, - } - impl GPIOWKENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GPIOWKENW::DIS => false, - GPIOWKENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIOWKENW<'a> { - w: &'a mut W, - } - impl<'a> _GPIOWKENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIOWKENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wake Up Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GPIOWKENW::DIS) - } - #[doc = "Wake Up Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIOWKENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RTCWKENW<'a> { - w: &'a mut W, - } - impl<'a> _RTCWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBWKENW<'a> { - w: &'a mut W, - } - impl<'a> _USBWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WUTWKENW<'a> { - w: &'a mut W, - } - impl<'a> _WUTWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDMAWKENW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HIRCPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIRCPDW { - #[doc = "Mode is Active."] - ACTIVE, - #[doc = "Powered down in DEEPSLEEP."] - DEEPSLEEP, - } - impl HIRCPDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HIRCPDW::ACTIVE => false, - HIRCPDW::DEEPSLEEP => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HIRCPDW<'a> { - w: &'a mut W, - } - impl<'a> _HIRCPDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HIRCPDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Mode is Active."] - #[inline] - pub fn active(self) -> &'a mut W { - self.variant(HIRCPDW::ACTIVE) - } - #[doc = "Powered down in DEEPSLEEP."] - #[inline] - pub fn deepsleep(self) -> &'a mut W { - self.variant(HIRCPDW::DEEPSLEEP) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC96MPDW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC96MPDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HIRC8MPDW<'a> { - w: &'a mut W, - } - impl<'a> _HIRC8MPDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:2 - Operating Mode. This two bit field selects the current operating mode for the device. Note that code execution only occurs during ACTIVE mode."] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 4 - GPIO Wake Up Enable. This bit enables all GPIO pins as potential wakeup sources. Any GPIO configured for wakeup is capable of causing an exit from IDLE or STANDBY modes when this bit is set."] - #[inline] - pub fn gpiowken(&self) -> GPIOWKENR { - GPIOWKENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - RTC Alarm Wake Up Enable. This bit enables RTC alarm as wakeup source. If enabled, the desired RTC alarm must be configured via the RTC control registers."] - #[inline] - pub fn rtcwken(&self) -> RTCWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RTCWKENR { bits } - } - #[doc = "Bit 6 - USB Wake Up Enable. This bit enables USB activity as wakeup source."] - #[inline] - pub fn usbwken(&self) -> USBWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBWKENR { bits } - } - #[doc = "Bit 7 - WUT Wake Up Enable. This bit enables WUT IRQ as wakeup source."] - #[inline] - pub fn wutwken(&self) -> WUTWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WUTWKENR { bits } - } - #[doc = "Bit 8 - SDMA Wake Up Enable. This bit enables SDMA IRQ activity as wakeup source."] - #[inline] - pub fn sdmawken(&self) -> SDMAWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDMAWKENR { bits } - } - #[doc = "Bit 15 - HIRC Power Down. This bit selects HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hircpd(&self) -> HIRCPDR { - HIRCPDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - 96MHz power down. This bit selects 96MHz HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hirc96mpd(&self) -> HIRC96MPDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC96MPDR { bits } - } - #[doc = "Bit 17 - 8MHz power down. This bit selects 8MHz HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hirc8mpd(&self) -> HIRC8MPDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HIRC8MPDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - Operating Mode. This two bit field selects the current operating mode for the device. Note that code execution only occurs during ACTIVE mode."] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - #[doc = "Bit 4 - GPIO Wake Up Enable. This bit enables all GPIO pins as potential wakeup sources. Any GPIO configured for wakeup is capable of causing an exit from IDLE or STANDBY modes when this bit is set."] - #[inline] - pub fn gpiowken(&mut self) -> _GPIOWKENW { - _GPIOWKENW { w: self } - } - #[doc = "Bit 5 - RTC Alarm Wake Up Enable. This bit enables RTC alarm as wakeup source. If enabled, the desired RTC alarm must be configured via the RTC control registers."] - #[inline] - pub fn rtcwken(&mut self) -> _RTCWKENW { - _RTCWKENW { w: self } - } - #[doc = "Bit 6 - USB Wake Up Enable. This bit enables USB activity as wakeup source."] - #[inline] - pub fn usbwken(&mut self) -> _USBWKENW { - _USBWKENW { w: self } - } - #[doc = "Bit 7 - WUT Wake Up Enable. This bit enables WUT IRQ as wakeup source."] - #[inline] - pub fn wutwken(&mut self) -> _WUTWKENW { - _WUTWKENW { w: self } - } - #[doc = "Bit 8 - SDMA Wake Up Enable. This bit enables SDMA IRQ activity as wakeup source."] - #[inline] - pub fn sdmawken(&mut self) -> _SDMAWKENW { - _SDMAWKENW { w: self } - } - #[doc = "Bit 15 - HIRC Power Down. This bit selects HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hircpd(&mut self) -> _HIRCPDW { - _HIRCPDW { w: self } - } - #[doc = "Bit 16 - 96MHz power down. This bit selects 96MHz HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hirc96mpd(&mut self) -> _HIRC96MPDW { - _HIRC96MPDW { w: self } - } - #[doc = "Bit 17 - 8MHz power down. This bit selects 8MHz HIRC power state in DEEPSLEEP mode."] - #[inline] - pub fn hirc8mpd(&mut self) -> _HIRC8MPDW { - _HIRC8MPDW { w: self } - } - } - } - #[doc = "Peripheral Clock Divider."] - pub struct PCKDIV { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Peripheral Clock Divider."] - pub mod pckdiv { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PCKDIV { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `PCF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PCFR { - #[doc = "undocumented"] - _96MHZ, - #[doc = "undocumented"] - _48MHZ, - #[doc = "undocumented"] - _24MHZ, - #[doc = "undocumented"] - _12MHZ, - #[doc = "undocumented"] - _6MHZ, - #[doc = "undocumented"] - _3MHZ, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl PCFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PCFR::_96MHZ => 0x02, - PCFR::_48MHZ => 0x03, - PCFR::_24MHZ => 0x04, - PCFR::_12MHZ => 0x05, - PCFR::_6MHZ => 0x06, - PCFR::_3MHZ => 0x07, - PCFR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PCFR { - match value { - 2 => PCFR::_96MHZ, - 3 => PCFR::_48MHZ, - 4 => PCFR::_24MHZ, - 5 => PCFR::_12MHZ, - 6 => PCFR::_6MHZ, - 7 => PCFR::_3MHZ, - i => PCFR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_96MHZ`"] - #[inline] - pub fn is_96mhz(&self) -> bool { - *self == PCFR::_96MHZ - } - #[doc = "Checks if the value of the field is `_48MHZ`"] - #[inline] - pub fn is_48mhz(&self) -> bool { - *self == PCFR::_48MHZ - } - #[doc = "Checks if the value of the field is `_24MHZ`"] - #[inline] - pub fn is_24mhz(&self) -> bool { - *self == PCFR::_24MHZ - } - #[doc = "Checks if the value of the field is `_12MHZ`"] - #[inline] - pub fn is_12mhz(&self) -> bool { - *self == PCFR::_12MHZ - } - #[doc = "Checks if the value of the field is `_6MHZ`"] - #[inline] - pub fn is_6mhz(&self) -> bool { - *self == PCFR::_6MHZ - } - #[doc = "Checks if the value of the field is `_3MHZ`"] - #[inline] - pub fn is_3mhz(&self) -> bool { - *self == PCFR::_3MHZ - } - } - #[doc = "Possible values of the field `SDHCFRQ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDHCFRQR { - #[doc = "undocumented"] - _48MHZ, - #[doc = "undocumented"] - _24MHZ, - } - impl SDHCFRQR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDHCFRQR::_48MHZ => false, - SDHCFRQR::_24MHZ => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDHCFRQR { - match value { - false => SDHCFRQR::_48MHZ, - true => SDHCFRQR::_24MHZ, - } - } - #[doc = "Checks if the value of the field is `_48MHZ`"] - #[inline] - pub fn is_48mhz(&self) -> bool { - *self == SDHCFRQR::_48MHZ - } - #[doc = "Checks if the value of the field is `_24MHZ`"] - #[inline] - pub fn is_24mhz(&self) -> bool { - *self == SDHCFRQR::_24MHZ - } - } - #[doc = r" Value of the field"] - pub struct ADCFRQR { - bits: u8, - } - impl ADCFRQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `AONCD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AONCDR { - #[doc = "PCLK divide by 4."] - DIV_4, - #[doc = "PCLK divide by 8."] - DIV_8, - #[doc = "PCLK divide by 16."] - DIV_16, - #[doc = "PCLK divide by 32."] - DIV_32, - } - impl AONCDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - AONCDR::DIV_4 => 0, - AONCDR::DIV_8 => 0x01, - AONCDR::DIV_16 => 0x02, - AONCDR::DIV_32 => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> AONCDR { - match value { - 0 => AONCDR::DIV_4, - 1 => AONCDR::DIV_8, - 2 => AONCDR::DIV_16, - 3 => AONCDR::DIV_32, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `DIV_4`"] - #[inline] - pub fn is_div_4(&self) -> bool { - *self == AONCDR::DIV_4 - } - #[doc = "Checks if the value of the field is `DIV_8`"] - #[inline] - pub fn is_div_8(&self) -> bool { - *self == AONCDR::DIV_8 - } - #[doc = "Checks if the value of the field is `DIV_16`"] - #[inline] - pub fn is_div_16(&self) -> bool { - *self == AONCDR::DIV_16 - } - #[doc = "Checks if the value of the field is `DIV_32`"] - #[inline] - pub fn is_div_32(&self) -> bool { - *self == AONCDR::DIV_32 - } - } - #[doc = "Values that can be written to the field `PCF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PCFW { - #[doc = "`10`"] - _96MHZ, - #[doc = "`11`"] - _48MHZ, - #[doc = "`100`"] - _24MHZ, - #[doc = "`101`"] - _12MHZ, - #[doc = "`110`"] - _6MHZ, - #[doc = "`111`"] - _3MHZ, - } - impl PCFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PCFW::_96MHZ => 2, - PCFW::_48MHZ => 3, - PCFW::_24MHZ => 4, - PCFW::_12MHZ => 5, - PCFW::_6MHZ => 6, - PCFW::_3MHZ => 7, - } - } - } - #[doc = r" Proxy"] - pub struct _PCFW<'a> { - w: &'a mut W, - } - impl<'a> _PCFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PCFW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "`10`"] - #[inline] - pub fn _96mhz(self) -> &'a mut W { - self.variant(PCFW::_96MHZ) - } - #[doc = "`11`"] - #[inline] - pub fn _48mhz(self) -> &'a mut W { - self.variant(PCFW::_48MHZ) - } - #[doc = "`100`"] - #[inline] - pub fn _24mhz(self) -> &'a mut W { - self.variant(PCFW::_24MHZ) - } - #[doc = "`101`"] - #[inline] - pub fn _12mhz(self) -> &'a mut W { - self.variant(PCFW::_12MHZ) - } - #[doc = "`110`"] - #[inline] - pub fn _6mhz(self) -> &'a mut W { - self.variant(PCFW::_6MHZ) - } - #[doc = "`111`"] - #[inline] - pub fn _3mhz(self) -> &'a mut W { - self.variant(PCFW::_3MHZ) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDHCFRQ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDHCFRQW { - #[doc = "`0`"] - _48MHZ, - #[doc = "`1`"] - _24MHZ, - } - impl SDHCFRQW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDHCFRQW::_48MHZ => false, - SDHCFRQW::_24MHZ => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SDHCFRQW<'a> { - w: &'a mut W, - } - impl<'a> _SDHCFRQW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDHCFRQW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`0`"] - #[inline] - pub fn _48mhz(self) -> &'a mut W { - self.variant(SDHCFRQW::_48MHZ) - } - #[doc = "`1`"] - #[inline] - pub fn _24mhz(self) -> &'a mut W { - self.variant(SDHCFRQW::_24MHZ) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADCFRQW<'a> { - w: &'a mut W, - } - impl<'a> _ADCFRQW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AONCD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AONCDW { - #[doc = "PCLK divide by 4."] - DIV_4, - #[doc = "PCLK divide by 8."] - DIV_8, - #[doc = "PCLK divide by 16."] - DIV_16, - #[doc = "PCLK divide by 32."] - DIV_32, - } - impl AONCDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - AONCDW::DIV_4 => 0, - AONCDW::DIV_8 => 1, - AONCDW::DIV_16 => 2, - AONCDW::DIV_32 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _AONCDW<'a> { - w: &'a mut W, - } - impl<'a> _AONCDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AONCDW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "PCLK divide by 4."] - #[inline] - pub fn div_4(self) -> &'a mut W { - self.variant(AONCDW::DIV_4) - } - #[doc = "PCLK divide by 8."] - #[inline] - pub fn div_8(self) -> &'a mut W { - self.variant(AONCDW::DIV_8) - } - #[doc = "PCLK divide by 16."] - #[inline] - pub fn div_16(self) -> &'a mut W { - self.variant(AONCDW::DIV_16) - } - #[doc = "PCLK divide by 32."] - #[inline] - pub fn div_32(self) -> &'a mut W { - self.variant(AONCDW::DIV_32) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:2 - These bits determine the clock frequency for the UART, I2C and Key Pad peripherals. These peripherals have an adaptive clock generator that dynamically adjusts the peripheral frequency based on the main system bus frequency. These bits are dynamically updated when the PLL0 is selected as the system clock source and are set by hardware. These bits determine the clock frequency for the UART, I2C and Key Pad peripherals. These peripherals have an adaptive clock generator that dynamically adjusts the peripheral frequency based on the main system bus frequency. These bits are dynamically updated when the PLL0 is selected as the system clock source and are set by hardware."] - #[inline] - pub fn pcf(&self) -> PCFR { - PCFR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 7 - SDHC Clock Frequency. This bits defines the clock frequency of SDHC."] - #[inline] - pub fn sdhcfrq(&self) -> SDHCFRQR { - SDHCFRQR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 10:13 - ADC clock Frequency. These bits define the ADC clock frequency. FADC = FPCLK/(ADCFRQ)."] - #[inline] - pub fn adcfrq(&self) -> ADCFRQR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ADCFRQR { bits } - } - #[doc = "Bits 14:15 - Always-ON(AON) domain CLock Divider. These bits define the AON domain clock divider."] - #[inline] - pub fn aoncd(&self) -> AONCDR { - AONCDR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x01 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - These bits determine the clock frequency for the UART, I2C and Key Pad peripherals. These peripherals have an adaptive clock generator that dynamically adjusts the peripheral frequency based on the main system bus frequency. These bits are dynamically updated when the PLL0 is selected as the system clock source and are set by hardware. These bits determine the clock frequency for the UART, I2C and Key Pad peripherals. These peripherals have an adaptive clock generator that dynamically adjusts the peripheral frequency based on the main system bus frequency. These bits are dynamically updated when the PLL0 is selected as the system clock source and are set by hardware."] - #[inline] - pub fn pcf(&mut self) -> _PCFW { - _PCFW { w: self } - } - #[doc = "Bit 7 - SDHC Clock Frequency. This bits defines the clock frequency of SDHC."] - #[inline] - pub fn sdhcfrq(&mut self) -> _SDHCFRQW { - _SDHCFRQW { w: self } - } - #[doc = "Bits 10:13 - ADC clock Frequency. These bits define the ADC clock frequency. FADC = FPCLK/(ADCFRQ)."] - #[inline] - pub fn adcfrq(&mut self) -> _ADCFRQW { - _ADCFRQW { w: self } - } - #[doc = "Bits 14:15 - Always-ON(AON) domain CLock Divider. These bits define the AON domain clock divider."] - #[inline] - pub fn aoncd(&mut self) -> _AONCDW { - _AONCDW { w: self } - } - } - } - #[doc = "Peripheral Clock Disable."] - pub struct PERCKCN0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Peripheral Clock Disable."] - pub mod perckcn0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PERCKCN0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO0D`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO0DR { - #[doc = "enable it."] - EN, - #[doc = "disable it."] - DIS, - } - impl GPIO0DR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GPIO0DR::EN => false, - GPIO0DR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GPIO0DR { - match value { - false => GPIO0DR::EN, - true => GPIO0DR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIO0DR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GPIO0DR::DIS - } - } - #[doc = r" Value of the field"] - pub struct GPIO1DR { - bits: bool, - } - impl GPIO1DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct USBDR { - bits: bool, - } - impl USBDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMADR { - bits: bool, - } - impl DMADR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPI0DR { - bits: bool, - } - impl SPI0DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPI1DR { - bits: bool, - } - impl SPI1DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UART0DR { - bits: bool, - } - impl UART0DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UART1DR { - bits: bool, - } - impl UART1DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct I2C0DR { - bits: bool, - } - impl I2C0DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CRYPTODR { - bits: bool, - } - impl CRYPTODR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T0DR { - bits: bool, - } - impl T0DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T1DR { - bits: bool, - } - impl T1DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T2DR { - bits: bool, - } - impl T2DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T3DR { - bits: bool, - } - impl T3DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T4DR { - bits: bool, - } - impl T4DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct T5DR { - bits: bool, - } - impl T5DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADCDR { - bits: bool, - } - impl ADCDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct I2C1DR { - bits: bool, - } - impl I2C1DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PTDR { - bits: bool, - } - impl PTDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPIXIPDR { - bits: bool, - } - impl SPIXIPDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPIMDR { - bits: bool, - } - impl SPIMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `GPIO0D`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO0DW { - #[doc = "enable it."] - EN, - #[doc = "disable it."] - DIS, - } - impl GPIO0DW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GPIO0DW::EN => false, - GPIO0DW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO0DW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO0DW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO0DW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "enable it."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIO0DW::EN) - } - #[doc = "disable it."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GPIO0DW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _GPIO1DW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO1DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBDW<'a> { - w: &'a mut W, - } - impl<'a> _USBDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMADW<'a> { - w: &'a mut W, - } - impl<'a> _DMADW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPI0DW<'a> { - w: &'a mut W, - } - impl<'a> _SPI0DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPI1DW<'a> { - w: &'a mut W, - } - impl<'a> _SPI1DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UART0DW<'a> { - w: &'a mut W, - } - impl<'a> _UART0DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UART1DW<'a> { - w: &'a mut W, - } - impl<'a> _UART1DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _I2C0DW<'a> { - w: &'a mut W, - } - impl<'a> _I2C0DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRYPTODW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTODW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T0DW<'a> { - w: &'a mut W, - } - impl<'a> _T0DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T1DW<'a> { - w: &'a mut W, - } - impl<'a> _T1DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T2DW<'a> { - w: &'a mut W, - } - impl<'a> _T2DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T3DW<'a> { - w: &'a mut W, - } - impl<'a> _T3DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T4DW<'a> { - w: &'a mut W, - } - impl<'a> _T4DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _T5DW<'a> { - w: &'a mut W, - } - impl<'a> _T5DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADCDW<'a> { - w: &'a mut W, - } - impl<'a> _ADCDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _I2C1DW<'a> { - w: &'a mut W, - } - impl<'a> _I2C1DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PTDW<'a> { - w: &'a mut W, - } - impl<'a> _PTDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPIXIPDW<'a> { - w: &'a mut W, - } - impl<'a> _SPIXIPDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 30; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPIMDW<'a> { - w: &'a mut W, - } - impl<'a> _SPIMDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - GPIO0 Disable."] - #[inline] - pub fn gpio0d(&self) -> GPIO0DR { - GPIO0DR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - GPIO1 Disable."] - #[inline] - pub fn gpio1d(&self) -> GPIO1DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - GPIO1DR { bits } - } - #[doc = "Bit 3 - USB Disable."] - #[inline] - pub fn usbd(&self) -> USBDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBDR { bits } - } - #[doc = "Bit 5 - DMA Disable."] - #[inline] - pub fn dmad(&self) -> DMADR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DMADR { bits } - } - #[doc = "Bit 6 - SPI 0 Disable."] - #[inline] - pub fn spi0d(&self) -> SPI0DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPI0DR { bits } - } - #[doc = "Bit 7 - SPI 1 Disable."] - #[inline] - pub fn spi1d(&self) -> SPI1DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPI1DR { bits } - } - #[doc = "Bit 9 - UART 0 Disable."] - #[inline] - pub fn uart0d(&self) -> UART0DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - UART0DR { bits } - } - #[doc = "Bit 10 - UART 1 Disable."] - #[inline] - pub fn uart1d(&self) -> UART1DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - UART1DR { bits } - } - #[doc = "Bit 13 - I2C 0 Disable."] - #[inline] - pub fn i2c0d(&self) -> I2C0DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - I2C0DR { bits } - } - #[doc = "Bit 14 - Crypto Disable."] - #[inline] - pub fn cryptod(&self) -> CRYPTODR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CRYPTODR { bits } - } - #[doc = "Bit 15 - Timer 0 Disable."] - #[inline] - pub fn t0d(&self) -> T0DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T0DR { bits } - } - #[doc = "Bit 16 - Timer 1 Disable."] - #[inline] - pub fn t1d(&self) -> T1DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T1DR { bits } - } - #[doc = "Bit 17 - Timer 2 Disable."] - #[inline] - pub fn t2d(&self) -> T2DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T2DR { bits } - } - #[doc = "Bit 18 - Timer 3 Disable."] - #[inline] - pub fn t3d(&self) -> T3DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T3DR { bits } - } - #[doc = "Bit 19 - Timer 4 Disable."] - #[inline] - pub fn t4d(&self) -> T4DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T4DR { bits } - } - #[doc = "Bit 20 - Timer 5 Disable."] - #[inline] - pub fn t5d(&self) -> T5DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - T5DR { bits } - } - #[doc = "Bit 23 - ADC Disable."] - #[inline] - pub fn adcd(&self) -> ADCDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ADCDR { bits } - } - #[doc = "Bit 28 - I2C 1 Disable."] - #[inline] - pub fn i2c1d(&self) -> I2C1DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - I2C1DR { bits } - } - #[doc = "Bit 29 - PT Clock Disable."] - #[inline] - pub fn ptd(&self) -> PTDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PTDR { bits } - } - #[doc = "Bit 30 - SPI XiP Disable."] - #[inline] - pub fn spixipd(&self) -> SPIXIPDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPIXIPDR { bits } - } - #[doc = "Bit 31 - SPI XiP Master Controller Disable."] - #[inline] - pub fn spimd(&self) -> SPIMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPIMDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - GPIO0 Disable."] - #[inline] - pub fn gpio0d(&mut self) -> _GPIO0DW { - _GPIO0DW { w: self } - } - #[doc = "Bit 1 - GPIO1 Disable."] - #[inline] - pub fn gpio1d(&mut self) -> _GPIO1DW { - _GPIO1DW { w: self } - } - #[doc = "Bit 3 - USB Disable."] - #[inline] - pub fn usbd(&mut self) -> _USBDW { - _USBDW { w: self } - } - #[doc = "Bit 5 - DMA Disable."] - #[inline] - pub fn dmad(&mut self) -> _DMADW { - _DMADW { w: self } - } - #[doc = "Bit 6 - SPI 0 Disable."] - #[inline] - pub fn spi0d(&mut self) -> _SPI0DW { - _SPI0DW { w: self } - } - #[doc = "Bit 7 - SPI 1 Disable."] - #[inline] - pub fn spi1d(&mut self) -> _SPI1DW { - _SPI1DW { w: self } - } - #[doc = "Bit 9 - UART 0 Disable."] - #[inline] - pub fn uart0d(&mut self) -> _UART0DW { - _UART0DW { w: self } - } - #[doc = "Bit 10 - UART 1 Disable."] - #[inline] - pub fn uart1d(&mut self) -> _UART1DW { - _UART1DW { w: self } - } - #[doc = "Bit 13 - I2C 0 Disable."] - #[inline] - pub fn i2c0d(&mut self) -> _I2C0DW { - _I2C0DW { w: self } - } - #[doc = "Bit 14 - Crypto Disable."] - #[inline] - pub fn cryptod(&mut self) -> _CRYPTODW { - _CRYPTODW { w: self } - } - #[doc = "Bit 15 - Timer 0 Disable."] - #[inline] - pub fn t0d(&mut self) -> _T0DW { - _T0DW { w: self } - } - #[doc = "Bit 16 - Timer 1 Disable."] - #[inline] - pub fn t1d(&mut self) -> _T1DW { - _T1DW { w: self } - } - #[doc = "Bit 17 - Timer 2 Disable."] - #[inline] - pub fn t2d(&mut self) -> _T2DW { - _T2DW { w: self } - } - #[doc = "Bit 18 - Timer 3 Disable."] - #[inline] - pub fn t3d(&mut self) -> _T3DW { - _T3DW { w: self } - } - #[doc = "Bit 19 - Timer 4 Disable."] - #[inline] - pub fn t4d(&mut self) -> _T4DW { - _T4DW { w: self } - } - #[doc = "Bit 20 - Timer 5 Disable."] - #[inline] - pub fn t5d(&mut self) -> _T5DW { - _T5DW { w: self } - } - #[doc = "Bit 23 - ADC Disable."] - #[inline] - pub fn adcd(&mut self) -> _ADCDW { - _ADCDW { w: self } - } - #[doc = "Bit 28 - I2C 1 Disable."] - #[inline] - pub fn i2c1d(&mut self) -> _I2C1DW { - _I2C1DW { w: self } - } - #[doc = "Bit 29 - PT Clock Disable."] - #[inline] - pub fn ptd(&mut self) -> _PTDW { - _PTDW { w: self } - } - #[doc = "Bit 30 - SPI XiP Disable."] - #[inline] - pub fn spixipd(&mut self) -> _SPIXIPDW { - _SPIXIPDW { w: self } - } - #[doc = "Bit 31 - SPI XiP Master Controller Disable."] - #[inline] - pub fn spimd(&mut self) -> _SPIMDW { - _SPIMDW { w: self } - } - } - } - #[doc = "Memory Clock Control Register."] - pub struct MEMCKCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Memory Clock Control Register."] - pub mod memckcn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MEMCKCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct FWSR { - bits: u8, - } - impl FWSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `SYSRAM0LS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYSRAM0LSR { - #[doc = "RAM is active."] - ACTIVE, - #[doc = "RAM is in Light Sleep mode."] - LIGHT_SLEEP, - } - impl SYSRAM0LSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYSRAM0LSR::ACTIVE => false, - SYSRAM0LSR::LIGHT_SLEEP => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYSRAM0LSR { - match value { - false => SYSRAM0LSR::ACTIVE, - true => SYSRAM0LSR::LIGHT_SLEEP, - } - } - #[doc = "Checks if the value of the field is `ACTIVE`"] - #[inline] - pub fn is_active(&self) -> bool { - *self == SYSRAM0LSR::ACTIVE - } - #[doc = "Checks if the value of the field is `LIGHT_SLEEP`"] - #[inline] - pub fn is_light_sleep(&self) -> bool { - *self == SYSRAM0LSR::LIGHT_SLEEP - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM1LSR { - bits: bool, - } - impl SYSRAM1LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM2LSR { - bits: bool, - } - impl SYSRAM2LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM3LSR { - bits: bool, - } - impl SYSRAM3LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM4LSR { - bits: bool, - } - impl SYSRAM4LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM5LSR { - bits: bool, - } - impl SYSRAM5LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM6LSR { - bits: bool, - } - impl SYSRAM6LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHELSR { - bits: bool, - } - impl ICACHELSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHEXIPLSR { - bits: bool, - } - impl ICACHEXIPLSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCACHELSR { - bits: bool, - } - impl SCACHELSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CRYPTOLSR { - bits: bool, - } - impl CRYPTOLSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct USBLSR { - bits: bool, - } - impl USBLSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ROMLSR { - bits: bool, - } - impl ROMLSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ROM1LSR { - bits: bool, - } - impl ROM1LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHE1LSR { - bits: bool, - } - impl ICACHE1LSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _FWSW<'a> { - w: &'a mut W, - } - impl<'a> _FWSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYSRAM0LS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYSRAM0LSW { - #[doc = "RAM is active."] - ACTIVE, - #[doc = "RAM is in Light Sleep mode."] - LIGHT_SLEEP, - } - impl SYSRAM0LSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYSRAM0LSW::ACTIVE => false, - SYSRAM0LSW::LIGHT_SLEEP => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM0LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM0LSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYSRAM0LSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "RAM is active."] - #[inline] - pub fn active(self) -> &'a mut W { - self.variant(SYSRAM0LSW::ACTIVE) - } - #[doc = "RAM is in Light Sleep mode."] - #[inline] - pub fn light_sleep(self) -> &'a mut W { - self.variant(SYSRAM0LSW::LIGHT_SLEEP) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM1LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM1LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM2LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM2LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM3LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM3LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM4LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM4LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM5LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM5LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM6LSW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM6LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHELSW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHELSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHEXIPLSW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHEXIPLSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCACHELSW<'a> { - w: &'a mut W, - } - impl<'a> _SCACHELSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOLSW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOLSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBLSW<'a> { - w: &'a mut W, - } - impl<'a> _USBLSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ROMLSW<'a> { - w: &'a mut W, - } - impl<'a> _ROMLSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ROM1LSW<'a> { - w: &'a mut W, - } - impl<'a> _ROM1LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 30; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHE1LSW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHE1LSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:2 - Flash Wait State. These bits define the number of wait-state cycles per Flash data read access. Minimum wait state is 2."] - #[inline] - pub fn fws(&self) -> FWSR { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - FWSR { bits } - } - #[doc = "Bit 16 - System RAM 0 Light Sleep Mode."] - #[inline] - pub fn sysram0ls(&self) -> SYSRAM0LSR { - SYSRAM0LSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - System RAM 1 Light Sleep Mode."] - #[inline] - pub fn sysram1ls(&self) -> SYSRAM1LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM1LSR { bits } - } - #[doc = "Bit 18 - System RAM 2 Light Sleep Mode."] - #[inline] - pub fn sysram2ls(&self) -> SYSRAM2LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM2LSR { bits } - } - #[doc = "Bit 19 - System RAM 3 Light Sleep Mode."] - #[inline] - pub fn sysram3ls(&self) -> SYSRAM3LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM3LSR { bits } - } - #[doc = "Bit 20 - System RAM 4 Light Sleep Mode."] - #[inline] - pub fn sysram4ls(&self) -> SYSRAM4LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM4LSR { bits } - } - #[doc = "Bit 21 - System RAM 5 Light Sleep Mode."] - #[inline] - pub fn sysram5ls(&self) -> SYSRAM5LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM5LSR { bits } - } - #[doc = "Bit 22 - System RAM 6 Light Sleep Mode."] - #[inline] - pub fn sysram6ls(&self) -> SYSRAM6LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM6LSR { bits } - } - #[doc = "Bit 24 - ICache RAM Light Sleep Mode."] - #[inline] - pub fn icachels(&self) -> ICACHELSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHELSR { bits } - } - #[doc = "Bit 25 - ICACHE-XIP RAM Light Sleep Mode."] - #[inline] - pub fn icachexipls(&self) -> ICACHEXIPLSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHEXIPLSR { bits } - } - #[doc = "Bit 26 - SysCache RAM Light Sleep Mode."] - #[inline] - pub fn scachels(&self) -> SCACHELSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCACHELSR { bits } - } - #[doc = "Bit 27 - CRYPTO RAM Light Sleep Mode."] - #[inline] - pub fn cryptols(&self) -> CRYPTOLSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CRYPTOLSR { bits } - } - #[doc = "Bit 28 - USB FIFO Light Sleep Mode."] - #[inline] - pub fn usbls(&self) -> USBLSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBLSR { bits } - } - #[doc = "Bit 29 - ROM Light Sleep Mode."] - #[inline] - pub fn romls(&self) -> ROMLSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ROMLSR { bits } - } - #[doc = "Bit 30 - ROM1 Light Sleep Mode."] - #[inline] - pub fn rom1ls(&self) -> ROM1LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ROM1LSR { bits } - } - #[doc = "Bit 31 - ICache RAM Light Sleep Mode."] - #[inline] - pub fn icache1ls(&self) -> ICACHE1LSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHE1LSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - Flash Wait State. These bits define the number of wait-state cycles per Flash data read access. Minimum wait state is 2."] - #[inline] - pub fn fws(&mut self) -> _FWSW { - _FWSW { w: self } - } - #[doc = "Bit 16 - System RAM 0 Light Sleep Mode."] - #[inline] - pub fn sysram0ls(&mut self) -> _SYSRAM0LSW { - _SYSRAM0LSW { w: self } - } - #[doc = "Bit 17 - System RAM 1 Light Sleep Mode."] - #[inline] - pub fn sysram1ls(&mut self) -> _SYSRAM1LSW { - _SYSRAM1LSW { w: self } - } - #[doc = "Bit 18 - System RAM 2 Light Sleep Mode."] - #[inline] - pub fn sysram2ls(&mut self) -> _SYSRAM2LSW { - _SYSRAM2LSW { w: self } - } - #[doc = "Bit 19 - System RAM 3 Light Sleep Mode."] - #[inline] - pub fn sysram3ls(&mut self) -> _SYSRAM3LSW { - _SYSRAM3LSW { w: self } - } - #[doc = "Bit 20 - System RAM 4 Light Sleep Mode."] - #[inline] - pub fn sysram4ls(&mut self) -> _SYSRAM4LSW { - _SYSRAM4LSW { w: self } - } - #[doc = "Bit 21 - System RAM 5 Light Sleep Mode."] - #[inline] - pub fn sysram5ls(&mut self) -> _SYSRAM5LSW { - _SYSRAM5LSW { w: self } - } - #[doc = "Bit 22 - System RAM 6 Light Sleep Mode."] - #[inline] - pub fn sysram6ls(&mut self) -> _SYSRAM6LSW { - _SYSRAM6LSW { w: self } - } - #[doc = "Bit 24 - ICache RAM Light Sleep Mode."] - #[inline] - pub fn icachels(&mut self) -> _ICACHELSW { - _ICACHELSW { w: self } - } - #[doc = "Bit 25 - ICACHE-XIP RAM Light Sleep Mode."] - #[inline] - pub fn icachexipls(&mut self) -> _ICACHEXIPLSW { - _ICACHEXIPLSW { w: self } - } - #[doc = "Bit 26 - SysCache RAM Light Sleep Mode."] - #[inline] - pub fn scachels(&mut self) -> _SCACHELSW { - _SCACHELSW { w: self } - } - #[doc = "Bit 27 - CRYPTO RAM Light Sleep Mode."] - #[inline] - pub fn cryptols(&mut self) -> _CRYPTOLSW { - _CRYPTOLSW { w: self } - } - #[doc = "Bit 28 - USB FIFO Light Sleep Mode."] - #[inline] - pub fn usbls(&mut self) -> _USBLSW { - _USBLSW { w: self } - } - #[doc = "Bit 29 - ROM Light Sleep Mode."] - #[inline] - pub fn romls(&mut self) -> _ROMLSW { - _ROMLSW { w: self } - } - #[doc = "Bit 30 - ROM1 Light Sleep Mode."] - #[inline] - pub fn rom1ls(&mut self) -> _ROM1LSW { - _ROM1LSW { w: self } - } - #[doc = "Bit 31 - ICache RAM Light Sleep Mode."] - #[inline] - pub fn icache1ls(&mut self) -> _ICACHE1LSW { - _ICACHE1LSW { w: self } - } - } - } - #[doc = "Memory Zeroize Control."] - pub struct MEMZCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Memory Zeroize Control."] - pub mod memzcn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MEMZCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SRAM0Z`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM0ZR { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl SRAM0ZR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM0ZR::NOP => false, - SRAM0ZR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM0ZR { - match value { - false => SRAM0ZR::NOP, - true => SRAM0ZR::START, - } - } - #[doc = "Checks if the value of the field is `NOP`"] - #[inline] - pub fn is_nop(&self) -> bool { - *self == SRAM0ZR::NOP - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == SRAM0ZR::START - } - } - #[doc = r" Value of the field"] - pub struct SRAM1ZR { - bits: bool, - } - impl SRAM1ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRAM2ZR { - bits: bool, - } - impl SRAM2ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRAM3ZR { - bits: bool, - } - impl SRAM3ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRAM4ZR { - bits: bool, - } - impl SRAM4ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRAM5ZR { - bits: bool, - } - impl SRAM5ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRAM6ZR { - bits: bool, - } - impl SRAM6ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHEZR { - bits: bool, - } - impl ICACHEZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHEXIPZR { - bits: bool, - } - impl ICACHEXIPZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCACHEDATAZR { - bits: bool, - } - impl SCACHEDATAZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCACHETAGZR { - bits: bool, - } - impl SCACHETAGZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CRYPTOZR { - bits: bool, - } - impl CRYPTOZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct USBFIFOZR { - bits: bool, - } - impl USBFIFOZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHE1ZR { - bits: bool, - } - impl ICACHE1ZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `SRAM0Z`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM0ZW { - #[doc = "No operation/complete."] - NOP, - #[doc = "Start operation."] - START, - } - impl SRAM0ZW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM0ZW::NOP => false, - SRAM0ZW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM0ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM0ZW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM0ZW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn nop(self) -> &'a mut W { - self.variant(SRAM0ZW::NOP) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(SRAM0ZW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM1ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM1ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM2ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM2ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM3ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM3ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM4ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM4ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM5ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM5ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRAM6ZW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM6ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHEZW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHEZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHEXIPZW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHEXIPZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCACHEDATAZW<'a> { - w: &'a mut W, - } - impl<'a> _SCACHEDATAZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCACHETAGZW<'a> { - w: &'a mut W, - } - impl<'a> _SCACHETAGZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOZW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBFIFOZW<'a> { - w: &'a mut W, - } - impl<'a> _USBFIFOZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHE1ZW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHE1ZW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - System RAM Block 0."] - #[inline] - pub fn sram0z(&self) -> SRAM0ZR { - SRAM0ZR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - System RAM Block 1."] - #[inline] - pub fn sram1z(&self) -> SRAM1ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM1ZR { bits } - } - #[doc = "Bit 2 - System RAM Block 2."] - #[inline] - pub fn sram2z(&self) -> SRAM2ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM2ZR { bits } - } - #[doc = "Bit 3 - System RAM Block 3."] - #[inline] - pub fn sram3z(&self) -> SRAM3ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM3ZR { bits } - } - #[doc = "Bit 4 - System RAM Block 4."] - #[inline] - pub fn sram4z(&self) -> SRAM4ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM4ZR { bits } - } - #[doc = "Bit 5 - System RAM Block 5."] - #[inline] - pub fn sram5z(&self) -> SRAM5ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM5ZR { bits } - } - #[doc = "Bit 6 - System RAM Block 6."] - #[inline] - pub fn sram6z(&self) -> SRAM6ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRAM6ZR { bits } - } - #[doc = "Bit 8 - Instruction Cache."] - #[inline] - pub fn icachez(&self) -> ICACHEZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHEZR { bits } - } - #[doc = "Bit 9 - Instruction Cache XIP Data and Tag Ram zeroizatoin."] - #[inline] - pub fn icachexipz(&self) -> ICACHEXIPZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHEXIPZR { bits } - } - #[doc = "Bit 10 - System Cache Data Ram Zeroization."] - #[inline] - pub fn scachedataz(&self) -> SCACHEDATAZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCACHEDATAZR { bits } - } - #[doc = "Bit 11 - System Cache Tag Zeroization."] - #[inline] - pub fn scachetagz(&self) -> SCACHETAGZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCACHETAGZR { bits } - } - #[doc = "Bit 12 - Crypto (MAA) Memory."] - #[inline] - pub fn cryptoz(&self) -> CRYPTOZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CRYPTOZR { bits } - } - #[doc = "Bit 13 - USB FIFO Zeroizatoin."] - #[inline] - pub fn usbfifoz(&self) -> USBFIFOZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBFIFOZR { bits } - } - #[doc = "Bit 14 - Instruction Cache."] - #[inline] - pub fn icache1z(&self) -> ICACHE1ZR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHE1ZR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - System RAM Block 0."] - #[inline] - pub fn sram0z(&mut self) -> _SRAM0ZW { - _SRAM0ZW { w: self } - } - #[doc = "Bit 1 - System RAM Block 1."] - #[inline] - pub fn sram1z(&mut self) -> _SRAM1ZW { - _SRAM1ZW { w: self } - } - #[doc = "Bit 2 - System RAM Block 2."] - #[inline] - pub fn sram2z(&mut self) -> _SRAM2ZW { - _SRAM2ZW { w: self } - } - #[doc = "Bit 3 - System RAM Block 3."] - #[inline] - pub fn sram3z(&mut self) -> _SRAM3ZW { - _SRAM3ZW { w: self } - } - #[doc = "Bit 4 - System RAM Block 4."] - #[inline] - pub fn sram4z(&mut self) -> _SRAM4ZW { - _SRAM4ZW { w: self } - } - #[doc = "Bit 5 - System RAM Block 5."] - #[inline] - pub fn sram5z(&mut self) -> _SRAM5ZW { - _SRAM5ZW { w: self } - } - #[doc = "Bit 6 - System RAM Block 6."] - #[inline] - pub fn sram6z(&mut self) -> _SRAM6ZW { - _SRAM6ZW { w: self } - } - #[doc = "Bit 8 - Instruction Cache."] - #[inline] - pub fn icachez(&mut self) -> _ICACHEZW { - _ICACHEZW { w: self } - } - #[doc = "Bit 9 - Instruction Cache XIP Data and Tag Ram zeroizatoin."] - #[inline] - pub fn icachexipz(&mut self) -> _ICACHEXIPZW { - _ICACHEXIPZW { w: self } - } - #[doc = "Bit 10 - System Cache Data Ram Zeroization."] - #[inline] - pub fn scachedataz(&mut self) -> _SCACHEDATAZW { - _SCACHEDATAZW { w: self } - } - #[doc = "Bit 11 - System Cache Tag Zeroization."] - #[inline] - pub fn scachetagz(&mut self) -> _SCACHETAGZW { - _SCACHETAGZW { w: self } - } - #[doc = "Bit 12 - Crypto (MAA) Memory."] - #[inline] - pub fn cryptoz(&mut self) -> _CRYPTOZW { - _CRYPTOZW { w: self } - } - #[doc = "Bit 13 - USB FIFO Zeroizatoin."] - #[inline] - pub fn usbfifoz(&mut self) -> _USBFIFOZW { - _USBFIFOZW { w: self } - } - #[doc = "Bit 14 - Instruction Cache."] - #[inline] - pub fn icache1z(&mut self) -> _ICACHE1ZW { - _ICACHE1ZW { w: self } - } - } - } - #[doc = "Smart Card Clock Control."] - pub struct SCCK { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Smart Card Clock Control."] - pub mod scck { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SCCK { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x1414 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Master Priority Control Register 0."] - pub struct MPRI0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Master Priority Control Register 0."] - pub mod mpri0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MPRI0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x1414 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Mater Priority Control Register 1."] - pub struct MPRI1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Mater Priority Control Register 1."] - pub mod mpri1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MPRI1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x1414 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "System Status Register."] - pub struct SYSST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "System Status Register."] - pub mod sysst { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SYSST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ICECLOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICECLOCKR { - #[doc = "ICE is unlocked."] - UNLOCKED, - #[doc = "ICE is locked."] - LOCKED, - } - impl ICECLOCKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ICECLOCKR::UNLOCKED => false, - ICECLOCKR::LOCKED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ICECLOCKR { - match value { - false => ICECLOCKR::UNLOCKED, - true => ICECLOCKR::LOCKED, - } - } - #[doc = "Checks if the value of the field is `UNLOCKED`"] - #[inline] - pub fn is_unlocked(&self) -> bool { - *self == ICECLOCKR::UNLOCKED - } - #[doc = "Checks if the value of the field is `LOCKED`"] - #[inline] - pub fn is_locked(&self) -> bool { - *self == ICECLOCKR::LOCKED - } - } - #[doc = "Possible values of the field `CODEINTERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CODEINTERRR { - #[doc = "Normal Operating Condition."] - NORM, - #[doc = "Code Integrity Error."] - CODE, - } - impl CODEINTERRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CODEINTERRR::NORM => false, - CODEINTERRR::CODE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CODEINTERRR { - match value { - false => CODEINTERRR::NORM, - true => CODEINTERRR::CODE, - } - } - #[doc = "Checks if the value of the field is `NORM`"] - #[inline] - pub fn is_norm(&self) -> bool { - *self == CODEINTERRR::NORM - } - #[doc = "Checks if the value of the field is `CODE`"] - #[inline] - pub fn is_code(&self) -> bool { - *self == CODEINTERRR::CODE - } - } - #[doc = "Possible values of the field `SCMEMF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCMEMFR { - #[doc = "Normal Operating Condition."] - NORM, - #[doc = "Memory Fault."] - MEMORY, - } - impl SCMEMFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCMEMFR::NORM => false, - SCMEMFR::MEMORY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCMEMFR { - match value { - false => SCMEMFR::NORM, - true => SCMEMFR::MEMORY, - } - } - #[doc = "Checks if the value of the field is `NORM`"] - #[inline] - pub fn is_norm(&self) -> bool { - *self == SCMEMFR::NORM - } - #[doc = "Checks if the value of the field is `MEMORY`"] - #[inline] - pub fn is_memory(&self) -> bool { - *self == SCMEMFR::MEMORY - } - } - #[doc = "Values that can be written to the field `ICECLOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICECLOCKW { - #[doc = "ICE is unlocked."] - UNLOCKED, - #[doc = "ICE is locked."] - LOCKED, - } - impl ICECLOCKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ICECLOCKW::UNLOCKED => false, - ICECLOCKW::LOCKED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ICECLOCKW<'a> { - w: &'a mut W, - } - impl<'a> _ICECLOCKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ICECLOCKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "ICE is unlocked."] - #[inline] - pub fn unlocked(self) -> &'a mut W { - self.variant(ICECLOCKW::UNLOCKED) - } - #[doc = "ICE is locked."] - #[inline] - pub fn locked(self) -> &'a mut W { - self.variant(ICECLOCKW::LOCKED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CODEINTERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CODEINTERRW { - #[doc = "Normal Operating Condition."] - NORM, - #[doc = "Code Integrity Error."] - CODE, - } - impl CODEINTERRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CODEINTERRW::NORM => false, - CODEINTERRW::CODE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CODEINTERRW<'a> { - w: &'a mut W, - } - impl<'a> _CODEINTERRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CODEINTERRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Condition."] - #[inline] - pub fn norm(self) -> &'a mut W { - self.variant(CODEINTERRW::NORM) - } - #[doc = "Code Integrity Error."] - #[inline] - pub fn code(self) -> &'a mut W { - self.variant(CODEINTERRW::CODE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCMEMF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCMEMFW { - #[doc = "Normal Operating Condition."] - NORM, - #[doc = "Memory Fault."] - MEMORY, - } - impl SCMEMFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCMEMFW::NORM => false, - SCMEMFW::MEMORY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCMEMFW<'a> { - w: &'a mut W, - } - impl<'a> _SCMEMFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCMEMFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Condition."] - #[inline] - pub fn norm(self) -> &'a mut W { - self.variant(SCMEMFW::NORM) - } - #[doc = "Memory Fault."] - #[inline] - pub fn memory(self) -> &'a mut W { - self.variant(SCMEMFW::MEMORY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ARM ICE Lock Status."] - #[inline] - pub fn iceclock(&self) -> ICECLOCKR { - ICECLOCKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Code Integrity Error Flag. This bit indicates a code integrity error has occured in XiP interface."] - #[inline] - pub fn codeinterr(&self) -> CODEINTERRR { - CODEINTERRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - System Cache Memory Fault Flag. This bit indicates a memory fault has occured in the System Cache while receiving data from the Hyperbus Interface."] - #[inline] - pub fn scmemf(&self) -> SCMEMFR { - SCMEMFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ARM ICE Lock Status."] - #[inline] - pub fn iceclock(&mut self) -> _ICECLOCKW { - _ICECLOCKW { w: self } - } - #[doc = "Bit 1 - Code Integrity Error Flag. This bit indicates a code integrity error has occured in XiP interface."] - #[inline] - pub fn codeinterr(&mut self) -> _CODEINTERRW { - _CODEINTERRW { w: self } - } - #[doc = "Bit 5 - System Cache Memory Fault Flag. This bit indicates a memory fault has occured in the System Cache while receiving data from the Hyperbus Interface."] - #[inline] - pub fn scmemf(&mut self) -> _SCMEMFW { - _SCMEMFW { w: self } - } - } - } - #[doc = "Reset 1."] - pub struct RSTR1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Reset 1."] - pub mod rstr1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RSTR1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `I2C1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1R { - #[doc = "Reset complete."] - RESET_DONE, - #[doc = "Starts reset or indicates reset in progress."] - BUSY, - } - impl I2C1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C1R::RESET_DONE => false, - I2C1R::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C1R { - match value { - false => I2C1R::RESET_DONE, - true => I2C1R::BUSY, - } - } - #[doc = "Checks if the value of the field is `RESET_DONE`"] - #[inline] - pub fn is_reset_done(&self) -> bool { - *self == I2C1R::RESET_DONE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == I2C1R::BUSY - } - } - #[doc = r" Value of the field"] - pub struct PTR { - bits: bool, - } - impl PTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PBMR { - bits: bool, - } - impl PBMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPIXIPR { - bits: bool, - } - impl SPIXIPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct XSPIMR { - bits: bool, - } - impl XSPIMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct GPIO3R { - bits: bool, - } - impl GPIO3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDHCR { - bits: bool, - } - impl SDHCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OWIRER { - bits: bool, - } - impl OWIRER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WDT1R { - bits: bool, - } - impl WDT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct QSPI0_AHBR { - bits: bool, - } - impl QSPI0_AHBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPIXMEMR { - bits: bool, - } - impl SPIXMEMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SMPHRR { - bits: bool, - } - impl SMPHRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WDT2R { - bits: bool, - } - impl WDT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BTLER { - bits: bool, - } - impl BTLER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUDIOR { - bits: bool, - } - impl AUDIOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct I2C2R { - bits: bool, - } - impl I2C2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HTMR0R { - bits: bool, - } - impl HTMR0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HTMR1R { - bits: bool, - } - impl HTMR1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DVSR { - bits: bool, - } - impl DVSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SIMOR { - bits: bool, - } - impl SIMOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `I2C1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1W { - #[doc = "Reset complete."] - RESET_DONE, - #[doc = "Starts reset or indicates reset in progress."] - BUSY, - } - impl I2C1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C1W::RESET_DONE => false, - I2C1W::BUSY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C1W<'a> { - w: &'a mut W, - } - impl<'a> _I2C1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Reset complete."] - #[inline] - pub fn reset_done(self) -> &'a mut W { - self.variant(I2C1W::RESET_DONE) - } - #[doc = "Starts reset or indicates reset in progress."] - #[inline] - pub fn busy(self) -> &'a mut W { - self.variant(I2C1W::BUSY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PTW<'a> { - w: &'a mut W, - } - impl<'a> _PTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PBMW<'a> { - w: &'a mut W, - } - impl<'a> _PBMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPIXIPW<'a> { - w: &'a mut W, - } - impl<'a> _SPIXIPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _XSPIMW<'a> { - w: &'a mut W, - } - impl<'a> _XSPIMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _GPIO3W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDHCW<'a> { - w: &'a mut W, - } - impl<'a> _SDHCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OWIREW<'a> { - w: &'a mut W, - } - impl<'a> _OWIREW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDT1W<'a> { - w: &'a mut W, - } - impl<'a> _WDT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _QSPI0_AHBW<'a> { - w: &'a mut W, - } - impl<'a> _QSPI0_AHBW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPIXMEMW<'a> { - w: &'a mut W, - } - impl<'a> _SPIXMEMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SMPHRW<'a> { - w: &'a mut W, - } - impl<'a> _SMPHRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDT2W<'a> { - w: &'a mut W, - } - impl<'a> _WDT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BTLEW<'a> { - w: &'a mut W, - } - impl<'a> _BTLEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AUDIOW<'a> { - w: &'a mut W, - } - impl<'a> _AUDIOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _I2C2W<'a> { - w: &'a mut W, - } - impl<'a> _I2C2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HTMR0W<'a> { - w: &'a mut W, - } - impl<'a> _HTMR0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HTMR1W<'a> { - w: &'a mut W, - } - impl<'a> _HTMR1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DVSW<'a> { - w: &'a mut W, - } - impl<'a> _DVSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SIMOW<'a> { - w: &'a mut W, - } - impl<'a> _SIMOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - I2C1 Reset."] - #[inline] - pub fn i2c1(&self) -> I2C1R { - I2C1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - PT Reset."] - #[inline] - pub fn pt(&self) -> PTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PTR { bits } - } - #[doc = "Bit 2 - PBM Reset."] - #[inline] - pub fn pbm(&self) -> PBMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PBMR { bits } - } - #[doc = "Bit 3 - SPI XiP Master Reset."] - #[inline] - pub fn spixip(&self) -> SPIXIPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPIXIPR { bits } - } - #[doc = "Bit 4 - GSPI XiP Master Controller Reset."] - #[inline] - pub fn xspim(&self) -> XSPIMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - XSPIMR { bits } - } - #[doc = "Bit 5 - GPIO3 Reset."] - #[inline] - pub fn gpio3(&self) -> GPIO3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - GPIO3R { bits } - } - #[doc = "Bit 6 - SDHC/SDIO Reset."] - #[inline] - pub fn sdhc(&self) -> SDHCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDHCR { bits } - } - #[doc = "Bit 7 - OWIRE Reset."] - #[inline] - pub fn owire(&self) -> OWIRER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OWIRER { bits } - } - #[doc = "Bit 8 - WDT1 Reset."] - #[inline] - pub fn wdt1(&self) -> WDT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDT1R { bits } - } - #[doc = "Bit 9 - QSPI0_AHB Reset."] - #[inline] - pub fn qspi0_ahb(&self) -> QSPI0_AHBR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - QSPI0_AHBR { bits } - } - #[doc = "Bit 15 - SPIXMEM Reset."] - #[inline] - pub fn spixmem(&self) -> SPIXMEMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPIXMEMR { bits } - } - #[doc = "Bit 16 - SMPHR Reset."] - #[inline] - pub fn smphr(&self) -> SMPHRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SMPHRR { bits } - } - #[doc = "Bit 17 - WDT2 Reset."] - #[inline] - pub fn wdt2(&self) -> WDT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDT2R { bits } - } - #[doc = "Bit 18 - BTLE Reset."] - #[inline] - pub fn btle(&self) -> BTLER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BTLER { bits } - } - #[doc = "Bit 19 - AUDIO Reset."] - #[inline] - pub fn audio(&self) -> AUDIOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AUDIOR { bits } - } - #[doc = "Bit 20 - I2C2 Reset."] - #[inline] - pub fn i2c2(&self) -> I2C2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - I2C2R { bits } - } - #[doc = "Bit 22 - HTMR0 Reset."] - #[inline] - pub fn htmr0(&self) -> HTMR0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HTMR0R { bits } - } - #[doc = "Bit 23 - HTMR1 Reset."] - #[inline] - pub fn htmr1(&self) -> HTMR1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HTMR1R { bits } - } - #[doc = "Bit 24 - DVS Reset."] - #[inline] - pub fn dvs(&self) -> DVSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DVSR { bits } - } - #[doc = "Bit 25 - SIMO Reset."] - #[inline] - pub fn simo(&self) -> SIMOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SIMOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - I2C1 Reset."] - #[inline] - pub fn i2c1(&mut self) -> _I2C1W { - _I2C1W { w: self } - } - #[doc = "Bit 1 - PT Reset."] - #[inline] - pub fn pt(&mut self) -> _PTW { - _PTW { w: self } - } - #[doc = "Bit 2 - PBM Reset."] - #[inline] - pub fn pbm(&mut self) -> _PBMW { - _PBMW { w: self } - } - #[doc = "Bit 3 - SPI XiP Master Reset."] - #[inline] - pub fn spixip(&mut self) -> _SPIXIPW { - _SPIXIPW { w: self } - } - #[doc = "Bit 4 - GSPI XiP Master Controller Reset."] - #[inline] - pub fn xspim(&mut self) -> _XSPIMW { - _XSPIMW { w: self } - } - #[doc = "Bit 5 - GPIO3 Reset."] - #[inline] - pub fn gpio3(&mut self) -> _GPIO3W { - _GPIO3W { w: self } - } - #[doc = "Bit 6 - SDHC/SDIO Reset."] - #[inline] - pub fn sdhc(&mut self) -> _SDHCW { - _SDHCW { w: self } - } - #[doc = "Bit 7 - OWIRE Reset."] - #[inline] - pub fn owire(&mut self) -> _OWIREW { - _OWIREW { w: self } - } - #[doc = "Bit 8 - WDT1 Reset."] - #[inline] - pub fn wdt1(&mut self) -> _WDT1W { - _WDT1W { w: self } - } - #[doc = "Bit 9 - QSPI0_AHB Reset."] - #[inline] - pub fn qspi0_ahb(&mut self) -> _QSPI0_AHBW { - _QSPI0_AHBW { w: self } - } - #[doc = "Bit 15 - SPIXMEM Reset."] - #[inline] - pub fn spixmem(&mut self) -> _SPIXMEMW { - _SPIXMEMW { w: self } - } - #[doc = "Bit 16 - SMPHR Reset."] - #[inline] - pub fn smphr(&mut self) -> _SMPHRW { - _SMPHRW { w: self } - } - #[doc = "Bit 17 - WDT2 Reset."] - #[inline] - pub fn wdt2(&mut self) -> _WDT2W { - _WDT2W { w: self } - } - #[doc = "Bit 18 - BTLE Reset."] - #[inline] - pub fn btle(&mut self) -> _BTLEW { - _BTLEW { w: self } - } - #[doc = "Bit 19 - AUDIO Reset."] - #[inline] - pub fn audio(&mut self) -> _AUDIOW { - _AUDIOW { w: self } - } - #[doc = "Bit 20 - I2C2 Reset."] - #[inline] - pub fn i2c2(&mut self) -> _I2C2W { - _I2C2W { w: self } - } - #[doc = "Bit 22 - HTMR0 Reset."] - #[inline] - pub fn htmr0(&mut self) -> _HTMR0W { - _HTMR0W { w: self } - } - #[doc = "Bit 23 - HTMR1 Reset."] - #[inline] - pub fn htmr1(&mut self) -> _HTMR1W { - _HTMR1W { w: self } - } - #[doc = "Bit 24 - DVS Reset."] - #[inline] - pub fn dvs(&mut self) -> _DVSW { - _DVSW { w: self } - } - #[doc = "Bit 25 - SIMO Reset."] - #[inline] - pub fn simo(&mut self) -> _SIMOW { - _SIMOW { w: self } - } - } - } - #[doc = "Peripheral Clock Disable."] - pub struct PERCKCN1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Peripheral Clock Disable."] - pub mod perckcn1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PERCKCN1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `BTLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BTLEDR { - #[doc = "Enable."] - EN, - #[doc = "Disable."] - DIS, - } - impl BTLEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BTLEDR::EN => false, - BTLEDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BTLEDR { - match value { - false => BTLEDR::EN, - true => BTLEDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BTLEDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BTLEDR::DIS - } - } - #[doc = "Possible values of the field `UART2D`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum UART2DR { - #[doc = "Enable."] - EN, - #[doc = "Disable."] - DIS, - } - impl UART2DR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - UART2DR::EN => false, - UART2DR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> UART2DR { - match value { - false => UART2DR::EN, - true => UART2DR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == UART2DR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == UART2DR::DIS - } - } - #[doc = r" Value of the field"] - pub struct TRNGDR { - bits: bool, - } - impl TRNGDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCACHEDR { - bits: bool, - } - impl SCACHEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDMADR { - bits: bool, - } - impl SDMADR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SMPHRDR { - bits: bool, - } - impl SMPHRDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDHCDR { - bits: bool, - } - impl SDHCDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICACHEXIPDR { - bits: bool, - } - impl ICACHEXIPDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OWIREDR { - bits: bool, - } - impl OWIREDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPI3DR { - bits: bool, - } - impl SPI3DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SPIXIPDDR { - bits: bool, - } - impl SPIXIPDDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMA1R { - bits: bool, - } - impl DMA1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUDIOR { - bits: bool, - } - impl AUDIOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct I2C2R { - bits: bool, - } - impl I2C2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HTMR0R { - bits: bool, - } - impl HTMR0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HTMR1R { - bits: bool, - } - impl HTMR1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WDT0R { - bits: bool, - } - impl WDT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WDT1R { - bits: bool, - } - impl WDT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WDT2R { - bits: bool, - } - impl WDT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU1R { - bits: bool, - } - impl CPU1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `BTLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BTLEDW { - #[doc = "Enable."] - EN, - #[doc = "Disable."] - DIS, - } - impl BTLEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BTLEDW::EN => false, - BTLEDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BTLEDW<'a> { - w: &'a mut W, - } - impl<'a> _BTLEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BTLEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BTLEDW::EN) - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BTLEDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `UART2D`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum UART2DW { - #[doc = "Enable."] - EN, - #[doc = "Disable."] - DIS, - } - impl UART2DW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - UART2DW::EN => false, - UART2DW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _UART2DW<'a> { - w: &'a mut W, - } - impl<'a> _UART2DW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: UART2DW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(UART2DW::EN) - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(UART2DW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TRNGDW<'a> { - w: &'a mut W, - } - impl<'a> _TRNGDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCACHEDW<'a> { - w: &'a mut W, - } - impl<'a> _SCACHEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDMADW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SMPHRDW<'a> { - w: &'a mut W, - } - impl<'a> _SMPHRDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDHCDW<'a> { - w: &'a mut W, - } - impl<'a> _SDHCDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICACHEXIPDW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHEXIPDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OWIREDW<'a> { - w: &'a mut W, - } - impl<'a> _OWIREDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPI3DW<'a> { - w: &'a mut W, - } - impl<'a> _SPI3DW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SPIXIPDDW<'a> { - w: &'a mut W, - } - impl<'a> _SPIXIPDDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMA1W<'a> { - w: &'a mut W, - } - impl<'a> _DMA1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AUDIOW<'a> { - w: &'a mut W, - } - impl<'a> _AUDIOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _I2C2W<'a> { - w: &'a mut W, - } - impl<'a> _I2C2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HTMR0W<'a> { - w: &'a mut W, - } - impl<'a> _HTMR0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HTMR1W<'a> { - w: &'a mut W, - } - impl<'a> _HTMR1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDT0W<'a> { - w: &'a mut W, - } - impl<'a> _WDT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDT1W<'a> { - w: &'a mut W, - } - impl<'a> _WDT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WDT2W<'a> { - w: &'a mut W, - } - impl<'a> _WDT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU1W<'a> { - w: &'a mut W, - } - impl<'a> _CPU1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - BTLE Disable."] - #[inline] - pub fn btled(&self) -> BTLEDR { - BTLEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - UART2 Disable."] - #[inline] - pub fn uart2d(&self) -> UART2DR { - UART2DR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - TRNG Disable."] - #[inline] - pub fn trngd(&self) -> TRNGDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TRNGDR { bits } - } - #[doc = "Bit 7 - System Cache Clock Disable."] - #[inline] - pub fn scached(&self) -> SCACHEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCACHEDR { bits } - } - #[doc = "Bit 8 - SDMA Clock Disable."] - #[inline] - pub fn sdmad(&self) -> SDMADR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDMADR { bits } - } - #[doc = "Bit 9 - Semaphore Clock Disable."] - #[inline] - pub fn smphrd(&self) -> SMPHRDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SMPHRDR { bits } - } - #[doc = "Bit 10 - SDHC/SDIO Clock Disable."] - #[inline] - pub fn sdhcd(&self) -> SDHCDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDHCDR { bits } - } - #[doc = "Bit 12 - ICache XIP Clock Disable."] - #[inline] - pub fn icachexipd(&self) -> ICACHEXIPDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICACHEXIPDR { bits } - } - #[doc = "Bit 13 - One-Wire Clock Disable."] - #[inline] - pub fn owired(&self) -> OWIREDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OWIREDR { bits } - } - #[doc = "Bit 14 - SPI3 Clock Disable."] - #[inline] - pub fn spi3d(&self) -> SPI3DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPI3DR { bits } - } - #[doc = "Bit 20 - SPI-XIP Data Clock Disable"] - #[inline] - pub fn spixipdd(&self) -> SPIXIPDDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SPIXIPDDR { bits } - } - #[doc = "Bit 21 - DMA1 Clock Disable"] - #[inline] - pub fn dma1(&self) -> DMA1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DMA1R { bits } - } - #[doc = "Bit 23 - AUDIO Clock Disable"] - #[inline] - pub fn audio(&self) -> AUDIOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AUDIOR { bits } - } - #[doc = "Bit 24 - I2C 2 Clock Disable"] - #[inline] - pub fn i2c2(&self) -> I2C2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - I2C2R { bits } - } - #[doc = "Bit 25 - HTMR 0 Clock Disable"] - #[inline] - pub fn htmr0(&self) -> HTMR0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HTMR0R { bits } - } - #[doc = "Bit 26 - HTMR 1 Clock Disable"] - #[inline] - pub fn htmr1(&self) -> HTMR1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HTMR1R { bits } - } - #[doc = "Bit 27 - WDT0 Clock Disable"] - #[inline] - pub fn wdt0(&self) -> WDT0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDT0R { bits } - } - #[doc = "Bit 28 - WDT1 Clock Disable"] - #[inline] - pub fn wdt1(&self) -> WDT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDT1R { bits } - } - #[doc = "Bit 29 - WDT2 Clock Disable"] - #[inline] - pub fn wdt2(&self) -> WDT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WDT2R { bits } - } - #[doc = "Bit 31 - CPU1 Clock Disable"] - #[inline] - pub fn cpu1(&self) -> CPU1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU1R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - BTLE Disable."] - #[inline] - pub fn btled(&mut self) -> _BTLEDW { - _BTLEDW { w: self } - } - #[doc = "Bit 1 - UART2 Disable."] - #[inline] - pub fn uart2d(&mut self) -> _UART2DW { - _UART2DW { w: self } - } - #[doc = "Bit 2 - TRNG Disable."] - #[inline] - pub fn trngd(&mut self) -> _TRNGDW { - _TRNGDW { w: self } - } - #[doc = "Bit 7 - System Cache Clock Disable."] - #[inline] - pub fn scached(&mut self) -> _SCACHEDW { - _SCACHEDW { w: self } - } - #[doc = "Bit 8 - SDMA Clock Disable."] - #[inline] - pub fn sdmad(&mut self) -> _SDMADW { - _SDMADW { w: self } - } - #[doc = "Bit 9 - Semaphore Clock Disable."] - #[inline] - pub fn smphrd(&mut self) -> _SMPHRDW { - _SMPHRDW { w: self } - } - #[doc = "Bit 10 - SDHC/SDIO Clock Disable."] - #[inline] - pub fn sdhcd(&mut self) -> _SDHCDW { - _SDHCDW { w: self } - } - #[doc = "Bit 12 - ICache XIP Clock Disable."] - #[inline] - pub fn icachexipd(&mut self) -> _ICACHEXIPDW { - _ICACHEXIPDW { w: self } - } - #[doc = "Bit 13 - One-Wire Clock Disable."] - #[inline] - pub fn owired(&mut self) -> _OWIREDW { - _OWIREDW { w: self } - } - #[doc = "Bit 14 - SPI3 Clock Disable."] - #[inline] - pub fn spi3d(&mut self) -> _SPI3DW { - _SPI3DW { w: self } - } - #[doc = "Bit 20 - SPI-XIP Data Clock Disable"] - #[inline] - pub fn spixipdd(&mut self) -> _SPIXIPDDW { - _SPIXIPDDW { w: self } - } - #[doc = "Bit 21 - DMA1 Clock Disable"] - #[inline] - pub fn dma1(&mut self) -> _DMA1W { - _DMA1W { w: self } - } - #[doc = "Bit 23 - AUDIO Clock Disable"] - #[inline] - pub fn audio(&mut self) -> _AUDIOW { - _AUDIOW { w: self } - } - #[doc = "Bit 24 - I2C 2 Clock Disable"] - #[inline] - pub fn i2c2(&mut self) -> _I2C2W { - _I2C2W { w: self } - } - #[doc = "Bit 25 - HTMR 0 Clock Disable"] - #[inline] - pub fn htmr0(&mut self) -> _HTMR0W { - _HTMR0W { w: self } - } - #[doc = "Bit 26 - HTMR 1 Clock Disable"] - #[inline] - pub fn htmr1(&mut self) -> _HTMR1W { - _HTMR1W { w: self } - } - #[doc = "Bit 27 - WDT0 Clock Disable"] - #[inline] - pub fn wdt0(&mut self) -> _WDT0W { - _WDT0W { w: self } - } - #[doc = "Bit 28 - WDT1 Clock Disable"] - #[inline] - pub fn wdt1(&mut self) -> _WDT1W { - _WDT1W { w: self } - } - #[doc = "Bit 29 - WDT2 Clock Disable"] - #[inline] - pub fn wdt2(&mut self) -> _WDT2W { - _WDT2W { w: self } - } - #[doc = "Bit 31 - CPU1 Clock Disable"] - #[inline] - pub fn cpu1(&mut self) -> _CPU1W { - _CPU1W { w: self } - } - } - } - #[doc = "Event Enable Register."] - pub struct EVTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Event Enable Register."] - pub mod evten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EVTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CPU0DMAEVENTR { - bits: bool, - } - impl CPU0DMAEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU0RXEVENTR { - bits: bool, - } - impl CPU0RXEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU0TXEVENTR { - bits: bool, - } - impl CPU0TXEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU1DMAEVENTR { - bits: bool, - } - impl CPU1DMAEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU1RXEVENTR { - bits: bool, - } - impl CPU1RXEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPU1TXEVENTR { - bits: bool, - } - impl CPU1TXEVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CPU0DMAEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU0DMAEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU0RXEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU0RXEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU0TXEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU0TXEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU1DMAEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU1DMAEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU1RXEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU1RXEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPU1TXEVENTW<'a> { - w: &'a mut W, - } - impl<'a> _CPU1TXEVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Enable DMA event. When this bit is set, a DMA event will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu0dmaevent(&self) -> CPU0DMAEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU0DMAEVENTR { bits } - } - #[doc = "Bit 1 - Enable RXEV pin event. When this bit is set, a logic high of GPIO0\\[24\\] will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu0rxevent(&self) -> CPU0RXEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU0RXEVENTR { bits } - } - #[doc = "Bit 2 - Enable TXEV pin event. When this bit is set, TXEV event from the CPU is output to GPIO\\[25\\]."] - #[inline] - pub fn cpu0txevent(&self) -> CPU0TXEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU0TXEVENTR { bits } - } - #[doc = "Bit 3 - Enable DMA event. When this bit is set, a DMA event will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu1dmaevent(&self) -> CPU1DMAEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU1DMAEVENTR { bits } - } - #[doc = "Bit 4 - Enable RXEV pin event. When this bit is set, a logic high of GPIO0\\[24\\] will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu1rxevent(&self) -> CPU1RXEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU1RXEVENTR { bits } - } - #[doc = "Bit 5 - Enable TXEV pin event. When this bit is set, TXEV event from the CPU is output to GPIO\\[25\\]."] - #[inline] - pub fn cpu1txevent(&self) -> CPU1TXEVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPU1TXEVENTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable DMA event. When this bit is set, a DMA event will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu0dmaevent(&mut self) -> _CPU0DMAEVENTW { - _CPU0DMAEVENTW { w: self } - } - #[doc = "Bit 1 - Enable RXEV pin event. When this bit is set, a logic high of GPIO0\\[24\\] will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu0rxevent(&mut self) -> _CPU0RXEVENTW { - _CPU0RXEVENTW { w: self } - } - #[doc = "Bit 2 - Enable TXEV pin event. When this bit is set, TXEV event from the CPU is output to GPIO\\[25\\]."] - #[inline] - pub fn cpu0txevent(&mut self) -> _CPU0TXEVENTW { - _CPU0TXEVENTW { w: self } - } - #[doc = "Bit 3 - Enable DMA event. When this bit is set, a DMA event will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu1dmaevent(&mut self) -> _CPU1DMAEVENTW { - _CPU1DMAEVENTW { w: self } - } - #[doc = "Bit 4 - Enable RXEV pin event. When this bit is set, a logic high of GPIO0\\[24\\] will cause an RXEV event to wake the CPU from WFE sleep mode."] - #[inline] - pub fn cpu1rxevent(&mut self) -> _CPU1RXEVENTW { - _CPU1RXEVENTW { w: self } - } - #[doc = "Bit 5 - Enable TXEV pin event. When this bit is set, TXEV event from the CPU is output to GPIO\\[25\\]."] - #[inline] - pub fn cpu1txevent(&mut self) -> _CPU1TXEVENTW { - _CPU1TXEVENTW { w: self } - } - } - } - #[doc = "Revision Register."] - pub struct REVISION { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Revision Register."] - pub mod revision { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::REVISION { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct REVISIONR { - bits: u16, - } - impl REVISIONR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Manufacturer Chip Revision."] - #[inline] - pub fn revision(&self) -> REVISIONR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - REVISIONR { bits } - } - } - } - #[doc = "System Status Interrupt Enable Register."] - pub struct SYSSIE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "System Status Interrupt Enable Register."] - pub mod syssie { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SYSSIE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ICEULIE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICEULIER { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl ICEULIER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ICEULIER::DIS => false, - ICEULIER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ICEULIER { - match value { - false => ICEULIER::DIS, - true => ICEULIER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ICEULIER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ICEULIER::EN - } - } - #[doc = r" Value of the field"] - pub struct CIEIER { - bits: bool, - } - impl CIEIER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SCMFIER { - bits: bool, - } - impl SCMFIER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `ICEULIE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICEULIEW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl ICEULIEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ICEULIEW::DIS => false, - ICEULIEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ICEULIEW<'a> { - w: &'a mut W, - } - impl<'a> _ICEULIEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ICEULIEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ICEULIEW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ICEULIEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CIEIEW<'a> { - w: &'a mut W, - } - impl<'a> _CIEIEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCMFIEW<'a> { - w: &'a mut W, - } - impl<'a> _SCMFIEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ARM ICE Unlock Interrupt Enable."] - #[inline] - pub fn iceulie(&self) -> ICEULIER { - ICEULIER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Code Integrity Error Interrupt Enable."] - #[inline] - pub fn cieie(&self) -> CIEIER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CIEIER { bits } - } - #[doc = "Bit 5 - System Cache Memory Fault Interrupt Enable."] - #[inline] - pub fn scmfie(&self) -> SCMFIER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCMFIER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ARM ICE Unlock Interrupt Enable."] - #[inline] - pub fn iceulie(&mut self) -> _ICEULIEW { - _ICEULIEW { w: self } - } - #[doc = "Bit 1 - Code Integrity Error Interrupt Enable."] - #[inline] - pub fn cieie(&mut self) -> _CIEIEW { - _CIEIEW { w: self } - } - #[doc = "Bit 5 - System Cache Memory Fault Interrupt Enable."] - #[inline] - pub fn scmfie(&mut self) -> _SCMFIEW { - _SCMFIEW { w: self } - } - } - } - #[doc = "ECC Error Register"] - pub struct ECCERR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ECC Error Register"] - pub mod eccerr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ECCERR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM0ECCERRR { - bits: bool, - } - impl SYSRAM0ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM1ECCERRR { - bits: bool, - } - impl SYSRAM1ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM2ECCERRR { - bits: bool, - } - impl SYSRAM2ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM3ECCERRR { - bits: bool, - } - impl SYSRAM3ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM4ECCERRR { - bits: bool, - } - impl SYSRAM4ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM5ECCERRR { - bits: bool, - } - impl SYSRAM5ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM6ECCERRR { - bits: bool, - } - impl SYSRAM6ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IC0ECCERRR { - bits: bool, - } - impl IC0ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IC1ECCERRR { - bits: bool, - } - impl IC1ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICXIPECCERRR { - bits: bool, - } - impl ICXIPECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FL0ECCERRR { - bits: bool, - } - impl FL0ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FL1ECCERRR { - bits: bool, - } - impl FL1ECCERRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM0ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM0ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM1ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM1ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM2ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM2ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM3ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM3ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM4ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM4ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM5ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM5ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM6ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM6ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IC0ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _IC0ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IC1ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _IC1ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICXIPECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _ICXIPECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FL0ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _FL0ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FL1ECCERRW<'a> { - w: &'a mut W, - } - impl<'a> _FL1ECCERRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ECC System RAM0 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram0eccerr(&self) -> SYSRAM0ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM0ECCERRR { bits } - } - #[doc = "Bit 1 - ECC System RAM1 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram1eccerr(&self) -> SYSRAM1ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM1ECCERRR { bits } - } - #[doc = "Bit 2 - ECC System RAM2 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram2eccerr(&self) -> SYSRAM2ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM2ECCERRR { bits } - } - #[doc = "Bit 3 - ECC System RAM3 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram3eccerr(&self) -> SYSRAM3ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM3ECCERRR { bits } - } - #[doc = "Bit 4 - ECC System RAM4 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram4eccerr(&self) -> SYSRAM4ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM4ECCERRR { bits } - } - #[doc = "Bit 5 - ECC System RAM5 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram5eccerr(&self) -> SYSRAM5ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM5ECCERRR { bits } - } - #[doc = "Bit 6 - ECC System RAM6 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram6eccerr(&self) -> SYSRAM6ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM6ECCERRR { bits } - } - #[doc = "Bit 8 - ECC Icache0 Error Flag. Write 1 to clear."] - #[inline] - pub fn ic0eccerr(&self) -> IC0ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IC0ECCERRR { bits } - } - #[doc = "Bit 9 - ECC Icache1 Error Flag. Write 1 to clear."] - #[inline] - pub fn ic1eccerr(&self) -> IC1ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IC1ECCERRR { bits } - } - #[doc = "Bit 10 - ECC IcacheXIP Error Flag. Write 1 to clear."] - #[inline] - pub fn icxipeccerr(&self) -> ICXIPECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICXIPECCERRR { bits } - } - #[doc = "Bit 11 - ECC Flash0 Error Flag. Write 1 to clear."] - #[inline] - pub fn fl0eccerr(&self) -> FL0ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FL0ECCERRR { bits } - } - #[doc = "Bit 12 - ECC Flash1 Error Flag. Write 1 to clear."] - #[inline] - pub fn fl1eccerr(&self) -> FL1ECCERRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FL1ECCERRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ECC System RAM0 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram0eccerr(&mut self) -> _SYSRAM0ECCERRW { - _SYSRAM0ECCERRW { w: self } - } - #[doc = "Bit 1 - ECC System RAM1 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram1eccerr(&mut self) -> _SYSRAM1ECCERRW { - _SYSRAM1ECCERRW { w: self } - } - #[doc = "Bit 2 - ECC System RAM2 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram2eccerr(&mut self) -> _SYSRAM2ECCERRW { - _SYSRAM2ECCERRW { w: self } - } - #[doc = "Bit 3 - ECC System RAM3 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram3eccerr(&mut self) -> _SYSRAM3ECCERRW { - _SYSRAM3ECCERRW { w: self } - } - #[doc = "Bit 4 - ECC System RAM4 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram4eccerr(&mut self) -> _SYSRAM4ECCERRW { - _SYSRAM4ECCERRW { w: self } - } - #[doc = "Bit 5 - ECC System RAM5 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram5eccerr(&mut self) -> _SYSRAM5ECCERRW { - _SYSRAM5ECCERRW { w: self } - } - #[doc = "Bit 6 - ECC System RAM6 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram6eccerr(&mut self) -> _SYSRAM6ECCERRW { - _SYSRAM6ECCERRW { w: self } - } - #[doc = "Bit 8 - ECC Icache0 Error Flag. Write 1 to clear."] - #[inline] - pub fn ic0eccerr(&mut self) -> _IC0ECCERRW { - _IC0ECCERRW { w: self } - } - #[doc = "Bit 9 - ECC Icache1 Error Flag. Write 1 to clear."] - #[inline] - pub fn ic1eccerr(&mut self) -> _IC1ECCERRW { - _IC1ECCERRW { w: self } - } - #[doc = "Bit 10 - ECC IcacheXIP Error Flag. Write 1 to clear."] - #[inline] - pub fn icxipeccerr(&mut self) -> _ICXIPECCERRW { - _ICXIPECCERRW { w: self } - } - #[doc = "Bit 11 - ECC Flash0 Error Flag. Write 1 to clear."] - #[inline] - pub fn fl0eccerr(&mut self) -> _FL0ECCERRW { - _FL0ECCERRW { w: self } - } - #[doc = "Bit 12 - ECC Flash1 Error Flag. Write 1 to clear."] - #[inline] - pub fn fl1eccerr(&mut self) -> _FL1ECCERRW { - _FL1ECCERRW { w: self } - } - } - } - #[doc = "ECC Not Double Error Detect Register"] - pub struct ECCNDED { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ECC Not Double Error Detect Register"] - pub mod eccnded { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ECCNDED { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM0ECCNDEDR { - bits: bool, - } - impl SYSRAM0ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM1ECCNDEDR { - bits: bool, - } - impl SYSRAM1ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM2ECCNDEDR { - bits: bool, - } - impl SYSRAM2ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM3ECCNDEDR { - bits: bool, - } - impl SYSRAM3ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM4ECCNDEDR { - bits: bool, - } - impl SYSRAM4ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM5ECCNDEDR { - bits: bool, - } - impl SYSRAM5ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SYSRAM6ECCNDEDR { - bits: bool, - } - impl SYSRAM6ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IC0ECCNDEDR { - bits: bool, - } - impl IC0ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IC1ECCNDEDR { - bits: bool, - } - impl IC1ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ICXIPECCNDEDR { - bits: bool, - } - impl ICXIPECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FL0ECCNDEDR { - bits: bool, - } - impl FL0ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FL1ECCNDEDR { - bits: bool, - } - impl FL1ECCNDEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM0ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM0ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM1ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM1ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM2ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM2ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM3ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM3ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM4ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM4ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM5ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM5ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SYSRAM6ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _SYSRAM6ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IC0ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _IC0ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IC1ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _IC1ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ICXIPECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _ICXIPECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FL0ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _FL0ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FL1ECCNDEDW<'a> { - w: &'a mut W, - } - impl<'a> _FL1ECCNDEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - ECC System RAM0 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram0eccnded(&self) -> SYSRAM0ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM0ECCNDEDR { bits } - } - #[doc = "Bit 1 - ECC System RAM1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram1eccnded(&self) -> SYSRAM1ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM1ECCNDEDR { bits } - } - #[doc = "Bit 2 - ECC System RAM2 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram2eccnded(&self) -> SYSRAM2ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM2ECCNDEDR { bits } - } - #[doc = "Bit 3 - ECC System RAM3 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram3eccnded(&self) -> SYSRAM3ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM3ECCNDEDR { bits } - } - #[doc = "Bit 4 - ECC System RAM4 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram4eccnded(&self) -> SYSRAM4ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM4ECCNDEDR { bits } - } - #[doc = "Bit 5 - ECC System RAM5 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram5eccnded(&self) -> SYSRAM5ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM5ECCNDEDR { bits } - } - #[doc = "Bit 6 - ECC System RAM6 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram6eccnded(&self) -> SYSRAM6ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SYSRAM6ECCNDEDR { bits } - } - #[doc = "Bit 8 - ECC Icache0 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn ic0eccnded(&self) -> IC0ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IC0ECCNDEDR { bits } - } - #[doc = "Bit 9 - ECC Icache1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn ic1eccnded(&self) -> IC1ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IC1ECCNDEDR { bits } - } - #[doc = "Bit 10 - ECC IcacheXIP Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn icxipeccnded(&self) -> ICXIPECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ICXIPECCNDEDR { bits } - } - #[doc = "Bit 11 - ECC Flash0 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn fl0eccnded(&self) -> FL0ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FL0ECCNDEDR { bits } - } - #[doc = "Bit 12 - ECC Flash1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn fl1eccnded(&self) -> FL1ECCNDEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FL1ECCNDEDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - ECC System RAM0 Error Flag. Write 1 to clear."] - #[inline] - pub fn sysram0eccnded(&mut self) -> _SYSRAM0ECCNDEDW { - _SYSRAM0ECCNDEDW { w: self } - } - #[doc = "Bit 1 - ECC System RAM1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram1eccnded(&mut self) -> _SYSRAM1ECCNDEDW { - _SYSRAM1ECCNDEDW { w: self } - } - #[doc = "Bit 2 - ECC System RAM2 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram2eccnded(&mut self) -> _SYSRAM2ECCNDEDW { - _SYSRAM2ECCNDEDW { w: self } - } - #[doc = "Bit 3 - ECC System RAM3 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram3eccnded(&mut self) -> _SYSRAM3ECCNDEDW { - _SYSRAM3ECCNDEDW { w: self } - } - #[doc = "Bit 4 - ECC System RAM4 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram4eccnded(&mut self) -> _SYSRAM4ECCNDEDW { - _SYSRAM4ECCNDEDW { w: self } - } - #[doc = "Bit 5 - ECC System RAM5 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram5eccnded(&mut self) -> _SYSRAM5ECCNDEDW { - _SYSRAM5ECCNDEDW { w: self } - } - #[doc = "Bit 6 - ECC System RAM6 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn sysram6eccnded(&mut self) -> _SYSRAM6ECCNDEDW { - _SYSRAM6ECCNDEDW { w: self } - } - #[doc = "Bit 8 - ECC Icache0 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn ic0eccnded(&mut self) -> _IC0ECCNDEDW { - _IC0ECCNDEDW { w: self } - } - #[doc = "Bit 9 - ECC Icache1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn ic1eccnded(&mut self) -> _IC1ECCNDEDW { - _IC1ECCNDEDW { w: self } - } - #[doc = "Bit 10 - ECC IcacheXIP Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn icxipeccnded(&mut self) -> _ICXIPECCNDEDW { - _ICXIPECCNDEDW { w: self } - } - #[doc = "Bit 11 - ECC Flash0 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn fl0eccnded(&mut self) -> _FL0ECCNDEDW { - _FL0ECCNDEDW { w: self } - } - #[doc = "Bit 12 - ECC Flash1 Not Double Error Detect. Write 1 to clear."] - #[inline] - pub fn fl1eccnded(&mut self) -> _FL1ECCNDEDW { - _FL1ECCNDEDW { w: self } - } - } - } - #[doc = "ECC IRQ Enable Register"] - pub struct ECCIRQEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ECC IRQ Enable Register"] - pub mod eccirqen { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ECCIRQEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ECCERADR { - bits: u32, - } - impl ECCERADR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ECCERADW<'a> { - w: &'a mut W, - } - impl<'a> _ECCERADW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:30 - ECC Error Address. This register content the failing address when ecc error occur."] - #[inline] - pub fn eccerad(&self) -> ECCERADR { - let bits = { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ECCERADR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:30 - ECC Error Address. This register content the failing address when ecc error occur."] - #[inline] - pub fn eccerad(&mut self) -> _ECCERADW { - _ECCERADW { w: self } - } - } - } - #[doc = "ECC Error Address Register"] - pub struct ECCERRAD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ECC Error Address Register"] - pub mod eccerrad { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ECCERRAD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ECCERADR { - bits: u32, - } - impl ECCERADR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ECCERADW<'a> { - w: &'a mut W, - } - impl<'a> _ECCERADW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:30 - ECC Error Address. This register content the failing address when ecc error occur."] - #[inline] - pub fn eccerad(&self) -> ECCERADR { - let bits = { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ECCERADR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:30 - ECC Error Address. This register content the failing address when ecc error occur."] - #[inline] - pub fn eccerad(&mut self) -> _ECCERADW { - _ECCERADW { w: self } - } - } - } - #[doc = "BTLE LDO Control Register"] - pub struct BTLELDOCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "BTLE LDO Control Register"] - pub mod btleldocn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BTLELDOCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `LDOWOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWOENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWOENR::DIS => false, - LDOWOENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWOENR { - match value { - false => LDOWOENR::DIS, - true => LDOWOENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWOENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWOENR::EN - } - } - #[doc = "Possible values of the field `LDOWOPULLD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOPULLDR { - #[doc = "enabled."] - EN, - #[doc = "disabled."] - DIS, - } - impl LDOWOPULLDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWOPULLDR::EN => false, - LDOWOPULLDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWOPULLDR { - match value { - false => LDOWOPULLDR::EN, - true => LDOWOPULLDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWOPULLDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWOPULLDR::DIS - } - } - #[doc = "Possible values of the field `LDOWOVSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOVSELR { - #[doc = "0.7V"] - _0_7, - #[doc = "0.9V"] - _0_9, - #[doc = "1.1V"] - _1_1, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl LDOWOVSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - LDOWOVSELR::_0_7 => 0, - LDOWOVSELR::_0_9 => 0x01, - LDOWOVSELR::_1_1 => 0x02, - LDOWOVSELR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> LDOWOVSELR { - match value { - 0 => LDOWOVSELR::_0_7, - 1 => LDOWOVSELR::_0_9, - 2 => LDOWOVSELR::_1_1, - i => LDOWOVSELR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0_7`"] - #[inline] - pub fn is_0_7(&self) -> bool { - *self == LDOWOVSELR::_0_7 - } - #[doc = "Checks if the value of the field is `_0_9`"] - #[inline] - pub fn is_0_9(&self) -> bool { - *self == LDOWOVSELR::_0_9 - } - #[doc = "Checks if the value of the field is `_1_1`"] - #[inline] - pub fn is_1_1(&self) -> bool { - *self == LDOWOVSELR::_1_1 - } - } - #[doc = "Possible values of the field `LDOWEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWENR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWENR::DIS => false, - LDOWENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWENR { - match value { - false => LDOWENR::DIS, - true => LDOWENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWENR::EN - } - } - #[doc = "Possible values of the field `LDOWPULLD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWPULLDR { - #[doc = "enabled."] - EN, - #[doc = "disabled."] - DIS, - } - impl LDOWPULLDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWPULLDR::EN => false, - LDOWPULLDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWPULLDR { - match value { - false => LDOWPULLDR::EN, - true => LDOWPULLDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWPULLDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWPULLDR::DIS - } - } - #[doc = "Possible values of the field `LDOWVSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWVSELR { - #[doc = "0.7V"] - _0_7, - #[doc = "0.9V"] - _0_9, - #[doc = "1.1V"] - _1_1, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl LDOWVSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - LDOWVSELR::_0_7 => 0, - LDOWVSELR::_0_9 => 0x01, - LDOWVSELR::_1_1 => 0x02, - LDOWVSELR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> LDOWVSELR { - match value { - 0 => LDOWVSELR::_0_7, - 1 => LDOWVSELR::_0_9, - 2 => LDOWVSELR::_1_1, - i => LDOWVSELR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0_7`"] - #[inline] - pub fn is_0_7(&self) -> bool { - *self == LDOWVSELR::_0_7 - } - #[doc = "Checks if the value of the field is `_0_9`"] - #[inline] - pub fn is_0_9(&self) -> bool { - *self == LDOWVSELR::_0_9 - } - #[doc = "Checks if the value of the field is `_1_1`"] - #[inline] - pub fn is_1_1(&self) -> bool { - *self == LDOWVSELR::_1_1 - } - } - #[doc = "Possible values of the field `LDOBYP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOBYPR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOBYPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOBYPR::DIS => false, - LDOBYPR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOBYPR { - match value { - false => LDOBYPR::DIS, - true => LDOBYPR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOBYPR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOBYPR::EN - } - } - #[doc = "Possible values of the field `LDOWDISCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWDISCHR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWDISCHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWDISCHR::DIS => false, - LDOWDISCHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWDISCHR { - match value { - false => LDOWDISCHR::DIS, - true => LDOWDISCHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWDISCHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWDISCHR::EN - } - } - #[doc = "Possible values of the field `LDOWOENDLY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOENDLYR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWOENDLYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWOENDLYR::DIS => false, - LDOWOENDLYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWOENDLYR { - match value { - false => LDOWOENDLYR::DIS, - true => LDOWOENDLYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWOENDLYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWOENDLYR::EN - } - } - #[doc = "Possible values of the field `LDOWENDLY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWENDLYR { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWENDLYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LDOWENDLYR::DIS => false, - LDOWENDLYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LDOWENDLYR { - match value { - false => LDOWENDLYR::DIS, - true => LDOWENDLYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LDOWENDLYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == LDOWENDLYR::EN - } - } - #[doc = "Values that can be written to the field `LDOWOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWOENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWOENW::DIS => false, - LDOWOENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWOENW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWOENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWOENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWOENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWOENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWOPULLD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOPULLDW { - #[doc = "enabled."] - EN, - #[doc = "disabled."] - DIS, - } - impl LDOWOPULLDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWOPULLDW::EN => false, - LDOWOPULLDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWOPULLDW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWOPULLDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWOPULLDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWOPULLDW::EN) - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWOPULLDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWOVSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOVSELW { - #[doc = "0.7V"] - _0_7, - #[doc = "0.9V"] - _0_9, - #[doc = "1.1V"] - _1_1, - } - impl LDOWOVSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - LDOWOVSELW::_0_7 => 0, - LDOWOVSELW::_0_9 => 1, - LDOWOVSELW::_1_1 => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWOVSELW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWOVSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWOVSELW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "0.7V"] - #[inline] - pub fn _0_7(self) -> &'a mut W { - self.variant(LDOWOVSELW::_0_7) - } - #[doc = "0.9V"] - #[inline] - pub fn _0_9(self) -> &'a mut W { - self.variant(LDOWOVSELW::_0_9) - } - #[doc = "1.1V"] - #[inline] - pub fn _1_1(self) -> &'a mut W { - self.variant(LDOWOVSELW::_1_1) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWENW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWENW::DIS => false, - LDOWENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWENW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWENW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWPULLD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWPULLDW { - #[doc = "enabled."] - EN, - #[doc = "disabled."] - DIS, - } - impl LDOWPULLDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWPULLDW::EN => false, - LDOWPULLDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWPULLDW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWPULLDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWPULLDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWPULLDW::EN) - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWPULLDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWVSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWVSELW { - #[doc = "0.7V"] - _0_7, - #[doc = "0.9V"] - _0_9, - #[doc = "1.1V"] - _1_1, - } - impl LDOWVSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - LDOWVSELW::_0_7 => 0, - LDOWVSELW::_0_9 => 1, - LDOWVSELW::_1_1 => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWVSELW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWVSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWVSELW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "0.7V"] - #[inline] - pub fn _0_7(self) -> &'a mut W { - self.variant(LDOWVSELW::_0_7) - } - #[doc = "0.9V"] - #[inline] - pub fn _0_9(self) -> &'a mut W { - self.variant(LDOWVSELW::_0_9) - } - #[doc = "1.1V"] - #[inline] - pub fn _1_1(self) -> &'a mut W { - self.variant(LDOWVSELW::_1_1) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOBYP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOBYPW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOBYPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOBYPW::DIS => false, - LDOBYPW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOBYPW<'a> { - w: &'a mut W, - } - impl<'a> _LDOBYPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOBYPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOBYPW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOBYPW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWDISCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWDISCHW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWDISCHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWDISCHW::DIS => false, - LDOWDISCHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWDISCHW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWDISCHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWDISCHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWDISCHW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWDISCHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWOENDLY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWOENDLYW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWOENDLYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWOENDLYW::DIS => false, - LDOWOENDLYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWOENDLYW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWOENDLYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWOENDLYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWOENDLYW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWOENDLYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LDOWENDLY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LDOWENDLYW { - #[doc = "disabled."] - DIS, - #[doc = "enabled."] - EN, - } - impl LDOWENDLYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LDOWENDLYW::DIS => false, - LDOWENDLYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LDOWENDLYW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWENDLYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LDOWENDLYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LDOWENDLYW::DIS) - } - #[doc = "enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(LDOWENDLYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - LDOWO Enable"] - #[inline] - pub fn ldowoen(&self) -> LDOWOENR { - LDOWOENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - LDOWO PULL Disable"] - #[inline] - pub fn ldowopulld(&self) -> LDOWOPULLDR { - LDOWOPULLDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 2:3 - LDOWO Voltage Setting"] - #[inline] - pub fn ldowovsel(&self) -> LDOWOVSELR { - LDOWOVSELR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 4 - LDOW Enable"] - #[inline] - pub fn ldowen(&self) -> LDOWENR { - LDOWENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - LDOW PULL Disable"] - #[inline] - pub fn ldowpulld(&self) -> LDOWPULLDR { - LDOWPULLDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 6:7 - LDOW Voltage Setting"] - #[inline] - pub fn ldowvsel(&self) -> LDOWVSELR { - LDOWVSELR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 8 - LDO Bypass Enable"] - #[inline] - pub fn ldobyp(&self) -> LDOBYPR { - LDOBYPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - LDOW Discharge"] - #[inline] - pub fn ldowdisch(&self) -> LDOWDISCHR { - LDOWDISCHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - LDOWO Enable Delay Status"] - #[inline] - pub fn ldowoendly(&self) -> LDOWOENDLYR { - LDOWOENDLYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - LDOW Enable Delay Status"] - #[inline] - pub fn ldowendly(&self) -> LDOWENDLYR { - LDOWENDLYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - LDOWO Enable"] - #[inline] - pub fn ldowoen(&mut self) -> _LDOWOENW { - _LDOWOENW { w: self } - } - #[doc = "Bit 1 - LDOWO PULL Disable"] - #[inline] - pub fn ldowopulld(&mut self) -> _LDOWOPULLDW { - _LDOWOPULLDW { w: self } - } - #[doc = "Bits 2:3 - LDOWO Voltage Setting"] - #[inline] - pub fn ldowovsel(&mut self) -> _LDOWOVSELW { - _LDOWOVSELW { w: self } - } - #[doc = "Bit 4 - LDOW Enable"] - #[inline] - pub fn ldowen(&mut self) -> _LDOWENW { - _LDOWENW { w: self } - } - #[doc = "Bit 5 - LDOW PULL Disable"] - #[inline] - pub fn ldowpulld(&mut self) -> _LDOWPULLDW { - _LDOWPULLDW { w: self } - } - #[doc = "Bits 6:7 - LDOW Voltage Setting"] - #[inline] - pub fn ldowvsel(&mut self) -> _LDOWVSELW { - _LDOWVSELW { w: self } - } - #[doc = "Bit 8 - LDO Bypass Enable"] - #[inline] - pub fn ldobyp(&mut self) -> _LDOBYPW { - _LDOBYPW { w: self } - } - #[doc = "Bit 9 - LDOW Discharge"] - #[inline] - pub fn ldowdisch(&mut self) -> _LDOWDISCHW { - _LDOWDISCHW { w: self } - } - #[doc = "Bit 12 - LDOWO Enable Delay Status"] - #[inline] - pub fn ldowoendly(&mut self) -> _LDOWOENDLYW { - _LDOWOENDLYW { w: self } - } - #[doc = "Bit 13 - LDOW Enable Delay Status"] - #[inline] - pub fn ldowendly(&mut self) -> _LDOWENDLYW { - _LDOWENDLYW { w: self } - } - } - } - #[doc = "BTLE LDO Delay Register"] - pub struct BTLELDODLY { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "BTLE LDO Delay Register"] - pub mod btleldodly { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BTLELDODLY { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BYPDLYCNTR { - bits: u8, - } - impl BYPDLYCNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct LDOWDLYCNTR { - bits: u16, - } - impl LDOWDLYCNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct LDOWODLYCNTR { - bits: u16, - } - impl LDOWODLYCNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BYPDLYCNTW<'a> { - w: &'a mut W, - } - impl<'a> _BYPDLYCNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LDOWDLYCNTW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWDLYCNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LDOWODLYCNTW<'a> { - w: &'a mut W, - } - impl<'a> _LDOWODLYCNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Bypass Delay Count. Count delay base on PCLK."] - #[inline] - pub fn bypdlycnt(&self) -> BYPDLYCNTR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BYPDLYCNTR { bits } - } - #[doc = "Bits 8:16 - LDOW Delay Count. Count delay base on PCLK/128."] - #[inline] - pub fn ldowdlycnt(&self) -> LDOWDLYCNTR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - LDOWDLYCNTR { bits } - } - #[doc = "Bits 20:28 - LDOWO Delay Count. Count delay base on PCLK/128."] - #[inline] - pub fn ldowodlycnt(&self) -> LDOWODLYCNTR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - LDOWODLYCNTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Bypass Delay Count. Count delay base on PCLK."] - #[inline] - pub fn bypdlycnt(&mut self) -> _BYPDLYCNTW { - _BYPDLYCNTW { w: self } - } - #[doc = "Bits 8:16 - LDOW Delay Count. Count delay base on PCLK/128."] - #[inline] - pub fn ldowdlycnt(&mut self) -> _LDOWDLYCNTW { - _LDOWDLYCNTW { w: self } - } - #[doc = "Bits 20:28 - LDOWO Delay Count. Count delay base on PCLK/128."] - #[inline] - pub fn ldowodlycnt(&mut self) -> _LDOWODLYCNTW { - _LDOWODLYCNTW { w: self } - } - } - } - #[doc = "General Purpose Register 0"] - pub struct GP0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "General Purpose Register 0"] - pub mod gp0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GP0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "APB Asynchronous Bridge Select Register"] - pub struct APBASYNC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "APB Asynchronous Bridge Select Register"] - pub mod apbasync { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::APBASYNC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `APBASYNCI2C0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum APBASYNCI2C0R { - #[doc = "PCLK Source"] - PCLK, - #[doc = "7.37MHz Source"] - _7MCLK, - } - impl APBASYNCI2C0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - APBASYNCI2C0R::PCLK => false, - APBASYNCI2C0R::_7MCLK => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> APBASYNCI2C0R { - match value { - false => APBASYNCI2C0R::PCLK, - true => APBASYNCI2C0R::_7MCLK, - } - } - #[doc = "Checks if the value of the field is `PCLK`"] - #[inline] - pub fn is_pclk(&self) -> bool { - *self == APBASYNCI2C0R::PCLK - } - #[doc = "Checks if the value of the field is `_7MCLK`"] - #[inline] - pub fn is_7mclk(&self) -> bool { - *self == APBASYNCI2C0R::_7MCLK - } - } - #[doc = r" Value of the field"] - pub struct APBASYNCI2C1R { - bits: bool, - } - impl APBASYNCI2C1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct APBASYNCI2C2R { - bits: bool, - } - impl APBASYNCI2C2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct APBASYNCPTR { - bits: bool, - } - impl APBASYNCPTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `APBASYNCI2C0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum APBASYNCI2C0W { - #[doc = "PCLK Source"] - PCLK, - #[doc = "7.37MHz Source"] - _7MCLK, - } - impl APBASYNCI2C0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - APBASYNCI2C0W::PCLK => false, - APBASYNCI2C0W::_7MCLK => true, - } - } - } - #[doc = r" Proxy"] - pub struct _APBASYNCI2C0W<'a> { - w: &'a mut W, - } - impl<'a> _APBASYNCI2C0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: APBASYNCI2C0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "PCLK Source"] - #[inline] - pub fn pclk(self) -> &'a mut W { - self.variant(APBASYNCI2C0W::PCLK) - } - #[doc = "7.37MHz Source"] - #[inline] - pub fn _7mclk(self) -> &'a mut W { - self.variant(APBASYNCI2C0W::_7MCLK) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _APBASYNCI2C1W<'a> { - w: &'a mut W, - } - impl<'a> _APBASYNCI2C1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _APBASYNCI2C2W<'a> { - w: &'a mut W, - } - impl<'a> _APBASYNCI2C2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _APBASYNCPTW<'a> { - w: &'a mut W, - } - impl<'a> _APBASYNCPTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Feeds I2C0 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c0(&self) -> APBASYNCI2C0R { - APBASYNCI2C0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Feeds I2C1 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c1(&self) -> APBASYNCI2C1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - APBASYNCI2C1R { bits } - } - #[doc = "Bit 2 - Feeds I2C2 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c2(&self) -> APBASYNCI2C2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - APBASYNCI2C2R { bits } - } - #[doc = "Bit 3 - Feeds PT with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasyncpt(&self) -> APBASYNCPTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - APBASYNCPTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Feeds I2C0 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c0(&mut self) -> _APBASYNCI2C0W { - _APBASYNCI2C0W { w: self } - } - #[doc = "Bit 1 - Feeds I2C1 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c1(&mut self) -> _APBASYNCI2C1W { - _APBASYNCI2C1W { w: self } - } - #[doc = "Bit 2 - Feeds I2C2 with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasynci2c2(&mut self) -> _APBASYNCI2C2W { - _APBASYNCI2C2W { w: self } - } - #[doc = "Bit 3 - Feeds PT with either PCLK or 7.37MHz Clk"] - #[inline] - pub fn apbasyncpt(&mut self) -> _APBASYNCPTW { - _APBASYNCPTW { w: self } - } - } - } -} -#[doc = "Individual I/O for each GPIO"] -pub struct GPIO0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for GPIO0 {} -impl GPIO0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const gpio0::RegisterBlock { - 0x4000_8000 as *const _ - } -} -impl Deref for GPIO0 { - type Target = gpio0::RegisterBlock; - fn deref(&self) -> &gpio0::RegisterBlock { - unsafe { &*GPIO0::ptr() } - } -} -#[doc = "Individual I/O for each GPIO"] -pub mod gpio0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - GPIO Function Enable Register. Each bit controls the GPIO_EN setting for one GPIO pin on the associated port."] - pub en: EN, - #[doc = "0x04 - GPIO Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN to 1, without affecting other bits in that register."] - pub en_set: EN_SET, - #[doc = "0x08 - GPIO Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN to 0, without affecting other bits in that register."] - pub en_clr: EN_CLR, - #[doc = "0x0c - GPIO Output Enable Register. Each bit controls the GPIO_OUT_EN setting for one GPIO pin in the associated port."] - pub out_en: OUT_EN, - #[doc = "0x10 - GPIO Output Enable Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT_EN to 1, without affecting other bits in that register."] - pub out_en_set: OUT_EN_SET, - #[doc = "0x14 - GPIO Output Enable Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT_EN to 0, without affecting other bits in that register."] - pub out_en_clr: OUT_EN_CLR, - #[doc = "0x18 - GPIO Output Register. Each bit controls the GPIO_OUT setting for one pin in the associated port. This register can be written either directly, or by using the GPIO_OUT_SET and GPIO_OUT_CLR registers."] - pub out: OUT, - #[doc = "0x1c - GPIO Output Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT to 1, without affecting other bits in that register."] - pub out_set: OUT_SET, - #[doc = "0x20 - GPIO Output Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT to 0, without affecting other bits in that register."] - pub out_clr: OUT_CLR, - #[doc = "0x24 - GPIO Input Register. Read-only register to read from the logic states of the GPIO pins on this port."] - pub in_: IN, - #[doc = "0x28 - GPIO Interrupt Mode Register. Each bit in this register controls the interrupt mode setting for the associated GPIO pin on this port."] - pub int_mod: INT_MOD, - #[doc = "0x2c - GPIO Interrupt Polarity Register. Each bit in this register controls the interrupt polarity setting for one GPIO pin in the associated port."] - pub int_pol: INT_POL, - _reserved0: [u8; 4usize], - #[doc = "0x34 - GPIO Interrupt Enable Register. Each bit in this register controls the GPIO interrupt enable for the associated pin on the GPIO port."] - pub int_en: INT_EN, - #[doc = "0x38 - GPIO Interrupt Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_INT_EN to 1, without affecting other bits in that register."] - pub int_en_set: INT_EN_SET, - #[doc = "0x3c - GPIO Interrupt Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_EN to 0, without affecting other bits in that register."] - pub int_en_clr: INT_EN_CLR, - #[doc = "0x40 - GPIO Interrupt Status Register. Each bit in this register contains the pending interrupt status for the associated GPIO pin in this port."] - pub int_stat: INT_STAT, - _reserved1: [u8; 4usize], - #[doc = "0x48 - GPIO Status Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_STAT to 0, without affecting other bits in that register."] - pub int_clr: INT_CLR, - #[doc = "0x4c - GPIO Wake Enable Register. Each bit in this register controls the PMU wakeup enable for the associated GPIO pin in this port."] - pub wake_en: WAKE_EN, - #[doc = "0x50 - GPIO Wake Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_WAKE_EN to 1, without affecting other bits in that register."] - pub wake_en_set: WAKE_EN_SET, - #[doc = "0x54 - GPIO Wake Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_WAKE_EN to 0, without affecting other bits in that register."] - pub wake_en_clr: WAKE_EN_CLR, - _reserved2: [u8; 4usize], - #[doc = "0x5c - GPIO Interrupt Dual Edge Mode Register. Each bit in this register selects dual edge mode for the associated GPIO pin in this port."] - pub int_dual_edge: INT_DUAL_EDGE, - #[doc = "0x60 - GPIO Input Mode Config 1. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub pad_cfg1: PAD_CFG1, - #[doc = "0x64 - GPIO Input Mode Config 2. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub pad_cfg2: PAD_CFG2, - #[doc = "0x68 - GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub en1: EN1, - #[doc = "0x6c - GPIO Alternate Function Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN1 to 1, without affecting other bits in that register."] - pub en1_set: EN1_SET, - #[doc = "0x70 - GPIO Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN1 to 0, without affecting other bits in that register."] - pub en1_clr: EN1_CLR, - #[doc = "0x74 - GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub en2: EN2, - #[doc = "0x78 - GPIO Alternate Function 2 Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN2 to 1, without affecting other bits in that register."] - pub en2_set: EN2_SET, - #[doc = "0x7c - GPIO Wake Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN2 to 0, without affecting other bits in that register."] - pub en2_clr: EN2_CLR, - _reserved3: [u8; 40usize], - #[doc = "0xa8 - Input Hysteresis Enable Register"] - pub is: IS, - #[doc = "0xac - Slew Rate Select Register."] - pub sr: SR, - #[doc = "0xb0 - GPIO Drive Strength Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub ds: DS, - #[doc = "0xb4 - GPIO Drive Strength 1 Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub ds1: DS1, - #[doc = "0xb8 - GPIO Pull Select Mode."] - pub ps: PS, - _reserved4: [u8; 4usize], - #[doc = "0xc0 - GPIO Voltage Select."] - pub vssel: VSSEL, - } - #[doc = "GPIO Function Enable Register. Each bit controls the GPIO_EN setting for one GPIO pin on the associated port."] - pub struct EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Function Enable Register. Each bit controls the GPIO_EN setting for one GPIO pin on the associated port."] - pub mod en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_ENR { - #[doc = "Alternate function enabled."] - ALTERNATE, - #[doc = "GPIO function is enabled."] - GPIO, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_ENR::ALTERNATE => 0, - GPIO_ENR::GPIO => 0x01, - GPIO_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_ENR { - match value { - 0 => GPIO_ENR::ALTERNATE, - 1 => GPIO_ENR::GPIO, - i => GPIO_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `ALTERNATE`"] - #[inline] - pub fn is_alternate(&self) -> bool { - *self == GPIO_ENR::ALTERNATE - } - #[doc = "Checks if the value of the field is `GPIO`"] - #[inline] - pub fn is_gpio(&self) -> bool { - *self == GPIO_ENR::GPIO - } - } - #[doc = "Values that can be written to the field `GPIO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_ENW { - #[doc = "Alternate function enabled."] - ALTERNATE, - #[doc = "GPIO function is enabled."] - GPIO, - } - impl GPIO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_ENW::ALTERNATE => 0, - GPIO_ENW::GPIO => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Alternate function enabled."] - #[inline] - pub fn alternate(self) -> &'a mut W { - self.variant(GPIO_ENW::ALTERNATE) - } - #[doc = "GPIO function is enabled."] - #[inline] - pub fn gpio(self) -> &'a mut W { - self.variant(GPIO_ENW::GPIO) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en(&self) -> GPIO_ENR { - GPIO_ENR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en(&mut self) -> _GPIO_ENW { - _GPIO_ENW { w: self } - } - } - } - #[doc = "GPIO Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN to 1, without affecting other bits in that register."] - pub struct EN_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN to 1, without affecting other bits in that register."] - pub mod en_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN to 0, without affecting other bits in that register."] - pub struct EN_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN to 0, without affecting other bits in that register."] - pub mod en_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Output Enable Register. Each bit controls the GPIO_OUT_EN setting for one GPIO pin in the associated port."] - pub struct OUT_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Enable Register. Each bit controls the GPIO_OUT_EN setting for one GPIO pin in the associated port."] - pub mod out_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_OUT_ENR { - #[doc = "GPIO Output Disable"] - DIS, - #[doc = "GPIO Output Enable"] - EN, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_OUT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_OUT_ENR::DIS => 0, - GPIO_OUT_ENR::EN => 0x01, - GPIO_OUT_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_OUT_ENR { - match value { - 0 => GPIO_OUT_ENR::DIS, - 1 => GPIO_OUT_ENR::EN, - i => GPIO_OUT_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GPIO_OUT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIO_OUT_ENR::EN - } - } - #[doc = "Values that can be written to the field `GPIO_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_OUT_ENW { - #[doc = "GPIO Output Disable"] - DIS, - #[doc = "GPIO Output Enable"] - EN, - } - impl GPIO_OUT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_OUT_ENW::DIS => 0, - GPIO_OUT_ENW::EN => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_OUT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_OUT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_OUT_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "GPIO Output Disable"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GPIO_OUT_ENW::DIS) - } - #[doc = "GPIO Output Enable"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIO_OUT_ENW::EN) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out_en(&self) -> GPIO_OUT_ENR { - GPIO_OUT_ENR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out_en(&mut self) -> _GPIO_OUT_ENW { - _GPIO_OUT_ENW { w: self } - } - } - } - #[doc = "GPIO Output Enable Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT_EN to 1, without affecting other bits in that register."] - pub struct OUT_EN_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Enable Set Function Enable Register. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT_EN to 1, without affecting other bits in that register."] - pub mod out_en_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT_EN_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Output Enable Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT_EN to 0, without affecting other bits in that register."] - pub struct OUT_EN_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Enable Clear Function Enable Register. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT_EN to 0, without affecting other bits in that register."] - pub mod out_en_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT_EN_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Output Register. Each bit controls the GPIO_OUT setting for one pin in the associated port. This register can be written either directly, or by using the GPIO_OUT_SET and GPIO_OUT_CLR registers."] - pub struct OUT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Register. Each bit controls the GPIO_OUT setting for one pin in the associated port. This register can be written either directly, or by using the GPIO_OUT_SET and GPIO_OUT_CLR registers."] - pub mod out { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_OUTR { - #[doc = "Drive Logic 0 (low) on GPIO output."] - LOW, - #[doc = "Drive logic 1 (high) on GPIO output."] - HIGH, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_OUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_OUTR::LOW => 0, - GPIO_OUTR::HIGH => 0x01, - GPIO_OUTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_OUTR { - match value { - 0 => GPIO_OUTR::LOW, - 1 => GPIO_OUTR::HIGH, - i => GPIO_OUTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == GPIO_OUTR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == GPIO_OUTR::HIGH - } - } - #[doc = "Values that can be written to the field `GPIO_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_OUTW { - #[doc = "Drive Logic 0 (low) on GPIO output."] - LOW, - #[doc = "Drive logic 1 (high) on GPIO output."] - HIGH, - } - impl GPIO_OUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_OUTW::LOW => 0, - GPIO_OUTW::HIGH => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_OUTW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_OUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_OUTW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Drive Logic 0 (low) on GPIO output."] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(GPIO_OUTW::LOW) - } - #[doc = "Drive logic 1 (high) on GPIO output."] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(GPIO_OUTW::HIGH) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out(&self) -> GPIO_OUTR { - GPIO_OUTR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out(&mut self) -> _GPIO_OUTW { - _GPIO_OUTW { w: self } - } - } - } - #[doc = "GPIO Output Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT to 1, without affecting other bits in that register."] - pub struct OUT_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_OUT to 1, without affecting other bits in that register."] - pub mod out_set { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT_SET { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = "Values that can be written to the field `GPIO_OUT_SET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_OUT_SETW { - #[doc = "No Effect."] - NO, - #[doc = "Set GPIO_OUT bit in this position to '1'"] - SET, - } - impl GPIO_OUT_SETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_OUT_SETW::NO => 0, - GPIO_OUT_SETW::SET => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_OUT_SETW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_OUT_SETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_OUT_SETW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "No Effect."] - #[inline] - pub fn no(self) -> &'a mut W { - self.variant(GPIO_OUT_SETW::NO) - } - #[doc = "Set GPIO_OUT bit in this position to '1'"] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(GPIO_OUT_SETW::SET) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out_set(&mut self) -> _GPIO_OUT_SETW { - _GPIO_OUT_SETW { w: self } - } - } - } - #[doc = "GPIO Output Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT to 0, without affecting other bits in that register."] - pub struct OUT_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Output Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_OUT to 0, without affecting other bits in that register."] - pub mod out_clr { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OUT_CLR { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _GPIO_OUT_CLRW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_OUT_CLRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_out_clr(&mut self) -> _GPIO_OUT_CLRW { - _GPIO_OUT_CLRW { w: self } - } - } - } - #[doc = "GPIO Input Register. Read-only register to read from the logic states of the GPIO pins on this port."] - pub struct IN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Input Register. Read-only register to read from the logic states of the GPIO pins on this port."] - pub mod in_ { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::IN { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct GPIO_INR { - bits: u32, - } - impl GPIO_INR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_in(&self) -> GPIO_INR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - GPIO_INR { bits } - } - } - } - #[doc = "GPIO Interrupt Mode Register. Each bit in this register controls the interrupt mode setting for the associated GPIO pin on this port."] - pub struct INT_MOD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Mode Register. Each bit in this register controls the interrupt mode setting for the associated GPIO pin on this port."] - pub mod int_mod { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_MOD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_MOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_MODR { - #[doc = "Interrupts for this pin are level triggered."] - LEVEL, - #[doc = "Interrupts for this pin are edge triggered."] - EDGE, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_MODR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_MODR::LEVEL => 0, - GPIO_INT_MODR::EDGE => 0x01, - GPIO_INT_MODR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_MODR { - match value { - 0 => GPIO_INT_MODR::LEVEL, - 1 => GPIO_INT_MODR::EDGE, - i => GPIO_INT_MODR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `LEVEL`"] - #[inline] - pub fn is_level(&self) -> bool { - *self == GPIO_INT_MODR::LEVEL - } - #[doc = "Checks if the value of the field is `EDGE`"] - #[inline] - pub fn is_edge(&self) -> bool { - *self == GPIO_INT_MODR::EDGE - } - } - #[doc = "Values that can be written to the field `GPIO_INT_MOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_MODW { - #[doc = "Interrupts for this pin are level triggered."] - LEVEL, - #[doc = "Interrupts for this pin are edge triggered."] - EDGE, - } - impl GPIO_INT_MODW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_MODW::LEVEL => 0, - GPIO_INT_MODW::EDGE => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_MODW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_MODW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_MODW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Interrupts for this pin are level triggered."] - #[inline] - pub fn level(self) -> &'a mut W { - self.variant(GPIO_INT_MODW::LEVEL) - } - #[doc = "Interrupts for this pin are edge triggered."] - #[inline] - pub fn edge(self) -> &'a mut W { - self.variant(GPIO_INT_MODW::EDGE) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_mod(&self) -> GPIO_INT_MODR { - GPIO_INT_MODR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_mod(&mut self) -> _GPIO_INT_MODW { - _GPIO_INT_MODW { w: self } - } - } - } - #[doc = "GPIO Interrupt Polarity Register. Each bit in this register controls the interrupt polarity setting for one GPIO pin in the associated port."] - pub struct INT_POL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Polarity Register. Each bit in this register controls the interrupt polarity setting for one GPIO pin in the associated port."] - pub mod int_pol { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_POL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_POLR { - #[doc = "Interrupts are latched on a falling edge or low level condition for this pin."] - FALLING, - #[doc = "Interrupts are latched on a rising edge or high condition for this pin."] - RISING, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_POLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_POLR::FALLING => 0, - GPIO_INT_POLR::RISING => 0x01, - GPIO_INT_POLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_POLR { - match value { - 0 => GPIO_INT_POLR::FALLING, - 1 => GPIO_INT_POLR::RISING, - i => GPIO_INT_POLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `FALLING`"] - #[inline] - pub fn is_falling(&self) -> bool { - *self == GPIO_INT_POLR::FALLING - } - #[doc = "Checks if the value of the field is `RISING`"] - #[inline] - pub fn is_rising(&self) -> bool { - *self == GPIO_INT_POLR::RISING - } - } - #[doc = "Values that can be written to the field `GPIO_INT_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_POLW { - #[doc = "Interrupts are latched on a falling edge or low level condition for this pin."] - FALLING, - #[doc = "Interrupts are latched on a rising edge or high condition for this pin."] - RISING, - } - impl GPIO_INT_POLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_POLW::FALLING => 0, - GPIO_INT_POLW::RISING => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_POLW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_POLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_POLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Interrupts are latched on a falling edge or low level condition for this pin."] - #[inline] - pub fn falling(self) -> &'a mut W { - self.variant(GPIO_INT_POLW::FALLING) - } - #[doc = "Interrupts are latched on a rising edge or high condition for this pin."] - #[inline] - pub fn rising(self) -> &'a mut W { - self.variant(GPIO_INT_POLW::RISING) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_pol(&self) -> GPIO_INT_POLR { - GPIO_INT_POLR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_pol(&mut self) -> _GPIO_INT_POLW { - _GPIO_INT_POLW { w: self } - } - } - } - #[doc = "GPIO Interrupt Enable Register. Each bit in this register controls the GPIO interrupt enable for the associated pin on the GPIO port."] - pub struct INT_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Enable Register. Each bit in this register controls the GPIO interrupt enable for the associated pin on the GPIO port."] - pub mod int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_ENR { - #[doc = "Interrupts are disabled for this GPIO pin."] - DIS, - #[doc = "Interrupts are enabled for this GPIO pin."] - EN, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_ENR::DIS => 0, - GPIO_INT_ENR::EN => 0x01, - GPIO_INT_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_ENR { - match value { - 0 => GPIO_INT_ENR::DIS, - 1 => GPIO_INT_ENR::EN, - i => GPIO_INT_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GPIO_INT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIO_INT_ENR::EN - } - } - #[doc = "Values that can be written to the field `GPIO_INT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_ENW { - #[doc = "Interrupts are disabled for this GPIO pin."] - DIS, - #[doc = "Interrupts are enabled for this GPIO pin."] - EN, - } - impl GPIO_INT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_ENW::DIS => 0, - GPIO_INT_ENW::EN => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Interrupts are disabled for this GPIO pin."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GPIO_INT_ENW::DIS) - } - #[doc = "Interrupts are enabled for this GPIO pin."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIO_INT_ENW::EN) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en(&self) -> GPIO_INT_ENR { - GPIO_INT_ENR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en(&mut self) -> _GPIO_INT_ENW { - _GPIO_INT_ENW { w: self } - } - } - } - #[doc = "GPIO Interrupt Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_INT_EN to 1, without affecting other bits in that register."] - pub struct INT_EN_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_INT_EN to 1, without affecting other bits in that register."] - pub mod int_en_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_EN_SET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_EN_SETR { - #[doc = "No effect."] - NO, - #[doc = "Set GPIO_INT_EN bit in this position to '1'"] - SET, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_EN_SETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_EN_SETR::NO => 0, - GPIO_INT_EN_SETR::SET => 0x01, - GPIO_INT_EN_SETR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_EN_SETR { - match value { - 0 => GPIO_INT_EN_SETR::NO, - 1 => GPIO_INT_EN_SETR::SET, - i => GPIO_INT_EN_SETR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == GPIO_INT_EN_SETR::NO - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == GPIO_INT_EN_SETR::SET - } - } - #[doc = "Values that can be written to the field `GPIO_INT_EN_SET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_EN_SETW { - #[doc = "No effect."] - NO, - #[doc = "Set GPIO_INT_EN bit in this position to '1'"] - SET, - } - impl GPIO_INT_EN_SETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_EN_SETW::NO => 0, - GPIO_INT_EN_SETW::SET => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_EN_SETW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_EN_SETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_EN_SETW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "No effect."] - #[inline] - pub fn no(self) -> &'a mut W { - self.variant(GPIO_INT_EN_SETW::NO) - } - #[doc = "Set GPIO_INT_EN bit in this position to '1'"] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(GPIO_INT_EN_SETW::SET) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en_set(&self) -> GPIO_INT_EN_SETR { - GPIO_INT_EN_SETR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en_set(&mut self) -> _GPIO_INT_EN_SETW { - _GPIO_INT_EN_SETW { w: self } - } - } - } - #[doc = "GPIO Interrupt Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_EN to 0, without affecting other bits in that register."] - pub struct INT_EN_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_EN to 0, without affecting other bits in that register."] - pub mod int_en_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_EN_CLR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_EN_CLRR { - #[doc = "No Effect."] - NO, - #[doc = "Clear GPIO_INT_EN bit in this position to '0'"] - CLEAR, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_EN_CLRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_EN_CLRR::NO => 0, - GPIO_INT_EN_CLRR::CLEAR => 0x01, - GPIO_INT_EN_CLRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_EN_CLRR { - match value { - 0 => GPIO_INT_EN_CLRR::NO, - 1 => GPIO_INT_EN_CLRR::CLEAR, - i => GPIO_INT_EN_CLRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == GPIO_INT_EN_CLRR::NO - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == GPIO_INT_EN_CLRR::CLEAR - } - } - #[doc = "Values that can be written to the field `GPIO_INT_EN_CLR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_EN_CLRW { - #[doc = "No Effect."] - NO, - #[doc = "Clear GPIO_INT_EN bit in this position to '0'"] - CLEAR, - } - impl GPIO_INT_EN_CLRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_EN_CLRW::NO => 0, - GPIO_INT_EN_CLRW::CLEAR => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_EN_CLRW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_EN_CLRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_EN_CLRW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "No Effect."] - #[inline] - pub fn no(self) -> &'a mut W { - self.variant(GPIO_INT_EN_CLRW::NO) - } - #[doc = "Clear GPIO_INT_EN bit in this position to '0'"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(GPIO_INT_EN_CLRW::CLEAR) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en_clr(&self) -> GPIO_INT_EN_CLRR { - GPIO_INT_EN_CLRR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_en_clr(&mut self) -> _GPIO_INT_EN_CLRW { - _GPIO_INT_EN_CLRW { w: self } - } - } - } - #[doc = "GPIO Interrupt Status Register. Each bit in this register contains the pending interrupt status for the associated GPIO pin in this port."] - pub struct INT_STAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Status Register. Each bit in this register contains the pending interrupt status for the associated GPIO pin in this port."] - pub mod int_stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::INT_STAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `GPIO_INT_STAT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_STATR { - #[doc = "No Interrupt is pending on this GPIO pin."] - NO, - #[doc = "An Interrupt is pending on this GPIO pin."] - PENDING, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_STATR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_STATR::NO => 0, - GPIO_INT_STATR::PENDING => 0x01, - GPIO_INT_STATR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_STATR { - match value { - 0 => GPIO_INT_STATR::NO, - 1 => GPIO_INT_STATR::PENDING, - i => GPIO_INT_STATR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == GPIO_INT_STATR::NO - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == GPIO_INT_STATR::PENDING - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_stat(&self) -> GPIO_INT_STATR { - GPIO_INT_STATR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - } - #[doc = "GPIO Status Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_STAT to 0, without affecting other bits in that register."] - pub struct INT_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Status Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_INT_STAT to 0, without affecting other bits in that register."] - pub mod int_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Wake Enable Register. Each bit in this register controls the PMU wakeup enable for the associated GPIO pin in this port."] - pub struct WAKE_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Wake Enable Register. Each bit in this register controls the PMU wakeup enable for the associated GPIO pin in this port."] - pub mod wake_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_WAKE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_WAKE_ENR { - #[doc = "PMU wakeup for this GPIO is disabled."] - DIS, - #[doc = "PMU wakeup for this GPIO is enabled."] - EN, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_WAKE_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_WAKE_ENR::DIS => 0, - GPIO_WAKE_ENR::EN => 0x01, - GPIO_WAKE_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_WAKE_ENR { - match value { - 0 => GPIO_WAKE_ENR::DIS, - 1 => GPIO_WAKE_ENR::EN, - i => GPIO_WAKE_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GPIO_WAKE_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIO_WAKE_ENR::EN - } - } - #[doc = "Values that can be written to the field `GPIO_WAKE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_WAKE_ENW { - #[doc = "PMU wakeup for this GPIO is disabled."] - DIS, - #[doc = "PMU wakeup for this GPIO is enabled."] - EN, - } - impl GPIO_WAKE_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_WAKE_ENW::DIS => 0, - GPIO_WAKE_ENW::EN => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_WAKE_ENW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_WAKE_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_WAKE_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "PMU wakeup for this GPIO is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GPIO_WAKE_ENW::DIS) - } - #[doc = "PMU wakeup for this GPIO is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIO_WAKE_ENW::EN) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_wake_en(&self) -> GPIO_WAKE_ENR { - GPIO_WAKE_ENR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_wake_en(&mut self) -> _GPIO_WAKE_ENW { - _GPIO_WAKE_ENW { w: self } - } - } - } - #[doc = "GPIO Wake Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_WAKE_EN to 1, without affecting other bits in that register."] - pub struct WAKE_EN_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Wake Enable Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_WAKE_EN to 1, without affecting other bits in that register."] - pub mod wake_en_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE_EN_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Wake Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_WAKE_EN to 0, without affecting other bits in that register."] - pub struct WAKE_EN_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Wake Enable Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_WAKE_EN to 0, without affecting other bits in that register."] - pub mod wake_en_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE_EN_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Interrupt Dual Edge Mode Register. Each bit in this register selects dual edge mode for the associated GPIO pin in this port."] - pub struct INT_DUAL_EDGE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Interrupt Dual Edge Mode Register. Each bit in this register selects dual edge mode for the associated GPIO pin in this port."] - pub mod int_dual_edge { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_DUAL_EDGE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_INT_DUAL_EDGE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_DUAL_EDGER { - #[doc = "No Effect."] - NO, - #[doc = "Dual Edge mode is enabled. If edge-triggered interrupts are enabled on this GPIO pin, then both rising and falling edges will trigger interrupts regardless of the GPIO_INT_POL setting."] - EN, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_INT_DUAL_EDGER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_INT_DUAL_EDGER::NO => 0, - GPIO_INT_DUAL_EDGER::EN => 0x01, - GPIO_INT_DUAL_EDGER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_INT_DUAL_EDGER { - match value { - 0 => GPIO_INT_DUAL_EDGER::NO, - 1 => GPIO_INT_DUAL_EDGER::EN, - i => GPIO_INT_DUAL_EDGER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == GPIO_INT_DUAL_EDGER::NO - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GPIO_INT_DUAL_EDGER::EN - } - } - #[doc = "Values that can be written to the field `GPIO_INT_DUAL_EDGE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_INT_DUAL_EDGEW { - #[doc = "No Effect."] - NO, - #[doc = "Dual Edge mode is enabled. If edge-triggered interrupts are enabled on this GPIO pin, then both rising and falling edges will trigger interrupts regardless of the GPIO_INT_POL setting."] - EN, - } - impl GPIO_INT_DUAL_EDGEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_INT_DUAL_EDGEW::NO => 0, - GPIO_INT_DUAL_EDGEW::EN => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_INT_DUAL_EDGEW<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_INT_DUAL_EDGEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_INT_DUAL_EDGEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "No Effect."] - #[inline] - pub fn no(self) -> &'a mut W { - self.variant(GPIO_INT_DUAL_EDGEW::NO) - } - #[doc = "Dual Edge mode is enabled. If edge-triggered interrupts are enabled on this GPIO pin, then both rising and falling edges will trigger interrupts regardless of the GPIO_INT_POL setting."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GPIO_INT_DUAL_EDGEW::EN) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_dual_edge(&self) -> GPIO_INT_DUAL_EDGER { - GPIO_INT_DUAL_EDGER::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_int_dual_edge(&mut self) -> _GPIO_INT_DUAL_EDGEW { - _GPIO_INT_DUAL_EDGEW { w: self } - } - } - } - #[doc = "GPIO Input Mode Config 1. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub struct PAD_CFG1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Input Mode Config 1. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub mod pad_cfg1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PAD_CFG1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_PAD_CFG1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_PAD_CFG1R { - #[doc = "High Impedance."] - IMPEDANCE, - #[doc = "Weak pull-up mode."] - PU, - #[doc = "weak pull-down mode."] - PD, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_PAD_CFG1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_PAD_CFG1R::IMPEDANCE => 0, - GPIO_PAD_CFG1R::PU => 0x01, - GPIO_PAD_CFG1R::PD => 0x02, - GPIO_PAD_CFG1R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_PAD_CFG1R { - match value { - 0 => GPIO_PAD_CFG1R::IMPEDANCE, - 1 => GPIO_PAD_CFG1R::PU, - 2 => GPIO_PAD_CFG1R::PD, - i => GPIO_PAD_CFG1R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `IMPEDANCE`"] - #[inline] - pub fn is_impedance(&self) -> bool { - *self == GPIO_PAD_CFG1R::IMPEDANCE - } - #[doc = "Checks if the value of the field is `PU`"] - #[inline] - pub fn is_pu(&self) -> bool { - *self == GPIO_PAD_CFG1R::PU - } - #[doc = "Checks if the value of the field is `PD`"] - #[inline] - pub fn is_pd(&self) -> bool { - *self == GPIO_PAD_CFG1R::PD - } - } - #[doc = "Values that can be written to the field `GPIO_PAD_CFG1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_PAD_CFG1W { - #[doc = "High Impedance."] - IMPEDANCE, - #[doc = "Weak pull-up mode."] - PU, - #[doc = "weak pull-down mode."] - PD, - } - impl GPIO_PAD_CFG1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_PAD_CFG1W::IMPEDANCE => 0, - GPIO_PAD_CFG1W::PU => 1, - GPIO_PAD_CFG1W::PD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_PAD_CFG1W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_PAD_CFG1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_PAD_CFG1W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "High Impedance."] - #[inline] - pub fn impedance(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG1W::IMPEDANCE) - } - #[doc = "Weak pull-up mode."] - #[inline] - pub fn pu(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG1W::PU) - } - #[doc = "weak pull-down mode."] - #[inline] - pub fn pd(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG1W::PD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - The two bits in GPIO_PAD_CFG1 and GPIO_PAD_CFG2 for each GPIO pin work together to determine the pad mode when the GPIO is set to input mode."] - #[inline] - pub fn gpio_pad_cfg1(&self) -> GPIO_PAD_CFG1R { - GPIO_PAD_CFG1R::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - The two bits in GPIO_PAD_CFG1 and GPIO_PAD_CFG2 for each GPIO pin work together to determine the pad mode when the GPIO is set to input mode."] - #[inline] - pub fn gpio_pad_cfg1(&mut self) -> _GPIO_PAD_CFG1W { - _GPIO_PAD_CFG1W { w: self } - } - } - } - #[doc = "GPIO Input Mode Config 2. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub struct PAD_CFG2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Input Mode Config 2. Each bit in this register enables the weak pull-up for the associated GPIO pin in this port."] - pub mod pad_cfg2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PAD_CFG2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_PAD_CFG2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_PAD_CFG2R { - #[doc = "High Impedance."] - IMPEDANCE, - #[doc = "Weak pull-up mode."] - PU, - #[doc = "weak pull-down mode."] - PD, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_PAD_CFG2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_PAD_CFG2R::IMPEDANCE => 0, - GPIO_PAD_CFG2R::PU => 0x01, - GPIO_PAD_CFG2R::PD => 0x02, - GPIO_PAD_CFG2R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_PAD_CFG2R { - match value { - 0 => GPIO_PAD_CFG2R::IMPEDANCE, - 1 => GPIO_PAD_CFG2R::PU, - 2 => GPIO_PAD_CFG2R::PD, - i => GPIO_PAD_CFG2R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `IMPEDANCE`"] - #[inline] - pub fn is_impedance(&self) -> bool { - *self == GPIO_PAD_CFG2R::IMPEDANCE - } - #[doc = "Checks if the value of the field is `PU`"] - #[inline] - pub fn is_pu(&self) -> bool { - *self == GPIO_PAD_CFG2R::PU - } - #[doc = "Checks if the value of the field is `PD`"] - #[inline] - pub fn is_pd(&self) -> bool { - *self == GPIO_PAD_CFG2R::PD - } - } - #[doc = "Values that can be written to the field `GPIO_PAD_CFG2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_PAD_CFG2W { - #[doc = "High Impedance."] - IMPEDANCE, - #[doc = "Weak pull-up mode."] - PU, - #[doc = "weak pull-down mode."] - PD, - } - impl GPIO_PAD_CFG2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_PAD_CFG2W::IMPEDANCE => 0, - GPIO_PAD_CFG2W::PU => 1, - GPIO_PAD_CFG2W::PD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_PAD_CFG2W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_PAD_CFG2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_PAD_CFG2W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "High Impedance."] - #[inline] - pub fn impedance(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG2W::IMPEDANCE) - } - #[doc = "Weak pull-up mode."] - #[inline] - pub fn pu(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG2W::PU) - } - #[doc = "weak pull-down mode."] - #[inline] - pub fn pd(self) -> &'a mut W { - self.variant(GPIO_PAD_CFG2W::PD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - The two bits in GPIO_PAD_CFG1 and GPIO_PAD_CFG2 for each GPIO pin work together to determine the pad mode when the GPIO is set to input mode."] - #[inline] - pub fn gpio_pad_cfg2(&self) -> GPIO_PAD_CFG2R { - GPIO_PAD_CFG2R::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - The two bits in GPIO_PAD_CFG1 and GPIO_PAD_CFG2 for each GPIO pin work together to determine the pad mode when the GPIO is set to input mode."] - #[inline] - pub fn gpio_pad_cfg2(&mut self) -> _GPIO_PAD_CFG2W { - _GPIO_PAD_CFG2W { w: self } - } - } - } - #[doc = "GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub struct EN1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub mod en1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_EN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_EN1R { - #[doc = "Primary function selected."] - PRIMARY, - #[doc = "Secondary function selected."] - SECONDARY, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_EN1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_EN1R::PRIMARY => 0, - GPIO_EN1R::SECONDARY => 0x01, - GPIO_EN1R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_EN1R { - match value { - 0 => GPIO_EN1R::PRIMARY, - 1 => GPIO_EN1R::SECONDARY, - i => GPIO_EN1R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `PRIMARY`"] - #[inline] - pub fn is_primary(&self) -> bool { - *self == GPIO_EN1R::PRIMARY - } - #[doc = "Checks if the value of the field is `SECONDARY`"] - #[inline] - pub fn is_secondary(&self) -> bool { - *self == GPIO_EN1R::SECONDARY - } - } - #[doc = "Values that can be written to the field `GPIO_EN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_EN1W { - #[doc = "Primary function selected."] - PRIMARY, - #[doc = "Secondary function selected."] - SECONDARY, - } - impl GPIO_EN1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_EN1W::PRIMARY => 0, - GPIO_EN1W::SECONDARY => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_EN1W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_EN1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_EN1W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Primary function selected."] - #[inline] - pub fn primary(self) -> &'a mut W { - self.variant(GPIO_EN1W::PRIMARY) - } - #[doc = "Secondary function selected."] - #[inline] - pub fn secondary(self) -> &'a mut W { - self.variant(GPIO_EN1W::SECONDARY) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en1(&self) -> GPIO_EN1R { - GPIO_EN1R::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en1(&mut self) -> _GPIO_EN1W { - _GPIO_EN1W { w: self } - } - } - } - #[doc = "GPIO Alternate Function Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN1 to 1, without affecting other bits in that register."] - pub struct EN1_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Alternate Function Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN1 to 1, without affecting other bits in that register."] - pub mod en1_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN1_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN1 to 0, without affecting other bits in that register."] - pub struct EN1_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN1 to 0, without affecting other bits in that register."] - pub mod en1_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN1_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub struct EN2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Alternate Function Enable Register. Each bit in this register selects between primary/secondary functions for the associated GPIO pin in this port."] - pub mod en2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `GPIO_EN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_EN2R { - #[doc = "Primary function selected."] - PRIMARY, - #[doc = "Secondary function selected."] - SECONDARY, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl GPIO_EN2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - GPIO_EN2R::PRIMARY => 0, - GPIO_EN2R::SECONDARY => 0x01, - GPIO_EN2R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> GPIO_EN2R { - match value { - 0 => GPIO_EN2R::PRIMARY, - 1 => GPIO_EN2R::SECONDARY, - i => GPIO_EN2R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `PRIMARY`"] - #[inline] - pub fn is_primary(&self) -> bool { - *self == GPIO_EN2R::PRIMARY - } - #[doc = "Checks if the value of the field is `SECONDARY`"] - #[inline] - pub fn is_secondary(&self) -> bool { - *self == GPIO_EN2R::SECONDARY - } - } - #[doc = "Values that can be written to the field `GPIO_EN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GPIO_EN2W { - #[doc = "Primary function selected."] - PRIMARY, - #[doc = "Secondary function selected."] - SECONDARY, - } - impl GPIO_EN2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - GPIO_EN2W::PRIMARY => 0, - GPIO_EN2W::SECONDARY => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _GPIO_EN2W<'a> { - w: &'a mut W, - } - impl<'a> _GPIO_EN2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GPIO_EN2W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Primary function selected."] - #[inline] - pub fn primary(self) -> &'a mut W { - self.variant(GPIO_EN2W::PRIMARY) - } - #[doc = "Secondary function selected."] - #[inline] - pub fn secondary(self) -> &'a mut W { - self.variant(GPIO_EN2W::SECONDARY) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en2(&self) -> GPIO_EN2R { - GPIO_EN2R::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn gpio_en2(&mut self) -> _GPIO_EN2W { - _GPIO_EN2W { w: self } - } - } - } - #[doc = "GPIO Alternate Function 2 Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN2 to 1, without affecting other bits in that register."] - pub struct EN2_SET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Alternate Function 2 Set. Writing a 1 to one or more bits in this register sets the bits in the same positions in GPIO_EN2 to 1, without affecting other bits in that register."] - pub mod en2_set { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN2_SET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Wake Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN2 to 0, without affecting other bits in that register."] - pub struct EN2_CLR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Wake Alternate Function Clear. Writing a 1 to one or more bits in this register clears the bits in the same positions in GPIO_EN2 to 0, without affecting other bits in that register."] - pub mod en2_clr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EN2_CLR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "Input Hysteresis Enable Register"] - pub struct IS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Input Hysteresis Enable Register"] - pub mod is { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Slew Rate Select Register."] - pub struct SR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Slew Rate Select Register."] - pub mod sr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "GPIO Drive Strength Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub struct DS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Drive Strength Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub mod ds { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSR { - #[doc = "GPIO port pin is in low-drive mode."] - LD, - #[doc = "GPIO port pin is in high-drive mode."] - HD, - #[doc = r" Reserved"] - _Reserved(u32), - } - impl DSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - match *self { - DSR::LD => 0, - DSR::HD => 0x01, - DSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u32) -> DSR { - match value { - 0 => DSR::LD, - 1 => DSR::HD, - i => DSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `LD`"] - #[inline] - pub fn is_ld(&self) -> bool { - *self == DSR::LD - } - #[doc = "Checks if the value of the field is `HD`"] - #[inline] - pub fn is_hd(&self) -> bool { - *self == DSR::HD - } - } - #[doc = "Values that can be written to the field `DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DSW { - #[doc = "GPIO port pin is in low-drive mode."] - LD, - #[doc = "GPIO port pin is in high-drive mode."] - HD, - } - impl DSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u32 { - match *self { - DSW::LD => 0, - DSW::HD => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _DSW<'a> { - w: &'a mut W, - } - impl<'a> _DSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "GPIO port pin is in low-drive mode."] - #[inline] - pub fn ld(self) -> &'a mut W { - self.variant(DSW::LD) - } - #[doc = "GPIO port pin is in high-drive mode."] - #[inline] - pub fn hd(self) -> &'a mut W { - self.variant(DSW::HD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn ds(&self) -> DSR { - DSR::_from({ - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn ds(&mut self) -> _DSW { - _DSW { w: self } - } - } - } - #[doc = "GPIO Drive Strength 1 Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub struct DS1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Drive Strength 1 Register. Each bit in this register selects the drive strength for the associated GPIO pin in this port. Refer to the Datasheet for sink/source current of GPIO pins in each mode."] - pub mod ds1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DS1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Pull Select Mode."] - pub struct PS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Pull Select Mode."] - pub mod ps { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } - #[doc = "GPIO Voltage Select."] - pub struct VSSEL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO Voltage Select."] - pub mod vssel { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::VSSEL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ALLR { - bits: u32, - } - impl ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ALLW<'a> { - w: &'a mut W, - } - impl<'a> _ALLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&self) -> ALLR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ALLR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Mask of all of the pins on the port."] - #[inline] - pub fn all(&mut self) -> _ALLW { - _ALLW { w: self } - } - } - } -} -#[doc = "Individual I/O for each GPIO 1"] -pub struct GPIO1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for GPIO1 {} -impl GPIO1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const gpio0::RegisterBlock { - 0x4000_9000 as *const _ - } -} -impl Deref for GPIO1 { - type Target = gpio0::RegisterBlock; - fn deref(&self) -> &gpio0::RegisterBlock { - unsafe { &*GPIO1::ptr() } - } -} -#[doc = "Individual I/O for each GPIO 2"] -pub struct GPIO2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for GPIO2 {} -impl GPIO2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const gpio0::RegisterBlock { - 0x4000_a000 as *const _ - } -} -impl Deref for GPIO2 { - type Target = gpio0::RegisterBlock; - fn deref(&self) -> &gpio0::RegisterBlock { - unsafe { &*GPIO2::ptr() } - } -} -#[doc = "High Speed Timer Module."] -pub struct HTMR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for HTMR {} -impl HTMR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const htmr::RegisterBlock { - 0x4001_b000 as *const _ - } -} -impl Deref for HTMR { - type Target = htmr::RegisterBlock; - fn deref(&self) -> &htmr::RegisterBlock { - unsafe { &*HTMR::ptr() } - } -} -#[doc = "High Speed Timer Module."] -pub mod htmr { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - HTimer Long-Interval Counter. This register contains the 32 most significant bits of the counter."] - pub sec: SEC, - #[doc = "0x04 - HTimer Short Interval Counter. This counter ticks ever t_htclk (16.48uS). HTIMER_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub ssec: SSEC, - #[doc = "0x08 - Long Interval Alarm."] - pub ras: RAS, - #[doc = "0x0c - HTimer Short Interval Alarm. This register contains the reload value for the short interval alarm, HTIMER_CTRL.alarm_ss_fl is raised on rollover."] - pub rssa: RSSA, - #[doc = "0x10 - HTimer Control Register."] - pub ctrl: CTRL, - } - #[doc = "HTimer Long-Interval Counter. This register contains the 32 most significant bits of the counter."] - pub struct SEC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer Long-Interval Counter. This register contains the 32 most significant bits of the counter."] - pub mod sec { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SEC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "HTimer Short Interval Counter. This counter ticks ever t_htclk (16.48uS). HTIMER_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub struct SSEC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer Short Interval Counter. This counter ticks ever t_htclk (16.48uS). HTIMER_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub mod ssec { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SSEC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RTSSR { - bits: u8, - } - impl RTSSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RTSSW<'a> { - w: &'a mut W, - } - impl<'a> _RTSSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - HTimer Short Interval Counter."] - #[inline] - pub fn rtss(&self) -> RTSSR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RTSSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - HTimer Short Interval Counter."] - #[inline] - pub fn rtss(&mut self) -> _RTSSW { - _RTSSW { w: self } - } - } - } - #[doc = "Long Interval Alarm."] - pub struct RAS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Long Interval Alarm."] - pub mod ras { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RAS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RASR { - bits: u32, - } - impl RASR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RASW<'a> { - w: &'a mut W, - } - impl<'a> _RASW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x000f_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:19 - HTimer Long Interval Alarm. An Alarm is triggered when this value matches HTIMER_SEC\\[19:0\\]"] - #[inline] - pub fn ras(&self) -> RASR { - let bits = { - const MASK: u32 = 0x000f_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - RASR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:19 - HTimer Long Interval Alarm. An Alarm is triggered when this value matches HTIMER_SEC\\[19:0\\]"] - #[inline] - pub fn ras(&mut self) -> _RASW { - _RASW { w: self } - } - } - } - #[doc = "HTimer Short Interval Alarm. This register contains the reload value for the short interval alarm, HTIMER_CTRL.alarm_ss_fl is raised on rollover."] - pub struct RSSA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer Short Interval Alarm. This register contains the reload value for the short interval alarm, HTIMER_CTRL.alarm_ss_fl is raised on rollover."] - pub mod rssa { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RSSA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RSSAR { - bits: u32, - } - impl RSSAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RSSAW<'a> { - w: &'a mut W, - } - impl<'a> _RSSAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - This register contains the reload value for the short interval alarm."] - #[inline] - pub fn rssa(&self) -> RSSAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - RSSAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - This register contains the reload value for the short interval alarm."] - #[inline] - pub fn rssa(&mut self) -> _RSSAW { - _RSSAW { w: self } - } - } - } - #[doc = "HTimer Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `HTEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HTENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl HTENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HTENR::DIS => false, - HTENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HTENR { - match value { - false => HTENR::DIS, - true => HTENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == HTENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == HTENR::EN - } - } - #[doc = "Possible values of the field `ADE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ADER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADER::DIS => false, - ADER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADER { - match value { - false => ADER::DIS, - true => ADER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ADER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ADER::EN - } - } - #[doc = "Possible values of the field `ASE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ASER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ASER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ASER::DIS => false, - ASER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ASER { - match value { - false => ASER::DIS, - true => ASER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ASER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ASER::EN - } - } - #[doc = "Possible values of the field `BUSY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSYR { - #[doc = "Idle."] - IDLE, - #[doc = "Busy."] - BUSY, - } - impl BUSYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSYR::IDLE => false, - BUSYR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSYR { - match value { - false => BUSYR::IDLE, - true => BUSYR::BUSY, - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == BUSYR::IDLE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == BUSYR::BUSY - } - } - #[doc = "Possible values of the field `RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYR { - #[doc = "Register has not updated."] - BUSY, - #[doc = "Ready."] - READY, - } - impl RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RDYR::BUSY => false, - RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RDYR { - match value { - false => RDYR::BUSY, - true => RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == RDYR::BUSY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == RDYR::READY - } - } - #[doc = "Possible values of the field `RDYE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RDYER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RDYER::DIS => false, - RDYER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RDYER { - match value { - false => RDYER::DIS, - true => RDYER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RDYER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RDYER::EN - } - } - #[doc = "Possible values of the field `ALDF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ALDFR { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl ALDFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ALDFR::INACTIVE => false, - ALDFR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ALDFR { - match value { - false => ALDFR::INACTIVE, - true => ALDFR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ALDFR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ALDFR::PENDING - } - } - #[doc = "Possible values of the field `ALSF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ALSFR { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl ALSFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ALSFR::INACTIVE => false, - ALSFR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ALSFR { - match value { - false => ALSFR::INACTIVE, - true => ALSFR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ALSFR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ALSFR::PENDING - } - } - #[doc = "Possible values of the field `ACRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ACRER { - #[doc = "Not allowed"] - DISABLED, - #[doc = "Allowed"] - ENABLED, - } - impl ACRER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ACRER::DISABLED => false, - ACRER::ENABLED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ACRER { - match value { - false => ACRER::DISABLED, - true => ACRER::ENABLED, - } - } - #[doc = "Checks if the value of the field is `DISABLED`"] - #[inline] - pub fn is_disabled(&self) -> bool { - *self == ACRER::DISABLED - } - #[doc = "Checks if the value of the field is `ENABLED`"] - #[inline] - pub fn is_enabled(&self) -> bool { - *self == ACRER::ENABLED - } - } - #[doc = "Possible values of the field `WE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WER { - #[doc = "Not active"] - DIS, - #[doc = "Active"] - EN, - } - impl WER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WER::DIS => false, - WER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WER { - match value { - false => WER::DIS, - true => WER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == WER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == WER::EN - } - } - #[doc = "Values that can be written to the field `HTEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HTENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl HTENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HTENW::DIS => false, - HTENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HTENW<'a> { - w: &'a mut W, - } - impl<'a> _HTENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HTENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(HTENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(HTENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ADEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADEW::DIS => false, - ADEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADEW<'a> { - w: &'a mut W, - } - impl<'a> _ADEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ADEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ADEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ASE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ASEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ASEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ASEW::DIS => false, - ASEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ASEW<'a> { - w: &'a mut W, - } - impl<'a> _ASEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ASEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ASEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ASEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYW { - #[doc = "Register has not updated."] - BUSY, - #[doc = "Ready."] - READY, - } - impl RDYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RDYW::BUSY => false, - RDYW::READY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RDYW<'a> { - w: &'a mut W, - } - impl<'a> _RDYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RDYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Register has not updated."] - #[inline] - pub fn busy(self) -> &'a mut W { - self.variant(RDYW::BUSY) - } - #[doc = "Ready."] - #[inline] - pub fn ready(self) -> &'a mut W { - self.variant(RDYW::READY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RDYE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RDYEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RDYEW::DIS => false, - RDYEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RDYEW<'a> { - w: &'a mut W, - } - impl<'a> _RDYEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RDYEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RDYEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RDYEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WEW { - #[doc = "Not active"] - DIS, - #[doc = "Active"] - EN, - } - impl WEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WEW::DIS => false, - WEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WEW<'a> { - w: &'a mut W, - } - impl<'a> _WEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not active"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(WEW::DIS) - } - #[doc = "Active"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(WEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - HTimer Enable. This bit enables the Real Time Clock. This bit can only be written when WE=1 and BUSY =0. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn hten(&self) -> HTENR { - HTENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Long Interval Alarm Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ade(&self) -> ADER { - ADER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Short Interval Alarm Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ase(&self) -> ASER { - ASER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - HTimer Busy. This bit is set to 1 by hardware when changes to HTimer registers required a synchronized version of the register to be in place. This bit is automatically cleared by hardware."] - #[inline] - pub fn busy(&self) -> BUSYR { - BUSYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - HTimer Ready. This bit is set to 1 by hardware when the HTimer count registers update. It can be cleared to 0 by software at any time. It will also be cleared to 0 by hardware just prior to an update of the HTimer count register."] - #[inline] - pub fn rdy(&self) -> RDYR { - RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - HTimer Ready Interrupt Enable."] - #[inline] - pub fn rdye(&self) -> RDYER { - RDYER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Long Interval Alarm Interrupt Flag. This alarm is qualified as wake-up source to the processor."] - #[inline] - pub fn aldf(&self) -> ALDFR { - ALDFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Short Interval Alarm Interrupt Flag. This alarm is qualified as wake-up source to the processor."] - #[inline] - pub fn alsf(&self) -> ALSFR { - ALSFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Asynchronous Counter Read Enable, allows direct read access to sec and ssec counters regardless of the ready flag."] - #[inline] - pub fn acre(&self) -> ACRER { - ACRER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Write Enable. This register bit serves as a protection mechanism against unintentional writes to critical HTimer bits."] - #[inline] - pub fn we(&self) -> WER { - WER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x08 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - HTimer Enable. This bit enables the Real Time Clock. This bit can only be written when WE=1 and BUSY =0. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn hten(&mut self) -> _HTENW { - _HTENW { w: self } - } - #[doc = "Bit 1 - Long Interval Alarm Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ade(&mut self) -> _ADEW { - _ADEW { w: self } - } - #[doc = "Bit 2 - Short Interval Alarm Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ase(&mut self) -> _ASEW { - _ASEW { w: self } - } - #[doc = "Bit 4 - HTimer Ready. This bit is set to 1 by hardware when the HTimer count registers update. It can be cleared to 0 by software at any time. It will also be cleared to 0 by hardware just prior to an update of the HTimer count register."] - #[inline] - pub fn rdy(&mut self) -> _RDYW { - _RDYW { w: self } - } - #[doc = "Bit 5 - HTimer Ready Interrupt Enable."] - #[inline] - pub fn rdye(&mut self) -> _RDYEW { - _RDYEW { w: self } - } - #[doc = "Bit 15 - Write Enable. This register bit serves as a protection mechanism against unintentional writes to critical HTimer bits."] - #[inline] - pub fn we(&mut self) -> _WEW { - _WEW { w: self } - } - } - } -} -#[doc = "High Speed Timer Module. 1"] -pub struct HTMR1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for HTMR1 {} -impl HTMR1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const htmr::RegisterBlock { - 0x4001_c000 as *const _ - } -} -impl Deref for HTMR1 { - type Target = htmr::RegisterBlock; - fn deref(&self) -> &htmr::RegisterBlock { - unsafe { &*HTMR1::ptr() } - } -} -#[doc = "Inter-Integrated Circuit."] -pub struct I2C0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for I2C0 {} -impl I2C0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const i2c0::RegisterBlock { - 0x4001_d000 as *const _ - } -} -impl Deref for I2C0 { - type Target = i2c0::RegisterBlock; - fn deref(&self) -> &i2c0::RegisterBlock { - unsafe { &*I2C0::ptr() } - } -} -#[doc = "Inter-Integrated Circuit."] -pub mod i2c0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Control Register0."] - pub ctrl: CTRL, - #[doc = "0x04 - Status Register."] - pub status: STATUS, - #[doc = "0x08 - Interrupt Status Register."] - pub int_fl0: INT_FL0, - #[doc = "0x0c - Interrupt Enable Register."] - pub int_en0: INT_EN0, - #[doc = "0x10 - Interrupt Status Register 1."] - pub int_fl1: INT_FL1, - #[doc = "0x14 - Interrupt Staus Register 1."] - pub int_en1: INT_EN1, - #[doc = "0x18 - FIFO Configuration Register."] - pub fifo_len: FIFO_LEN, - #[doc = "0x1c - Receive Control Register 0."] - pub rx_ctrl0: RX_CTRL0, - #[doc = "0x20 - Receive Control Register 1."] - pub rx_ctrl1: RX_CTRL1, - #[doc = "0x24 - Transmit Control Register 0."] - pub tx_ctrl0: TX_CTRL0, - #[doc = "0x28 - Transmit Control Register 1."] - pub tx_ctrl1: TX_CTRL1, - #[doc = "0x2c - Data Register."] - pub fifo: FIFO, - #[doc = "0x30 - Master Control Register."] - pub master_ctrl: MASTER_CTRL, - #[doc = "0x34 - Clock Low Register."] - pub clk_lo: CLK_LO, - #[doc = "0x38 - Clock high Register."] - pub clk_hi: CLK_HI, - #[doc = "0x3c - HS-Mode Clock Control Register"] - pub hs_clk: HS_CLK, - #[doc = "0x40 - Timeout Register"] - pub timeout: TIMEOUT, - _reserved0: [u8; 4usize], - #[doc = "0x48 - DMA Register."] - pub dma: DMA, - #[doc = "0x4c - Slave Address Register."] - pub slave_addr: SLAVE_ADDR, - } - #[doc = "Control Register0."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Control Register0."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `I2C_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C_ENR { - #[doc = "Disable I2C."] - DIS, - #[doc = "enable I2C."] - EN, - } - impl I2C_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C_ENR::DIS => false, - I2C_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C_ENR { - match value { - false => I2C_ENR::DIS, - true => I2C_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2C_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2C_ENR::EN - } - } - #[doc = "Possible values of the field `MST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MSTR { - #[doc = "Slave Mode."] - SLAVE_MODE, - #[doc = "Master Mode."] - MASTER_MODE, - } - impl MSTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MSTR::SLAVE_MODE => false, - MSTR::MASTER_MODE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MSTR { - match value { - false => MSTR::SLAVE_MODE, - true => MSTR::MASTER_MODE, - } - } - #[doc = "Checks if the value of the field is `SLAVE_MODE`"] - #[inline] - pub fn is_slave_mode(&self) -> bool { - *self == MSTR::SLAVE_MODE - } - #[doc = "Checks if the value of the field is `MASTER_MODE`"] - #[inline] - pub fn is_master_mode(&self) -> bool { - *self == MSTR::MASTER_MODE - } - } - #[doc = "Possible values of the field `GEN_CALL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CALL_ADDRR { - #[doc = "Ignore Gneral Call Address."] - DIS, - #[doc = "Acknowledge general call address."] - EN, - } - impl GEN_CALL_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GEN_CALL_ADDRR::DIS => false, - GEN_CALL_ADDRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GEN_CALL_ADDRR { - match value { - false => GEN_CALL_ADDRR::DIS, - true => GEN_CALL_ADDRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GEN_CALL_ADDRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GEN_CALL_ADDRR::EN - } - } - #[doc = "Possible values of the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODER { - #[doc = "Disable Interactive Receive Mode."] - DIS, - #[doc = "Enable Interactive Receive Mode."] - EN, - } - impl RX_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_MODER::DIS => false, - RX_MODER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_MODER { - match value { - false => RX_MODER::DIS, - true => RX_MODER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_MODER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_MODER::EN - } - } - #[doc = "Possible values of the field `RX_MODE_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODE_ACKR { - #[doc = "return ACK (pulling SDA LOW)."] - ACK, - #[doc = "return NACK (leaving SDA HIGH)."] - NACK, - } - impl RX_MODE_ACKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_MODE_ACKR::ACK => false, - RX_MODE_ACKR::NACK => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_MODE_ACKR { - match value { - false => RX_MODE_ACKR::ACK, - true => RX_MODE_ACKR::NACK, - } - } - #[doc = "Checks if the value of the field is `ACK`"] - #[inline] - pub fn is_ack(&self) -> bool { - *self == RX_MODE_ACKR::ACK - } - #[doc = "Checks if the value of the field is `NACK`"] - #[inline] - pub fn is_nack(&self) -> bool { - *self == RX_MODE_ACKR::NACK - } - } - #[doc = "Possible values of the field `SCL_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_OUTR { - #[doc = "Drive SCL low. "] - DRIVE_SCL_LOW, - #[doc = "Release SCL."] - RELEASE_SCL, - } - impl SCL_OUTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCL_OUTR::DRIVE_SCL_LOW => false, - SCL_OUTR::RELEASE_SCL => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCL_OUTR { - match value { - false => SCL_OUTR::DRIVE_SCL_LOW, - true => SCL_OUTR::RELEASE_SCL, - } - } - #[doc = "Checks if the value of the field is `DRIVE_SCL_LOW`"] - #[inline] - pub fn is_drive_scl_low(&self) -> bool { - *self == SCL_OUTR::DRIVE_SCL_LOW - } - #[doc = "Checks if the value of the field is `RELEASE_SCL`"] - #[inline] - pub fn is_release_scl(&self) -> bool { - *self == SCL_OUTR::RELEASE_SCL - } - } - #[doc = "Possible values of the field `SDA_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDA_OUTR { - #[doc = "Drive SDA low. "] - DRIVE_SDA_LOW, - #[doc = "Release SDA."] - RELEASE_SDA, - } - impl SDA_OUTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDA_OUTR::DRIVE_SDA_LOW => false, - SDA_OUTR::RELEASE_SDA => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDA_OUTR { - match value { - false => SDA_OUTR::DRIVE_SDA_LOW, - true => SDA_OUTR::RELEASE_SDA, - } - } - #[doc = "Checks if the value of the field is `DRIVE_SDA_LOW`"] - #[inline] - pub fn is_drive_sda_low(&self) -> bool { - *self == SDA_OUTR::DRIVE_SDA_LOW - } - #[doc = "Checks if the value of the field is `RELEASE_SDA`"] - #[inline] - pub fn is_release_sda(&self) -> bool { - *self == SDA_OUTR::RELEASE_SDA - } - } - #[doc = r" Value of the field"] - pub struct SCLR { - bits: bool, - } - impl SCLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDAR { - bits: bool, - } - impl SDAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `SW_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SW_OUT_ENR { - #[doc = "I2C Outputs SCLO and SDAO disabled. "] - OUTPUTS_DISABLE, - #[doc = "I2C Outputs SCLO and SDAO enabled."] - OUTPUTS_ENABLE, - } - impl SW_OUT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SW_OUT_ENR::OUTPUTS_DISABLE => false, - SW_OUT_ENR::OUTPUTS_ENABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SW_OUT_ENR { - match value { - false => SW_OUT_ENR::OUTPUTS_DISABLE, - true => SW_OUT_ENR::OUTPUTS_ENABLE, - } - } - #[doc = "Checks if the value of the field is `OUTPUTS_DISABLE`"] - #[inline] - pub fn is_outputs_disable(&self) -> bool { - *self == SW_OUT_ENR::OUTPUTS_DISABLE - } - #[doc = "Checks if the value of the field is `OUTPUTS_ENABLE`"] - #[inline] - pub fn is_outputs_enable(&self) -> bool { - *self == SW_OUT_ENR::OUTPUTS_ENABLE - } - } - #[doc = "Possible values of the field `READ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum READR { - #[doc = "Write."] - WRITE, - #[doc = "Read."] - READ, - } - impl READR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - READR::WRITE => false, - READR::READ => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> READR { - match value { - false => READR::WRITE, - true => READR::READ, - } - } - #[doc = "Checks if the value of the field is `WRITE`"] - #[inline] - pub fn is_write(&self) -> bool { - *self == READR::WRITE - } - #[doc = "Checks if the value of the field is `READ`"] - #[inline] - pub fn is_read(&self) -> bool { - *self == READR::READ - } - } - #[doc = "Possible values of the field `SCL_CLK_STRECH_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_CLK_STRECH_DISR { - #[doc = "Slave clock stretching enabled."] - EN, - #[doc = "Slave clock stretching disabled."] - DIS, - } - impl SCL_CLK_STRECH_DISR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCL_CLK_STRECH_DISR::EN => false, - SCL_CLK_STRECH_DISR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCL_CLK_STRECH_DISR { - match value { - false => SCL_CLK_STRECH_DISR::EN, - true => SCL_CLK_STRECH_DISR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SCL_CLK_STRECH_DISR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SCL_CLK_STRECH_DISR::DIS - } - } - #[doc = "Possible values of the field `SCL_PP_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_PP_MODER { - #[doc = "Standard open-drain operation: drive low for 0, Hi-Z for 1"] - DIS, - #[doc = "Non-standard push-pull operation: drive low for 0, drive high for 1"] - EN, - } - impl SCL_PP_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCL_PP_MODER::DIS => false, - SCL_PP_MODER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCL_PP_MODER { - match value { - false => SCL_PP_MODER::DIS, - true => SCL_PP_MODER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SCL_PP_MODER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SCL_PP_MODER::EN - } - } - #[doc = "Possible values of the field `HS_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HS_MODER { - #[doc = "Hs-mode disabled."] - DIS, - #[doc = "Hs-mode enabled."] - EN, - } - impl HS_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HS_MODER::DIS => false, - HS_MODER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HS_MODER { - match value { - false => HS_MODER::DIS, - true => HS_MODER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == HS_MODER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == HS_MODER::EN - } - } - #[doc = "Values that can be written to the field `I2C_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C_ENW { - #[doc = "Disable I2C."] - DIS, - #[doc = "enable I2C."] - EN, - } - impl I2C_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C_ENW::DIS => false, - I2C_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C_ENW<'a> { - w: &'a mut W, - } - impl<'a> _I2C_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable I2C."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2C_ENW::DIS) - } - #[doc = "enable I2C."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2C_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MSTW { - #[doc = "Slave Mode."] - SLAVE_MODE, - #[doc = "Master Mode."] - MASTER_MODE, - } - impl MSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MSTW::SLAVE_MODE => false, - MSTW::MASTER_MODE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MSTW<'a> { - w: &'a mut W, - } - impl<'a> _MSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MSTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Slave Mode."] - #[inline] - pub fn slave_mode(self) -> &'a mut W { - self.variant(MSTW::SLAVE_MODE) - } - #[doc = "Master Mode."] - #[inline] - pub fn master_mode(self) -> &'a mut W { - self.variant(MSTW::MASTER_MODE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `GEN_CALL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CALL_ADDRW { - #[doc = "Ignore Gneral Call Address."] - DIS, - #[doc = "Acknowledge general call address."] - EN, - } - impl GEN_CALL_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GEN_CALL_ADDRW::DIS => false, - GEN_CALL_ADDRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GEN_CALL_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _GEN_CALL_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GEN_CALL_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Ignore Gneral Call Address."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GEN_CALL_ADDRW::DIS) - } - #[doc = "Acknowledge general call address."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GEN_CALL_ADDRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODEW { - #[doc = "Disable Interactive Receive Mode."] - DIS, - #[doc = "Enable Interactive Receive Mode."] - EN, - } - impl RX_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_MODEW::DIS => false, - RX_MODEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _RX_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Interactive Receive Mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_MODEW::DIS) - } - #[doc = "Enable Interactive Receive Mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_MODEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_MODE_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODE_ACKW { - #[doc = "return ACK (pulling SDA LOW)."] - ACK, - #[doc = "return NACK (leaving SDA HIGH)."] - NACK, - } - impl RX_MODE_ACKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_MODE_ACKW::ACK => false, - RX_MODE_ACKW::NACK => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_MODE_ACKW<'a> { - w: &'a mut W, - } - impl<'a> _RX_MODE_ACKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_MODE_ACKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "return ACK (pulling SDA LOW)."] - #[inline] - pub fn ack(self) -> &'a mut W { - self.variant(RX_MODE_ACKW::ACK) - } - #[doc = "return NACK (leaving SDA HIGH)."] - #[inline] - pub fn nack(self) -> &'a mut W { - self.variant(RX_MODE_ACKW::NACK) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCL_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_OUTW { - #[doc = "Drive SCL low. "] - DRIVE_SCL_LOW, - #[doc = "Release SCL."] - RELEASE_SCL, - } - impl SCL_OUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCL_OUTW::DRIVE_SCL_LOW => false, - SCL_OUTW::RELEASE_SCL => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCL_OUTW<'a> { - w: &'a mut W, - } - impl<'a> _SCL_OUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCL_OUTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Drive SCL low."] - #[inline] - pub fn drive_scl_low(self) -> &'a mut W { - self.variant(SCL_OUTW::DRIVE_SCL_LOW) - } - #[doc = "Release SCL."] - #[inline] - pub fn release_scl(self) -> &'a mut W { - self.variant(SCL_OUTW::RELEASE_SCL) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDA_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDA_OUTW { - #[doc = "Drive SDA low. "] - DRIVE_SDA_LOW, - #[doc = "Release SDA."] - RELEASE_SDA, - } - impl SDA_OUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDA_OUTW::DRIVE_SDA_LOW => false, - SDA_OUTW::RELEASE_SDA => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SDA_OUTW<'a> { - w: &'a mut W, - } - impl<'a> _SDA_OUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDA_OUTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Drive SDA low."] - #[inline] - pub fn drive_sda_low(self) -> &'a mut W { - self.variant(SDA_OUTW::DRIVE_SDA_LOW) - } - #[doc = "Release SDA."] - #[inline] - pub fn release_sda(self) -> &'a mut W { - self.variant(SDA_OUTW::RELEASE_SDA) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SW_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SW_OUT_ENW { - #[doc = "I2C Outputs SCLO and SDAO disabled. "] - OUTPUTS_DISABLE, - #[doc = "I2C Outputs SCLO and SDAO enabled."] - OUTPUTS_ENABLE, - } - impl SW_OUT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SW_OUT_ENW::OUTPUTS_DISABLE => false, - SW_OUT_ENW::OUTPUTS_ENABLE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SW_OUT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _SW_OUT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SW_OUT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "I2C Outputs SCLO and SDAO disabled."] - #[inline] - pub fn outputs_disable(self) -> &'a mut W { - self.variant(SW_OUT_ENW::OUTPUTS_DISABLE) - } - #[doc = "I2C Outputs SCLO and SDAO enabled."] - #[inline] - pub fn outputs_enable(self) -> &'a mut W { - self.variant(SW_OUT_ENW::OUTPUTS_ENABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCL_CLK_STRECH_DIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_CLK_STRECH_DISW { - #[doc = "Slave clock stretching enabled."] - EN, - #[doc = "Slave clock stretching disabled."] - DIS, - } - impl SCL_CLK_STRECH_DISW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCL_CLK_STRECH_DISW::EN => false, - SCL_CLK_STRECH_DISW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCL_CLK_STRECH_DISW<'a> { - w: &'a mut W, - } - impl<'a> _SCL_CLK_STRECH_DISW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCL_CLK_STRECH_DISW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Slave clock stretching enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SCL_CLK_STRECH_DISW::EN) - } - #[doc = "Slave clock stretching disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SCL_CLK_STRECH_DISW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCL_PP_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_PP_MODEW { - #[doc = "Standard open-drain operation: drive low for 0, Hi-Z for 1"] - DIS, - #[doc = "Non-standard push-pull operation: drive low for 0, drive high for 1"] - EN, - } - impl SCL_PP_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCL_PP_MODEW::DIS => false, - SCL_PP_MODEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCL_PP_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _SCL_PP_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCL_PP_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Standard open-drain operation: drive low for 0, Hi-Z for 1"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SCL_PP_MODEW::DIS) - } - #[doc = "Non-standard push-pull operation: drive low for 0, drive high for 1"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SCL_PP_MODEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HS_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HS_MODEW { - #[doc = "Hs-mode disabled."] - DIS, - #[doc = "Hs-mode enabled."] - EN, - } - impl HS_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HS_MODEW::DIS => false, - HS_MODEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HS_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _HS_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HS_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Hs-mode disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(HS_MODEW::DIS) - } - #[doc = "Hs-mode enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(HS_MODEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - I2C Enable."] - #[inline] - pub fn i2c_en(&self) -> I2C_ENR { - I2C_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn mst(&self) -> MSTR { - MSTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - General Call Address Enable."] - #[inline] - pub fn gen_call_addr(&self) -> GEN_CALL_ADDRR { - GEN_CALL_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Interactive Receive Mode."] - #[inline] - pub fn rx_mode(&self) -> RX_MODER { - RX_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Data Acknowledge. This bit defines the acknowledge bit returned by the I2C receiver while IRXM = 1 HW forces ACK to 0 when IRXM = 0."] - #[inline] - pub fn rx_mode_ack(&self) -> RX_MODE_ACKR { - RX_MODE_ACKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - SCL Output. This bits control SCL output when SWOE =1."] - #[inline] - pub fn scl_out(&self) -> SCL_OUTR { - SCL_OUTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - SDA Output. This bits control SDA output when SWOE = 1."] - #[inline] - pub fn sda_out(&self) -> SDA_OUTR { - SDA_OUTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - SCL status. This bit reflects the logic gate of SCL signal."] - #[inline] - pub fn scl(&self) -> SCLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCLR { bits } - } - #[doc = "Bit 9 - SDA status. THis bit reflects the logic gate of SDA signal."] - #[inline] - pub fn sda(&self) -> SDAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDAR { bits } - } - #[doc = "Bit 10 - Software Output Enable."] - #[inline] - pub fn sw_out_en(&self) -> SW_OUT_ENR { - SW_OUT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Read. This bit reflects the R/W bit of an address match (AMI = 1) or general call match(GCI = 1). This bit is valid 3 cycles after the relevant interrupt bit is set."] - #[inline] - pub fn read(&self) -> READR { - READR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - This bit will disable slave clock stretching when set."] - #[inline] - pub fn scl_clk_strech_dis(&self) -> SCL_CLK_STRECH_DISR { - SCL_CLK_STRECH_DISR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - SCL Push-Pull Mode. This bit controls whether SCL is operated in a the I2C standard open-drain mode, or in a non-standard push-pull mode where the Hi-Z output isreplaced with Drive-1. The non-standard mode should only be used when operating as a master and communicating with slaves that are guaranteed to never drive SCL low."] - #[inline] - pub fn scl_pp_mode(&self) -> SCL_PP_MODER { - SCL_PP_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Hs-mode Enable."] - #[inline] - pub fn hs_mode(&self) -> HS_MODER { - HS_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - I2C Enable."] - #[inline] - pub fn i2c_en(&mut self) -> _I2C_ENW { - _I2C_ENW { w: self } - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn mst(&mut self) -> _MSTW { - _MSTW { w: self } - } - #[doc = "Bit 2 - General Call Address Enable."] - #[inline] - pub fn gen_call_addr(&mut self) -> _GEN_CALL_ADDRW { - _GEN_CALL_ADDRW { w: self } - } - #[doc = "Bit 3 - Interactive Receive Mode."] - #[inline] - pub fn rx_mode(&mut self) -> _RX_MODEW { - _RX_MODEW { w: self } - } - #[doc = "Bit 4 - Data Acknowledge. This bit defines the acknowledge bit returned by the I2C receiver while IRXM = 1 HW forces ACK to 0 when IRXM = 0."] - #[inline] - pub fn rx_mode_ack(&mut self) -> _RX_MODE_ACKW { - _RX_MODE_ACKW { w: self } - } - #[doc = "Bit 6 - SCL Output. This bits control SCL output when SWOE =1."] - #[inline] - pub fn scl_out(&mut self) -> _SCL_OUTW { - _SCL_OUTW { w: self } - } - #[doc = "Bit 7 - SDA Output. This bits control SDA output when SWOE = 1."] - #[inline] - pub fn sda_out(&mut self) -> _SDA_OUTW { - _SDA_OUTW { w: self } - } - #[doc = "Bit 10 - Software Output Enable."] - #[inline] - pub fn sw_out_en(&mut self) -> _SW_OUT_ENW { - _SW_OUT_ENW { w: self } - } - #[doc = "Bit 12 - This bit will disable slave clock stretching when set."] - #[inline] - pub fn scl_clk_strech_dis(&mut self) -> _SCL_CLK_STRECH_DISW { - _SCL_CLK_STRECH_DISW { w: self } - } - #[doc = "Bit 13 - SCL Push-Pull Mode. This bit controls whether SCL is operated in a the I2C standard open-drain mode, or in a non-standard push-pull mode where the Hi-Z output isreplaced with Drive-1. The non-standard mode should only be used when operating as a master and communicating with slaves that are guaranteed to never drive SCL low."] - #[inline] - pub fn scl_pp_mode(&mut self) -> _SCL_PP_MODEW { - _SCL_PP_MODEW { w: self } - } - #[doc = "Bit 15 - Hs-mode Enable."] - #[inline] - pub fn hs_mode(&mut self) -> _HS_MODEW { - _HS_MODEW { w: self } - } - } - } - #[doc = "Status Register."] - pub struct STATUS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Status Register."] - pub mod status { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::STATUS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `BUS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSR { - #[doc = "I2C Bus Idle."] - IDLE, - #[doc = "I2C Bus Busy."] - BUSY, - } - impl BUSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSR::IDLE => false, - BUSR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSR { - match value { - false => BUSR::IDLE, - true => BUSR::BUSY, - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == BUSR::IDLE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == BUSR::BUSY - } - } - #[doc = "Possible values of the field `RX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_EMPTYR { - #[doc = "Not Empty."] - NOT_EMPTY, - #[doc = "Empty."] - EMPTY, - } - impl RX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_EMPTYR::NOT_EMPTY => false, - RX_EMPTYR::EMPTY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_EMPTYR { - match value { - false => RX_EMPTYR::NOT_EMPTY, - true => RX_EMPTYR::EMPTY, - } - } - #[doc = "Checks if the value of the field is `NOT_EMPTY`"] - #[inline] - pub fn is_not_empty(&self) -> bool { - *self == RX_EMPTYR::NOT_EMPTY - } - #[doc = "Checks if the value of the field is `EMPTY`"] - #[inline] - pub fn is_empty(&self) -> bool { - *self == RX_EMPTYR::EMPTY - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Not Full."] - NOT_FULL, - #[doc = "Full."] - FULL, - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::NOT_FULL => false, - RX_FULLR::FULL => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - false => RX_FULLR::NOT_FULL, - true => RX_FULLR::FULL, - } - } - #[doc = "Checks if the value of the field is `NOT_FULL`"] - #[inline] - pub fn is_not_full(&self) -> bool { - *self == RX_FULLR::NOT_FULL - } - #[doc = "Checks if the value of the field is `FULL`"] - #[inline] - pub fn is_full(&self) -> bool { - *self == RX_FULLR::FULL - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Not Empty."] - NOT_EMPTY, - #[doc = "Empty."] - EMPTY, - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::NOT_EMPTY => false, - TX_EMPTYR::EMPTY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - false => TX_EMPTYR::NOT_EMPTY, - true => TX_EMPTYR::EMPTY, - } - } - #[doc = "Checks if the value of the field is `NOT_EMPTY`"] - #[inline] - pub fn is_not_empty(&self) -> bool { - *self == TX_EMPTYR::NOT_EMPTY - } - #[doc = "Checks if the value of the field is `EMPTY`"] - #[inline] - pub fn is_empty(&self) -> bool { - *self == TX_EMPTYR::EMPTY - } - } - #[doc = "Possible values of the field `TX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FULLR { - #[doc = "Not Empty."] - NOT_EMPTY, - #[doc = "Empty."] - EMPTY, - } - impl TX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FULLR::NOT_EMPTY => false, - TX_FULLR::EMPTY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FULLR { - match value { - false => TX_FULLR::NOT_EMPTY, - true => TX_FULLR::EMPTY, - } - } - #[doc = "Checks if the value of the field is `NOT_EMPTY`"] - #[inline] - pub fn is_not_empty(&self) -> bool { - *self == TX_FULLR::NOT_EMPTY - } - #[doc = "Checks if the value of the field is `EMPTY`"] - #[inline] - pub fn is_empty(&self) -> bool { - *self == TX_FULLR::EMPTY - } - } - #[doc = "Possible values of the field `CLK_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLK_MODER { - #[doc = "Device not actively driving SCL clock cycles."] - NOT_ACTIVELY_DRIVING_SCL_CLOCK, - #[doc = "Device operating as master and actively driving SCL clock cycles."] - ACTIVELY_DRIVING_SCL_CLOCK, - } - impl CLK_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CLK_MODER::NOT_ACTIVELY_DRIVING_SCL_CLOCK => false, - CLK_MODER::ACTIVELY_DRIVING_SCL_CLOCK => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CLK_MODER { - match value { - false => CLK_MODER::NOT_ACTIVELY_DRIVING_SCL_CLOCK, - true => CLK_MODER::ACTIVELY_DRIVING_SCL_CLOCK, - } - } - #[doc = "Checks if the value of the field is `NOT_ACTIVELY_DRIVING_SCL_CLOCK`"] - #[inline] - pub fn is_not_actively_driving_scl_clock(&self) -> bool { - *self == CLK_MODER::NOT_ACTIVELY_DRIVING_SCL_CLOCK - } - #[doc = "Checks if the value of the field is `ACTIVELY_DRIVING_SCL_CLOCK`"] - #[inline] - pub fn is_actively_driving_scl_clock(&self) -> bool { - *self == CLK_MODER::ACTIVELY_DRIVING_SCL_CLOCK - } - } - #[doc = "Possible values of the field `STATUS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STATUSR { - #[doc = "Controller Idle."] - IDLE, - #[doc = "master Transmit address."] - MTX_ADDR, - #[doc = "Master Receive address ACK."] - MRX_ADDR_ACK, - #[doc = "Master Transmit extended address."] - MTX_EX_ADDR, - #[doc = "Master Receive extended address ACK."] - MRX_EX_ADDR, - #[doc = "Slave Receive address."] - SRX_ADDR, - #[doc = "Slave Transmit address ACK."] - STX_ADDR_ACK, - #[doc = "Slave Receive extended address."] - SRX_EX_ADDR, - #[doc = "Slave Transmit extended address ACK."] - STX_EX_ADDR_ACK, - #[doc = "Transmit data (master or slave)."] - TX, - #[doc = "Receive data ACK (master or slave)."] - RX_ACK, - #[doc = "Receive data (master or slave)."] - RX, - #[doc = "Transmit data ACK (master or slave)."] - TX_ACK, - #[doc = "NACK stage (master or slave)."] - NACK, - #[doc = "Bystander state (ongoing transaction but not participant- another master addressing another slave)."] - BY_ST, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl STATUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - STATUSR::IDLE => 0, - STATUSR::MTX_ADDR => 0x01, - STATUSR::MRX_ADDR_ACK => 0x02, - STATUSR::MTX_EX_ADDR => 0x03, - STATUSR::MRX_EX_ADDR => 0x04, - STATUSR::SRX_ADDR => 0x05, - STATUSR::STX_ADDR_ACK => 0x06, - STATUSR::SRX_EX_ADDR => 0x07, - STATUSR::STX_EX_ADDR_ACK => 0x08, - STATUSR::TX => 0x09, - STATUSR::RX_ACK => 0x0a, - STATUSR::RX => 0x0b, - STATUSR::TX_ACK => 0x0c, - STATUSR::NACK => 0x0d, - STATUSR::BY_ST => 0x0f, - STATUSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> STATUSR { - match value { - 0 => STATUSR::IDLE, - 1 => STATUSR::MTX_ADDR, - 2 => STATUSR::MRX_ADDR_ACK, - 3 => STATUSR::MTX_EX_ADDR, - 4 => STATUSR::MRX_EX_ADDR, - 5 => STATUSR::SRX_ADDR, - 6 => STATUSR::STX_ADDR_ACK, - 7 => STATUSR::SRX_EX_ADDR, - 8 => STATUSR::STX_EX_ADDR_ACK, - 9 => STATUSR::TX, - 10 => STATUSR::RX_ACK, - 11 => STATUSR::RX, - 12 => STATUSR::TX_ACK, - 13 => STATUSR::NACK, - 15 => STATUSR::BY_ST, - i => STATUSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == STATUSR::IDLE - } - #[doc = "Checks if the value of the field is `MTX_ADDR`"] - #[inline] - pub fn is_mtx_addr(&self) -> bool { - *self == STATUSR::MTX_ADDR - } - #[doc = "Checks if the value of the field is `MRX_ADDR_ACK`"] - #[inline] - pub fn is_mrx_addr_ack(&self) -> bool { - *self == STATUSR::MRX_ADDR_ACK - } - #[doc = "Checks if the value of the field is `MTX_EX_ADDR`"] - #[inline] - pub fn is_mtx_ex_addr(&self) -> bool { - *self == STATUSR::MTX_EX_ADDR - } - #[doc = "Checks if the value of the field is `MRX_EX_ADDR`"] - #[inline] - pub fn is_mrx_ex_addr(&self) -> bool { - *self == STATUSR::MRX_EX_ADDR - } - #[doc = "Checks if the value of the field is `SRX_ADDR`"] - #[inline] - pub fn is_srx_addr(&self) -> bool { - *self == STATUSR::SRX_ADDR - } - #[doc = "Checks if the value of the field is `STX_ADDR_ACK`"] - #[inline] - pub fn is_stx_addr_ack(&self) -> bool { - *self == STATUSR::STX_ADDR_ACK - } - #[doc = "Checks if the value of the field is `SRX_EX_ADDR`"] - #[inline] - pub fn is_srx_ex_addr(&self) -> bool { - *self == STATUSR::SRX_EX_ADDR - } - #[doc = "Checks if the value of the field is `STX_EX_ADDR_ACK`"] - #[inline] - pub fn is_stx_ex_addr_ack(&self) -> bool { - *self == STATUSR::STX_EX_ADDR_ACK - } - #[doc = "Checks if the value of the field is `TX`"] - #[inline] - pub fn is_tx(&self) -> bool { - *self == STATUSR::TX - } - #[doc = "Checks if the value of the field is `RX_ACK`"] - #[inline] - pub fn is_rx_ack(&self) -> bool { - *self == STATUSR::RX_ACK - } - #[doc = "Checks if the value of the field is `RX`"] - #[inline] - pub fn is_rx(&self) -> bool { - *self == STATUSR::RX - } - #[doc = "Checks if the value of the field is `TX_ACK`"] - #[inline] - pub fn is_tx_ack(&self) -> bool { - *self == STATUSR::TX_ACK - } - #[doc = "Checks if the value of the field is `NACK`"] - #[inline] - pub fn is_nack(&self) -> bool { - *self == STATUSR::NACK - } - #[doc = "Checks if the value of the field is `BY_ST`"] - #[inline] - pub fn is_by_st(&self) -> bool { - *self == STATUSR::BY_ST - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Not Empty."] - NOT_EMPTY, - #[doc = "Empty."] - EMPTY, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::NOT_EMPTY => false, - TX_EMPTYW::EMPTY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Empty."] - #[inline] - pub fn not_empty(self) -> &'a mut W { - self.variant(TX_EMPTYW::NOT_EMPTY) - } - #[doc = "Empty."] - #[inline] - pub fn empty(self) -> &'a mut W { - self.variant(TX_EMPTYW::EMPTY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FULLW { - #[doc = "Not Empty."] - NOT_EMPTY, - #[doc = "Empty."] - EMPTY, - } - impl TX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FULLW::NOT_EMPTY => false, - TX_FULLW::EMPTY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Empty."] - #[inline] - pub fn not_empty(self) -> &'a mut W { - self.variant(TX_FULLW::NOT_EMPTY) - } - #[doc = "Empty."] - #[inline] - pub fn empty(self) -> &'a mut W { - self.variant(TX_FULLW::EMPTY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STATUS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STATUSW { - #[doc = "Controller Idle."] - IDLE, - #[doc = "master Transmit address."] - MTX_ADDR, - #[doc = "Master Receive address ACK."] - MRX_ADDR_ACK, - #[doc = "Master Transmit extended address."] - MTX_EX_ADDR, - #[doc = "Master Receive extended address ACK."] - MRX_EX_ADDR, - #[doc = "Slave Receive address."] - SRX_ADDR, - #[doc = "Slave Transmit address ACK."] - STX_ADDR_ACK, - #[doc = "Slave Receive extended address."] - SRX_EX_ADDR, - #[doc = "Slave Transmit extended address ACK."] - STX_EX_ADDR_ACK, - #[doc = "Transmit data (master or slave)."] - TX, - #[doc = "Receive data ACK (master or slave)."] - RX_ACK, - #[doc = "Receive data (master or slave)."] - RX, - #[doc = "Transmit data ACK (master or slave)."] - TX_ACK, - #[doc = "NACK stage (master or slave)."] - NACK, - #[doc = "Bystander state (ongoing transaction but not participant- another master addressing another slave)."] - BY_ST, - } - impl STATUSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - STATUSW::IDLE => 0, - STATUSW::MTX_ADDR => 1, - STATUSW::MRX_ADDR_ACK => 2, - STATUSW::MTX_EX_ADDR => 3, - STATUSW::MRX_EX_ADDR => 4, - STATUSW::SRX_ADDR => 5, - STATUSW::STX_ADDR_ACK => 6, - STATUSW::SRX_EX_ADDR => 7, - STATUSW::STX_EX_ADDR_ACK => 8, - STATUSW::TX => 9, - STATUSW::RX_ACK => 10, - STATUSW::RX => 11, - STATUSW::TX_ACK => 12, - STATUSW::NACK => 13, - STATUSW::BY_ST => 15, - } - } - } - #[doc = r" Proxy"] - pub struct _STATUSW<'a> { - w: &'a mut W, - } - impl<'a> _STATUSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STATUSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Controller Idle."] - #[inline] - pub fn idle(self) -> &'a mut W { - self.variant(STATUSW::IDLE) - } - #[doc = "master Transmit address."] - #[inline] - pub fn mtx_addr(self) -> &'a mut W { - self.variant(STATUSW::MTX_ADDR) - } - #[doc = "Master Receive address ACK."] - #[inline] - pub fn mrx_addr_ack(self) -> &'a mut W { - self.variant(STATUSW::MRX_ADDR_ACK) - } - #[doc = "Master Transmit extended address."] - #[inline] - pub fn mtx_ex_addr(self) -> &'a mut W { - self.variant(STATUSW::MTX_EX_ADDR) - } - #[doc = "Master Receive extended address ACK."] - #[inline] - pub fn mrx_ex_addr(self) -> &'a mut W { - self.variant(STATUSW::MRX_EX_ADDR) - } - #[doc = "Slave Receive address."] - #[inline] - pub fn srx_addr(self) -> &'a mut W { - self.variant(STATUSW::SRX_ADDR) - } - #[doc = "Slave Transmit address ACK."] - #[inline] - pub fn stx_addr_ack(self) -> &'a mut W { - self.variant(STATUSW::STX_ADDR_ACK) - } - #[doc = "Slave Receive extended address."] - #[inline] - pub fn srx_ex_addr(self) -> &'a mut W { - self.variant(STATUSW::SRX_EX_ADDR) - } - #[doc = "Slave Transmit extended address ACK."] - #[inline] - pub fn stx_ex_addr_ack(self) -> &'a mut W { - self.variant(STATUSW::STX_EX_ADDR_ACK) - } - #[doc = "Transmit data (master or slave)."] - #[inline] - pub fn tx(self) -> &'a mut W { - self.variant(STATUSW::TX) - } - #[doc = "Receive data ACK (master or slave)."] - #[inline] - pub fn rx_ack(self) -> &'a mut W { - self.variant(STATUSW::RX_ACK) - } - #[doc = "Receive data (master or slave)."] - #[inline] - pub fn rx(self) -> &'a mut W { - self.variant(STATUSW::RX) - } - #[doc = "Transmit data ACK (master or slave)."] - #[inline] - pub fn tx_ack(self) -> &'a mut W { - self.variant(STATUSW::TX_ACK) - } - #[doc = "NACK stage (master or slave)."] - #[inline] - pub fn nack(self) -> &'a mut W { - self.variant(STATUSW::NACK) - } - #[doc = "Bystander state (ongoing transaction but not participant- another master addressing another slave)."] - #[inline] - pub fn by_st(self) -> &'a mut W { - self.variant(STATUSW::BY_ST) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Bus Status."] - #[inline] - pub fn bus(&self) -> BUSR { - BUSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - RX empty."] - #[inline] - pub fn rx_empty(&self) -> RX_EMPTYR { - RX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RX Full."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - TX Empty."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - TX Full."] - #[inline] - pub fn tx_full(&self) -> TX_FULLR { - TX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Clock Mode."] - #[inline] - pub fn clk_mode(&self) -> CLK_MODER { - CLK_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - Controller Status."] - #[inline] - pub fn status(&self) -> STATUSR { - STATUSR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 3 - TX Empty."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 4 - TX Full."] - #[inline] - pub fn tx_full(&mut self) -> _TX_FULLW { - _TX_FULLW { w: self } - } - #[doc = "Bits 8:11 - Controller Status."] - #[inline] - pub fn status(&mut self) -> _STATUSW { - _STATUSW { w: self } - } - } - } - #[doc = "Interrupt Status Register."] - pub struct INT_FL0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Status Register."] - pub mod int_fl0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_FL0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONER { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DONER::INACTIVE => false, - DONER::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DONER { - match value { - false => DONER::INACTIVE, - true => DONER::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == DONER::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == DONER::PENDING - } - } - #[doc = "Possible values of the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODER { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl RX_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_MODER::INACTIVE => false, - RX_MODER::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_MODER { - match value { - false => RX_MODER::INACTIVE, - true => RX_MODER::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == RX_MODER::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == RX_MODER::PENDING - } - } - #[doc = "Possible values of the field `GEN_CALL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CALL_ADDRR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl GEN_CALL_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GEN_CALL_ADDRR::INACTIVE => false, - GEN_CALL_ADDRR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GEN_CALL_ADDRR { - match value { - false => GEN_CALL_ADDRR::INACTIVE, - true => GEN_CALL_ADDRR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == GEN_CALL_ADDRR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == GEN_CALL_ADDRR::PENDING - } - } - #[doc = "Possible values of the field `ADDR_MATCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_MATCHR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_MATCHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_MATCHR::INACTIVE => false, - ADDR_MATCHR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_MATCHR { - match value { - false => ADDR_MATCHR::INACTIVE, - true => ADDR_MATCHR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ADDR_MATCHR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ADDR_MATCHR::PENDING - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. RX_FIFO equal or more bytes than the threshold."] - PENDING, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::INACTIVE => false, - RX_THRESHR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::INACTIVE, - true => RX_THRESHR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == RX_THRESHR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == RX_THRESHR::PENDING - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - PENDING, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::INACTIVE => false, - TX_THRESHR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::INACTIVE, - true => TX_THRESHR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == TX_THRESHR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == TX_THRESHR::PENDING - } - } - #[doc = "Possible values of the field `STOP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - PENDING, - } - impl STOPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STOPR::INACTIVE => false, - STOPR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STOPR { - match value { - false => STOPR::INACTIVE, - true => STOPR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == STOPR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == STOPR::PENDING - } - } - #[doc = "Possible values of the field `ADDR_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ACKR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_ACKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_ACKR::INACTIVE => false, - ADDR_ACKR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_ACKR { - match value { - false => ADDR_ACKR::INACTIVE, - true => ADDR_ACKR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ADDR_ACKR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ADDR_ACKR::PENDING - } - } - #[doc = "Possible values of the field `ARB_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ARB_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ARB_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ARB_ERR::INACTIVE => false, - ARB_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ARB_ERR { - match value { - false => ARB_ERR::INACTIVE, - true => ARB_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ARB_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ARB_ERR::PENDING - } - } - #[doc = "Possible values of the field `TO_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl TO_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TO_ERR::INACTIVE => false, - TO_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TO_ERR { - match value { - false => TO_ERR::INACTIVE, - true => TO_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == TO_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == TO_ERR::PENDING - } - } - #[doc = "Possible values of the field `ADDR_NACK_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_NACK_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_NACK_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_NACK_ERR::INACTIVE => false, - ADDR_NACK_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_NACK_ERR { - match value { - false => ADDR_NACK_ERR::INACTIVE, - true => ADDR_NACK_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ADDR_NACK_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ADDR_NACK_ERR::PENDING - } - } - #[doc = "Possible values of the field `DATA_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DATA_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DATA_ERR::INACTIVE => false, - DATA_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DATA_ERR { - match value { - false => DATA_ERR::INACTIVE, - true => DATA_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == DATA_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == DATA_ERR::PENDING - } - } - #[doc = "Possible values of the field `DO_NOT_RESP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DO_NOT_RESP_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DO_NOT_RESP_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DO_NOT_RESP_ERR::INACTIVE => false, - DO_NOT_RESP_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DO_NOT_RESP_ERR { - match value { - false => DO_NOT_RESP_ERR::INACTIVE, - true => DO_NOT_RESP_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == DO_NOT_RESP_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == DO_NOT_RESP_ERR::PENDING - } - } - #[doc = "Possible values of the field `START_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum START_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl START_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - START_ERR::INACTIVE => false, - START_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> START_ERR { - match value { - false => START_ERR::INACTIVE, - true => START_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == START_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == START_ERR::PENDING - } - } - #[doc = "Possible values of the field `STOP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOP_ERR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl STOP_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STOP_ERR::INACTIVE => false, - STOP_ERR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STOP_ERR { - match value { - false => STOP_ERR::INACTIVE, - true => STOP_ERR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == STOP_ERR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == STOP_ERR::PENDING - } - } - #[doc = r" Value of the field"] - pub struct TX_LOCK_OUTR { - bits: bool, - } - impl TX_LOCK_OUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Values that can be written to the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONEW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DONEW::INACTIVE => false, - DONEW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DONEW<'a> { - w: &'a mut W, - } - impl<'a> _DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(DONEW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(DONEW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODEW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl RX_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_MODEW::INACTIVE => false, - RX_MODEW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _RX_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(RX_MODEW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(RX_MODEW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `GEN_CALL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CALL_ADDRW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl GEN_CALL_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GEN_CALL_ADDRW::INACTIVE => false, - GEN_CALL_ADDRW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GEN_CALL_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _GEN_CALL_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GEN_CALL_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(GEN_CALL_ADDRW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(GEN_CALL_ADDRW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_MATCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_MATCHW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_MATCHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_MATCHW::INACTIVE => false, - ADDR_MATCHW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_MATCHW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_MATCHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_MATCHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(ADDR_MATCHW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(ADDR_MATCHW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. RX_FIFO equal or more bytes than the threshold."] - PENDING, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::INACTIVE => false, - RX_THRESHW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No interrupt is pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(RX_THRESHW::INACTIVE) - } - #[doc = "An interrupt is pending. RX_FIFO equal or more bytes than the threshold."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(RX_THRESHW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - PENDING, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::INACTIVE => false, - TX_THRESHW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No interrupt is pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(TX_THRESHW::INACTIVE) - } - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(TX_THRESHW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STOP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPW { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - PENDING, - } - impl STOPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STOPW::INACTIVE => false, - STOPW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STOPW<'a> { - w: &'a mut W, - } - impl<'a> _STOPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STOPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No interrupt is pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(STOPW::INACTIVE) - } - #[doc = "An interrupt is pending. TX_FIFO has equal or less bytes than the threshold."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(STOPW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ACKW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_ACKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_ACKW::INACTIVE => false, - ADDR_ACKW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_ACKW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_ACKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_ACKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(ADDR_ACKW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(ADDR_ACKW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ARB_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ARB_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ARB_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ARB_ERW::INACTIVE => false, - ARB_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ARB_ERW<'a> { - w: &'a mut W, - } - impl<'a> _ARB_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ARB_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(ARB_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(ARB_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TO_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl TO_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TO_ERW::INACTIVE => false, - TO_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TO_ERW<'a> { - w: &'a mut W, - } - impl<'a> _TO_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TO_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(TO_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(TO_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_NACK_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_NACK_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl ADDR_NACK_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_NACK_ERW::INACTIVE => false, - ADDR_NACK_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_NACK_ERW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_NACK_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_NACK_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(ADDR_NACK_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(ADDR_NACK_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DATA_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DATA_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DATA_ERW::INACTIVE => false, - DATA_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DATA_ERW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DATA_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(DATA_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(DATA_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DO_NOT_RESP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DO_NOT_RESP_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl DO_NOT_RESP_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DO_NOT_RESP_ERW::INACTIVE => false, - DO_NOT_RESP_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DO_NOT_RESP_ERW<'a> { - w: &'a mut W, - } - impl<'a> _DO_NOT_RESP_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DO_NOT_RESP_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(DO_NOT_RESP_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(DO_NOT_RESP_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `START_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum START_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl START_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - START_ERW::INACTIVE => false, - START_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _START_ERW<'a> { - w: &'a mut W, - } - impl<'a> _START_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: START_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(START_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(START_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STOP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOP_ERW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl STOP_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STOP_ERW::INACTIVE => false, - STOP_ERW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STOP_ERW<'a> { - w: &'a mut W, - } - impl<'a> _STOP_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STOP_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(STOP_ERW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(STOP_ERW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_LOCK_OUTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_LOCK_OUTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transfer Done Interrupt."] - #[inline] - pub fn done(&self) -> DONER { - DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Interactive Receive Interrupt."] - #[inline] - pub fn rx_mode(&self) -> RX_MODER { - RX_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Slave General Call Address Match Interrupt."] - #[inline] - pub fn gen_call_addr(&self) -> GEN_CALL_ADDRR { - GEN_CALL_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Slave Address Match Interrupt."] - #[inline] - pub fn addr_match(&self) -> ADDR_MATCHR { - ADDR_MATCHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Receive Threshold Interrupt. This bit is automaticcaly cleared when RX_FIFO is below the threshold level."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Transmit Threshold Interrupt. This bit is automaticcaly cleared when TX_FIFO is above the threshold level."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - STOP Interrupt."] - #[inline] - pub fn stop(&self) -> STOPR { - STOPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Address Acknowledge Interrupt."] - #[inline] - pub fn addr_ack(&self) -> ADDR_ACKR { - ADDR_ACKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Arbritation error Interrupt."] - #[inline] - pub fn arb_er(&self) -> ARB_ERR { - ARB_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - timeout Error Interrupt."] - #[inline] - pub fn to_er(&self) -> TO_ERR { - TO_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Address NACK Error Interrupt."] - #[inline] - pub fn addr_nack_er(&self) -> ADDR_NACK_ERR { - ADDR_NACK_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Data NACK Error Interrupt."] - #[inline] - pub fn data_er(&self) -> DATA_ERR { - DATA_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Do Not Respond Error Interrupt."] - #[inline] - pub fn do_not_resp_er(&self) -> DO_NOT_RESP_ERR { - DO_NOT_RESP_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Start Error Interrupt."] - #[inline] - pub fn start_er(&self) -> START_ERR { - START_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Stop Error Interrupt."] - #[inline] - pub fn stop_er(&self) -> STOP_ERR { - STOP_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Transmit Lock Out Interrupt."] - #[inline] - pub fn tx_lock_out(&self) -> TX_LOCK_OUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_LOCK_OUTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transfer Done Interrupt."] - #[inline] - pub fn done(&mut self) -> _DONEW { - _DONEW { w: self } - } - #[doc = "Bit 1 - Interactive Receive Interrupt."] - #[inline] - pub fn rx_mode(&mut self) -> _RX_MODEW { - _RX_MODEW { w: self } - } - #[doc = "Bit 2 - Slave General Call Address Match Interrupt."] - #[inline] - pub fn gen_call_addr(&mut self) -> _GEN_CALL_ADDRW { - _GEN_CALL_ADDRW { w: self } - } - #[doc = "Bit 3 - Slave Address Match Interrupt."] - #[inline] - pub fn addr_match(&mut self) -> _ADDR_MATCHW { - _ADDR_MATCHW { w: self } - } - #[doc = "Bit 4 - Receive Threshold Interrupt. This bit is automaticcaly cleared when RX_FIFO is below the threshold level."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 5 - Transmit Threshold Interrupt. This bit is automaticcaly cleared when TX_FIFO is above the threshold level."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 6 - STOP Interrupt."] - #[inline] - pub fn stop(&mut self) -> _STOPW { - _STOPW { w: self } - } - #[doc = "Bit 7 - Address Acknowledge Interrupt."] - #[inline] - pub fn addr_ack(&mut self) -> _ADDR_ACKW { - _ADDR_ACKW { w: self } - } - #[doc = "Bit 8 - Arbritation error Interrupt."] - #[inline] - pub fn arb_er(&mut self) -> _ARB_ERW { - _ARB_ERW { w: self } - } - #[doc = "Bit 9 - timeout Error Interrupt."] - #[inline] - pub fn to_er(&mut self) -> _TO_ERW { - _TO_ERW { w: self } - } - #[doc = "Bit 10 - Address NACK Error Interrupt."] - #[inline] - pub fn addr_nack_er(&mut self) -> _ADDR_NACK_ERW { - _ADDR_NACK_ERW { w: self } - } - #[doc = "Bit 11 - Data NACK Error Interrupt."] - #[inline] - pub fn data_er(&mut self) -> _DATA_ERW { - _DATA_ERW { w: self } - } - #[doc = "Bit 12 - Do Not Respond Error Interrupt."] - #[inline] - pub fn do_not_resp_er(&mut self) -> _DO_NOT_RESP_ERW { - _DO_NOT_RESP_ERW { w: self } - } - #[doc = "Bit 13 - Start Error Interrupt."] - #[inline] - pub fn start_er(&mut self) -> _START_ERW { - _START_ERW { w: self } - } - #[doc = "Bit 14 - Stop Error Interrupt."] - #[inline] - pub fn stop_er(&mut self) -> _STOP_ERW { - _STOP_ERW { w: self } - } - #[doc = "Bit 15 - Transmit Lock Out Interrupt."] - #[inline] - pub fn tx_lock_out(&mut self) -> _TX_LOCK_OUTW { - _TX_LOCK_OUTW { w: self } - } - } - } - #[doc = "Interrupt Enable Register."] - pub struct INT_EN0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Enable Register."] - pub mod int_en0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONER { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when DONE = 1."] - EN, - } - impl DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DONER::DIS => false, - DONER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DONER { - match value { - false => DONER::DIS, - true => DONER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DONER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DONER::EN - } - } - #[doc = "Possible values of the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODER { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when RX_MODE = 1."] - EN, - } - impl RX_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_MODER::DIS => false, - RX_MODER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_MODER { - match value { - false => RX_MODER::DIS, - true => RX_MODER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_MODER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_MODER::EN - } - } - #[doc = "Possible values of the field `GEN_CTRL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CTRL_ADDRR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when GEN_CTRL_ADDR = 1."] - EN, - } - impl GEN_CTRL_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GEN_CTRL_ADDRR::DIS => false, - GEN_CTRL_ADDRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GEN_CTRL_ADDRR { - match value { - false => GEN_CTRL_ADDRR::DIS, - true => GEN_CTRL_ADDRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == GEN_CTRL_ADDRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == GEN_CTRL_ADDRR::EN - } - } - #[doc = "Possible values of the field `ADDR_MATCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_MATCHR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when ADDR_MATCH = 1."] - EN, - } - impl ADDR_MATCHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_MATCHR::DIS => false, - ADDR_MATCHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_MATCHR { - match value { - false => ADDR_MATCHR::DIS, - true => ADDR_MATCHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ADDR_MATCHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ADDR_MATCHR::EN - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::DIS => false, - RX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::DIS, - true => RX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_THRESHR::EN - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::DIS => false, - TX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::DIS, - true => TX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_THRESHR::EN - } - } - #[doc = "Possible values of the field `STOP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when STOP = 1."] - EN, - } - impl STOPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STOPR::DIS => false, - STOPR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STOPR { - match value { - false => STOPR::DIS, - true => STOPR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == STOPR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == STOPR::EN - } - } - #[doc = "Possible values of the field `ADDR_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ACKR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ADDR_ACKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_ACKR::DIS => false, - ADDR_ACKR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_ACKR { - match value { - false => ADDR_ACKR::DIS, - true => ADDR_ACKR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ADDR_ACKR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ADDR_ACKR::EN - } - } - #[doc = "Possible values of the field `ARB_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ARB_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ARB_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ARB_ERR::DIS => false, - ARB_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ARB_ERR { - match value { - false => ARB_ERR::DIS, - true => ARB_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ARB_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ARB_ERR::EN - } - } - #[doc = "Possible values of the field `TO_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl TO_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TO_ERR::DIS => false, - TO_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TO_ERR { - match value { - false => TO_ERR::DIS, - true => TO_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TO_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TO_ERR::EN - } - } - #[doc = "Possible values of the field `ADDR_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ADDR_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADDR_ERR::DIS => false, - ADDR_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADDR_ERR { - match value { - false => ADDR_ERR::DIS, - true => ADDR_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ADDR_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ADDR_ERR::EN - } - } - #[doc = "Possible values of the field `DATA_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl DATA_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DATA_ERR::DIS => false, - DATA_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DATA_ERR { - match value { - false => DATA_ERR::DIS, - true => DATA_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DATA_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DATA_ERR::EN - } - } - #[doc = "Possible values of the field `DO_NOT_RESP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DO_NOT_RESP_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl DO_NOT_RESP_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DO_NOT_RESP_ERR::DIS => false, - DO_NOT_RESP_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DO_NOT_RESP_ERR { - match value { - false => DO_NOT_RESP_ERR::DIS, - true => DO_NOT_RESP_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DO_NOT_RESP_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DO_NOT_RESP_ERR::EN - } - } - #[doc = "Possible values of the field `START_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum START_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl START_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - START_ERR::DIS => false, - START_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> START_ERR { - match value { - false => START_ERR::DIS, - true => START_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == START_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == START_ERR::EN - } - } - #[doc = "Possible values of the field `STOP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOP_ERR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl STOP_ERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STOP_ERR::DIS => false, - STOP_ERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STOP_ERR { - match value { - false => STOP_ERR::DIS, - true => STOP_ERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == STOP_ERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == STOP_ERR::EN - } - } - #[doc = "Possible values of the field `TX_LOCK_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_LOCK_OUTR { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when TXLOIE = 1."] - EN, - } - impl TX_LOCK_OUTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_LOCK_OUTR::DIS => false, - TX_LOCK_OUTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_LOCK_OUTR { - match value { - false => TX_LOCK_OUTR::DIS, - true => TX_LOCK_OUTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_LOCK_OUTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_LOCK_OUTR::EN - } - } - #[doc = "Values that can be written to the field `DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DONEW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when DONE = 1."] - EN, - } - impl DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DONEW::DIS => false, - DONEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DONEW<'a> { - w: &'a mut W, - } - impl<'a> _DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DONEW::DIS) - } - #[doc = "Interrupt enabled when DONE = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DONEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_MODEW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when RX_MODE = 1."] - EN, - } - impl RX_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_MODEW::DIS => false, - RX_MODEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _RX_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_MODEW::DIS) - } - #[doc = "Interrupt enabled when RX_MODE = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_MODEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `GEN_CTRL_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GEN_CTRL_ADDRW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when GEN_CTRL_ADDR = 1."] - EN, - } - impl GEN_CTRL_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GEN_CTRL_ADDRW::DIS => false, - GEN_CTRL_ADDRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GEN_CTRL_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _GEN_CTRL_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GEN_CTRL_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(GEN_CTRL_ADDRW::DIS) - } - #[doc = "Interrupt enabled when GEN_CTRL_ADDR = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(GEN_CTRL_ADDRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_MATCH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_MATCHW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when ADDR_MATCH = 1."] - EN, - } - impl ADDR_MATCHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_MATCHW::DIS => false, - ADDR_MATCHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_MATCHW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_MATCHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_MATCHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ADDR_MATCHW::DIS) - } - #[doc = "Interrupt enabled when ADDR_MATCH = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ADDR_MATCHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::DIS => false, - RX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_THRESHW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::DIS => false, - TX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_THRESHW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STOP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when STOP = 1."] - EN, - } - impl STOPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STOPW::DIS => false, - STOPW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STOPW<'a> { - w: &'a mut W, - } - impl<'a> _STOPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STOPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(STOPW::DIS) - } - #[doc = "Interrupt enabled when STOP = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(STOPW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_ACK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ACKW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ADDR_ACKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_ACKW::DIS => false, - ADDR_ACKW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_ACKW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_ACKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_ACKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ADDR_ACKW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ADDR_ACKW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ARB_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ARB_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ARB_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ARB_ERW::DIS => false, - ARB_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ARB_ERW<'a> { - w: &'a mut W, - } - impl<'a> _ARB_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ARB_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ARB_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ARB_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TO_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TO_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl TO_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TO_ERW::DIS => false, - TO_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TO_ERW<'a> { - w: &'a mut W, - } - impl<'a> _TO_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TO_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TO_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TO_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl ADDR_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADDR_ERW::DIS => false, - ADDR_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_ERW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ADDR_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ADDR_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DATA_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl DATA_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DATA_ERW::DIS => false, - DATA_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DATA_ERW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DATA_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DATA_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DATA_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DO_NOT_RESP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DO_NOT_RESP_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl DO_NOT_RESP_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DO_NOT_RESP_ERW::DIS => false, - DO_NOT_RESP_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DO_NOT_RESP_ERW<'a> { - w: &'a mut W, - } - impl<'a> _DO_NOT_RESP_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DO_NOT_RESP_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DO_NOT_RESP_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DO_NOT_RESP_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `START_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum START_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl START_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - START_ERW::DIS => false, - START_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _START_ERW<'a> { - w: &'a mut W, - } - impl<'a> _START_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: START_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(START_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(START_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STOP_ER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOP_ERW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled."] - EN, - } - impl STOP_ERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STOP_ERW::DIS => false, - STOP_ERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STOP_ERW<'a> { - w: &'a mut W, - } - impl<'a> _STOP_ERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STOP_ERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(STOP_ERW::DIS) - } - #[doc = "Interrupt enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(STOP_ERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_LOCK_OUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_LOCK_OUTW { - #[doc = "Interrupt disabled."] - DIS, - #[doc = "Interrupt enabled when TXLOIE = 1."] - EN, - } - impl TX_LOCK_OUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_LOCK_OUTW::DIS => false, - TX_LOCK_OUTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_LOCK_OUTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_LOCK_OUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_LOCK_OUTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_LOCK_OUTW::DIS) - } - #[doc = "Interrupt enabled when TXLOIE = 1."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_LOCK_OUTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transfer Done Interrupt Enable."] - #[inline] - pub fn done(&self) -> DONER { - DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Description not available."] - #[inline] - pub fn rx_mode(&self) -> RX_MODER { - RX_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Slave mode general call address match received input enable."] - #[inline] - pub fn gen_ctrl_addr(&self) -> GEN_CTRL_ADDRR { - GEN_CTRL_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Slave mode incoming address match interrupt."] - #[inline] - pub fn addr_match(&self) -> ADDR_MATCHR { - ADDR_MATCHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - RX FIFO Above Treshold Level Interrupt Enable."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - TX FIFO Below Treshold Level Interrupt Enable."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Stop Interrupt Enable"] - #[inline] - pub fn stop(&self) -> STOPR { - STOPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Received Address ACK from Slave Interrupt."] - #[inline] - pub fn addr_ack(&self) -> ADDR_ACKR { - ADDR_ACKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Master Mode Arbitration Lost Interrupt."] - #[inline] - pub fn arb_er(&self) -> ARB_ERR { - ARB_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Timeout Error Interrupt Enable."] - #[inline] - pub fn to_er(&self) -> TO_ERR { - TO_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Master Mode Address NACK Received Interrupt."] - #[inline] - pub fn addr_er(&self) -> ADDR_ERR { - ADDR_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Master Mode Data NACK Received Interrupt."] - #[inline] - pub fn data_er(&self) -> DATA_ERR { - DATA_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Slave Mode Do Not Respond Interrupt."] - #[inline] - pub fn do_not_resp_er(&self) -> DO_NOT_RESP_ERR { - DO_NOT_RESP_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Out of Sequence START condition detected interrupt."] - #[inline] - pub fn start_er(&self) -> START_ERR { - START_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Out of Sequence STOP condition detected interrupt."] - #[inline] - pub fn stop_er(&self) -> STOP_ERR { - STOP_ERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - TX FIFO Locked Out Interrupt."] - #[inline] - pub fn tx_lock_out(&self) -> TX_LOCK_OUTR { - TX_LOCK_OUTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transfer Done Interrupt Enable."] - #[inline] - pub fn done(&mut self) -> _DONEW { - _DONEW { w: self } - } - #[doc = "Bit 1 - Description not available."] - #[inline] - pub fn rx_mode(&mut self) -> _RX_MODEW { - _RX_MODEW { w: self } - } - #[doc = "Bit 2 - Slave mode general call address match received input enable."] - #[inline] - pub fn gen_ctrl_addr(&mut self) -> _GEN_CTRL_ADDRW { - _GEN_CTRL_ADDRW { w: self } - } - #[doc = "Bit 3 - Slave mode incoming address match interrupt."] - #[inline] - pub fn addr_match(&mut self) -> _ADDR_MATCHW { - _ADDR_MATCHW { w: self } - } - #[doc = "Bit 4 - RX FIFO Above Treshold Level Interrupt Enable."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 5 - TX FIFO Below Treshold Level Interrupt Enable."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 6 - Stop Interrupt Enable"] - #[inline] - pub fn stop(&mut self) -> _STOPW { - _STOPW { w: self } - } - #[doc = "Bit 7 - Received Address ACK from Slave Interrupt."] - #[inline] - pub fn addr_ack(&mut self) -> _ADDR_ACKW { - _ADDR_ACKW { w: self } - } - #[doc = "Bit 8 - Master Mode Arbitration Lost Interrupt."] - #[inline] - pub fn arb_er(&mut self) -> _ARB_ERW { - _ARB_ERW { w: self } - } - #[doc = "Bit 9 - Timeout Error Interrupt Enable."] - #[inline] - pub fn to_er(&mut self) -> _TO_ERW { - _TO_ERW { w: self } - } - #[doc = "Bit 10 - Master Mode Address NACK Received Interrupt."] - #[inline] - pub fn addr_er(&mut self) -> _ADDR_ERW { - _ADDR_ERW { w: self } - } - #[doc = "Bit 11 - Master Mode Data NACK Received Interrupt."] - #[inline] - pub fn data_er(&mut self) -> _DATA_ERW { - _DATA_ERW { w: self } - } - #[doc = "Bit 12 - Slave Mode Do Not Respond Interrupt."] - #[inline] - pub fn do_not_resp_er(&mut self) -> _DO_NOT_RESP_ERW { - _DO_NOT_RESP_ERW { w: self } - } - #[doc = "Bit 13 - Out of Sequence START condition detected interrupt."] - #[inline] - pub fn start_er(&mut self) -> _START_ERW { - _START_ERW { w: self } - } - #[doc = "Bit 14 - Out of Sequence STOP condition detected interrupt."] - #[inline] - pub fn stop_er(&mut self) -> _STOP_ERW { - _STOP_ERW { w: self } - } - #[doc = "Bit 15 - TX FIFO Locked Out Interrupt."] - #[inline] - pub fn tx_lock_out(&mut self) -> _TX_LOCK_OUTW { - _TX_LOCK_OUTW { w: self } - } - } - } - #[doc = "Interrupt Status Register 1."] - pub struct INT_FL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Status Register 1."] - pub mod int_fl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_FL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `RX_OVERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVERFLOWR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl RX_OVERFLOWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVERFLOWR::INACTIVE => false, - RX_OVERFLOWR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVERFLOWR { - match value { - false => RX_OVERFLOWR::INACTIVE, - true => RX_OVERFLOWR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == RX_OVERFLOWR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == RX_OVERFLOWR::PENDING - } - } - #[doc = "Possible values of the field `TX_UNDERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDERFLOWR { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl TX_UNDERFLOWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDERFLOWR::INACTIVE => false, - TX_UNDERFLOWR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDERFLOWR { - match value { - false => TX_UNDERFLOWR::INACTIVE, - true => TX_UNDERFLOWR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == TX_UNDERFLOWR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == TX_UNDERFLOWR::PENDING - } - } - #[doc = "Values that can be written to the field `RX_OVERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVERFLOWW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl RX_OVERFLOWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVERFLOWW::INACTIVE => false, - RX_OVERFLOWW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVERFLOWW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVERFLOWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVERFLOWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(RX_OVERFLOWW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(RX_OVERFLOWW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UNDERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDERFLOWW { - #[doc = "No Interrupt is Pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl TX_UNDERFLOWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDERFLOWW::INACTIVE => false, - TX_UNDERFLOWW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDERFLOWW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDERFLOWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDERFLOWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(TX_UNDERFLOWW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(TX_UNDERFLOWW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Receiver Overflow Interrupt. When operating as a slave receiver, this bit is set when you reach the first data bit and the RX FIFO and shift register are both full."] - #[inline] - pub fn rx_overflow(&self) -> RX_OVERFLOWR { - RX_OVERFLOWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Transmit Underflow Interrupt. When operating as a slave transmitter, this bit is set when you reach the first data bit and the TX FIFO is empty and the master is still asking for more data (i.e the master hasn't sent a NACK yet)."] - #[inline] - pub fn tx_underflow(&self) -> TX_UNDERFLOWR { - TX_UNDERFLOWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Receiver Overflow Interrupt. When operating as a slave receiver, this bit is set when you reach the first data bit and the RX FIFO and shift register are both full."] - #[inline] - pub fn rx_overflow(&mut self) -> _RX_OVERFLOWW { - _RX_OVERFLOWW { w: self } - } - #[doc = "Bit 1 - Transmit Underflow Interrupt. When operating as a slave transmitter, this bit is set when you reach the first data bit and the TX FIFO is empty and the master is still asking for more data (i.e the master hasn't sent a NACK yet)."] - #[inline] - pub fn tx_underflow(&mut self) -> _TX_UNDERFLOWW { - _TX_UNDERFLOWW { w: self } - } - } - } - #[doc = "Interrupt Staus Register 1."] - pub struct INT_EN1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Staus Register 1."] - pub mod int_en1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `RX_OVERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVERFLOWR { - #[doc = "No Interrupt is Pending."] - DIS, - #[doc = "An interrupt is pending."] - EN, - } - impl RX_OVERFLOWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVERFLOWR::DIS => false, - RX_OVERFLOWR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVERFLOWR { - match value { - false => RX_OVERFLOWR::DIS, - true => RX_OVERFLOWR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_OVERFLOWR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_OVERFLOWR::EN - } - } - #[doc = "Possible values of the field `TX_UNDERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDERFLOWR { - #[doc = "No Interrupt is Pending."] - DIS, - #[doc = "An interrupt is pending."] - EN, - } - impl TX_UNDERFLOWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDERFLOWR::DIS => false, - TX_UNDERFLOWR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDERFLOWR { - match value { - false => TX_UNDERFLOWR::DIS, - true => TX_UNDERFLOWR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_UNDERFLOWR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_UNDERFLOWR::EN - } - } - #[doc = "Values that can be written to the field `RX_OVERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVERFLOWW { - #[doc = "No Interrupt is Pending."] - DIS, - #[doc = "An interrupt is pending."] - EN, - } - impl RX_OVERFLOWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVERFLOWW::DIS => false, - RX_OVERFLOWW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVERFLOWW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVERFLOWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVERFLOWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_OVERFLOWW::DIS) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_OVERFLOWW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UNDERFLOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDERFLOWW { - #[doc = "No Interrupt is Pending."] - DIS, - #[doc = "An interrupt is pending."] - EN, - } - impl TX_UNDERFLOWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDERFLOWW::DIS => false, - TX_UNDERFLOWW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDERFLOWW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDERFLOWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDERFLOWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Interrupt is Pending."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_UNDERFLOWW::DIS) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_UNDERFLOWW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Receiver Overflow Interrupt Enable."] - #[inline] - pub fn rx_overflow(&self) -> RX_OVERFLOWR { - RX_OVERFLOWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Transmit Underflow Interrupt Enable."] - #[inline] - pub fn tx_underflow(&self) -> TX_UNDERFLOWR { - TX_UNDERFLOWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Receiver Overflow Interrupt Enable."] - #[inline] - pub fn rx_overflow(&mut self) -> _RX_OVERFLOWW { - _RX_OVERFLOWW { w: self } - } - #[doc = "Bit 1 - Transmit Underflow Interrupt Enable."] - #[inline] - pub fn tx_underflow(&mut self) -> _TX_UNDERFLOWW { - _TX_UNDERFLOWW { w: self } - } - } - } - #[doc = "FIFO Configuration Register."] - pub struct FIFO_LEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "FIFO Configuration Register."] - pub mod fifo_len { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::FIFO_LEN { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct RX_LENR { - bits: u8, - } - impl RX_LENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TX_LENR { - bits: u8, - } - impl TX_LENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Receive FIFO Length."] - #[inline] - pub fn rx_len(&self) -> RX_LENR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_LENR { bits } - } - #[doc = "Bits 8:15 - Transmit FIFO Length."] - #[inline] - pub fn tx_len(&self) -> TX_LENR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_LENR { bits } - } - } - } - #[doc = "Receive Control Register 0."] - pub struct RX_CTRL0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Receive Control Register 0."] - pub mod rx_ctrl0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RX_CTRL0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DNRR { - #[doc = "Always respond to address match."] - RESPOND, - #[doc = "Do not respond to address match when RX_FIFO is not empty."] - NOT_RESPOND_RX_FIFO_EMPTY, - } - impl DNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DNRR::RESPOND => false, - DNRR::NOT_RESPOND_RX_FIFO_EMPTY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DNRR { - match value { - false => DNRR::RESPOND, - true => DNRR::NOT_RESPOND_RX_FIFO_EMPTY, - } - } - #[doc = "Checks if the value of the field is `RESPOND`"] - #[inline] - pub fn is_respond(&self) -> bool { - *self == DNRR::RESPOND - } - #[doc = "Checks if the value of the field is `NOT_RESPOND_RX_FIFO_EMPTY`"] - #[inline] - pub fn is_not_respond_rx_fifo_empty(&self) -> bool { - *self == DNRR::NOT_RESPOND_RX_FIFO_EMPTY - } - } - #[doc = "Possible values of the field `RX_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FLUSHR { - #[doc = "FIFO not flushed."] - NOT_FLUSHED, - #[doc = "Flush RX_FIFO."] - FLUSH, - } - impl RX_FLUSHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FLUSHR::NOT_FLUSHED => false, - RX_FLUSHR::FLUSH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FLUSHR { - match value { - false => RX_FLUSHR::NOT_FLUSHED, - true => RX_FLUSHR::FLUSH, - } - } - #[doc = "Checks if the value of the field is `NOT_FLUSHED`"] - #[inline] - pub fn is_not_flushed(&self) -> bool { - *self == RX_FLUSHR::NOT_FLUSHED - } - #[doc = "Checks if the value of the field is `FLUSH`"] - #[inline] - pub fn is_flush(&self) -> bool { - *self == RX_FLUSHR::FLUSH - } - } - #[doc = r" Value of the field"] - pub struct RX_THRESHR { - bits: u8, - } - impl RX_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `DNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DNRW { - #[doc = "Always respond to address match."] - RESPOND, - #[doc = "Do not respond to address match when RX_FIFO is not empty."] - NOT_RESPOND_RX_FIFO_EMPTY, - } - impl DNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DNRW::RESPOND => false, - DNRW::NOT_RESPOND_RX_FIFO_EMPTY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DNRW<'a> { - w: &'a mut W, - } - impl<'a> _DNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Always respond to address match."] - #[inline] - pub fn respond(self) -> &'a mut W { - self.variant(DNRW::RESPOND) - } - #[doc = "Do not respond to address match when RX_FIFO is not empty."] - #[inline] - pub fn not_respond_rx_fifo_empty(self) -> &'a mut W { - self.variant(DNRW::NOT_RESPOND_RX_FIFO_EMPTY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FLUSHW { - #[doc = "FIFO not flushed."] - NOT_FLUSHED, - #[doc = "Flush RX_FIFO."] - FLUSH, - } - impl RX_FLUSHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FLUSHW::NOT_FLUSHED => false, - RX_FLUSHW::FLUSH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FLUSHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FLUSHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "FIFO not flushed."] - #[inline] - pub fn not_flushed(self) -> &'a mut W { - self.variant(RX_FLUSHW::NOT_FLUSHED) - } - #[doc = "Flush RX_FIFO."] - #[inline] - pub fn flush(self) -> &'a mut W { - self.variant(RX_FLUSHW::FLUSH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Do Not Respond."] - #[inline] - pub fn dnr(&self) -> DNRR { - DNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Receive FIFO Flush. This bit is automatically cleared to 0 after the operation. Setting this bit to 1 will affect RX_FIFO status."] - #[inline] - pub fn rx_flush(&self) -> RX_FLUSHR { - RX_FLUSHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - Receive FIFO Threshold. These bits define the RX_FIFO interrupt threshold."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_THRESHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Do Not Respond."] - #[inline] - pub fn dnr(&mut self) -> _DNRW { - _DNRW { w: self } - } - #[doc = "Bit 7 - Receive FIFO Flush. This bit is automatically cleared to 0 after the operation. Setting this bit to 1 will affect RX_FIFO status."] - #[inline] - pub fn rx_flush(&mut self) -> _RX_FLUSHW { - _RX_FLUSHW { w: self } - } - #[doc = "Bits 8:11 - Receive FIFO Threshold. These bits define the RX_FIFO interrupt threshold."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - } - } - #[doc = "Receive Control Register 1."] - pub struct RX_CTRL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Receive Control Register 1."] - pub mod rx_ctrl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RX_CTRL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RX_CNTR { - bits: u8, - } - impl RX_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFOR { - bits: u8, - } - impl RX_FIFOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RX_CNTW<'a> { - w: &'a mut W, - } - impl<'a> _RX_CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Receive Count Bits. These bits define the number of bytes to be received in a transaction, except for the case RXCNT = 0. RXCNT = 0 means 256 bytes to be received in a transaction."] - #[inline] - pub fn rx_cnt(&self) -> RX_CNTR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_CNTR { bits } - } - #[doc = "Bits 8:11 - Receive FIFO Count. These bits reflect the number of byte in the RX_FIFO. These bits are flushed when I2CEN = 0."] - #[inline] - pub fn rx_fifo(&self) -> RX_FIFOR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Receive Count Bits. These bits define the number of bytes to be received in a transaction, except for the case RXCNT = 0. RXCNT = 0 means 256 bytes to be received in a transaction."] - #[inline] - pub fn rx_cnt(&mut self) -> _RX_CNTW { - _RX_CNTW { w: self } - } - } - } - #[doc = "Transmit Control Register 0."] - pub struct TX_CTRL0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Transmit Control Register 0."] - pub mod tx_ctrl0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TX_CTRL0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_PRELOADR { - bits: bool, - } - impl TX_PRELOADR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `TX_READY_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READY_MODER { - #[doc = "HW control of I2CTXRDY enabled."] - EN, - #[doc = "HW control of I2CTXRDY disabled."] - DIS, - } - impl TX_READY_MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_READY_MODER::EN => false, - TX_READY_MODER::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_READY_MODER { - match value { - false => TX_READY_MODER::EN, - true => TX_READY_MODER::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_READY_MODER::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_READY_MODER::DIS - } - } - #[doc = "Possible values of the field `TX_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FLUSHR { - #[doc = "FIFO not flushed."] - NOT_FLUSHED, - #[doc = "Flush TX_FIFO."] - FLUSH, - } - impl TX_FLUSHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FLUSHR::NOT_FLUSHED => false, - TX_FLUSHR::FLUSH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FLUSHR { - match value { - false => TX_FLUSHR::NOT_FLUSHED, - true => TX_FLUSHR::FLUSH, - } - } - #[doc = "Checks if the value of the field is `NOT_FLUSHED`"] - #[inline] - pub fn is_not_flushed(&self) -> bool { - *self == TX_FLUSHR::NOT_FLUSHED - } - #[doc = "Checks if the value of the field is `FLUSH`"] - #[inline] - pub fn is_flush(&self) -> bool { - *self == TX_FLUSHR::FLUSH - } - } - #[doc = r" Value of the field"] - pub struct TX_THRESHR { - bits: u8, - } - impl TX_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_PRELOADW<'a> { - w: &'a mut W, - } - impl<'a> _TX_PRELOADW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_READY_MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READY_MODEW { - #[doc = "HW control of I2CTXRDY enabled."] - EN, - #[doc = "HW control of I2CTXRDY disabled."] - DIS, - } - impl TX_READY_MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_READY_MODEW::EN => false, - TX_READY_MODEW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_READY_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _TX_READY_MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_READY_MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "HW control of I2CTXRDY enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_READY_MODEW::EN) - } - #[doc = "HW control of I2CTXRDY disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_READY_MODEW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FLUSH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FLUSHW { - #[doc = "FIFO not flushed."] - NOT_FLUSHED, - #[doc = "Flush TX_FIFO."] - FLUSH, - } - impl TX_FLUSHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FLUSHW::NOT_FLUSHED => false, - TX_FLUSHW::FLUSH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FLUSHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FLUSHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "FIFO not flushed."] - #[inline] - pub fn not_flushed(self) -> &'a mut W { - self.variant(TX_FLUSHW::NOT_FLUSHED) - } - #[doc = "Flush TX_FIFO."] - #[inline] - pub fn flush(self) -> &'a mut W { - self.variant(TX_FLUSHW::FLUSH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transmit FIFO Preaload Mode. Setting this bit will allow for high speed application to preload the transmit FIFO prior to Slave Address Match."] - #[inline] - pub fn tx_preload(&self) -> TX_PRELOADR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_PRELOADR { bits } - } - #[doc = "Bit 1 - Transmit FIFO Ready Manual Mode."] - #[inline] - pub fn tx_ready_mode(&self) -> TX_READY_MODER { - TX_READY_MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Transmit FIFO Flush. This bit is automatically cleared to 0 after the operation."] - #[inline] - pub fn tx_flush(&self) -> TX_FLUSHR { - TX_FLUSHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - Transmit FIFO Threshold. These bits define the TX_FIFO interrupt threshold."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_THRESHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transmit FIFO Preaload Mode. Setting this bit will allow for high speed application to preload the transmit FIFO prior to Slave Address Match."] - #[inline] - pub fn tx_preload(&mut self) -> _TX_PRELOADW { - _TX_PRELOADW { w: self } - } - #[doc = "Bit 1 - Transmit FIFO Ready Manual Mode."] - #[inline] - pub fn tx_ready_mode(&mut self) -> _TX_READY_MODEW { - _TX_READY_MODEW { w: self } - } - #[doc = "Bit 7 - Transmit FIFO Flush. This bit is automatically cleared to 0 after the operation."] - #[inline] - pub fn tx_flush(&mut self) -> _TX_FLUSHW { - _TX_FLUSHW { w: self } - } - #[doc = "Bits 8:11 - Transmit FIFO Threshold. These bits define the TX_FIFO interrupt threshold."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - } - } - #[doc = "Transmit Control Register 1."] - pub struct TX_CTRL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Transmit Control Register 1."] - pub mod tx_ctrl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TX_CTRL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_READYR { - bits: bool, - } - impl TX_READYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `TX_LAST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_LASTR { - #[doc = "Hold SCL low on TX_FIFO empty."] - HOLD_SCL_LOW, - #[doc = "End transaction on TX_FIFO empty."] - END_TRANSACTION, - } - impl TX_LASTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_LASTR::HOLD_SCL_LOW => false, - TX_LASTR::END_TRANSACTION => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_LASTR { - match value { - false => TX_LASTR::HOLD_SCL_LOW, - true => TX_LASTR::END_TRANSACTION, - } - } - #[doc = "Checks if the value of the field is `HOLD_SCL_LOW`"] - #[inline] - pub fn is_hold_scl_low(&self) -> bool { - *self == TX_LASTR::HOLD_SCL_LOW - } - #[doc = "Checks if the value of the field is `END_TRANSACTION`"] - #[inline] - pub fn is_end_transaction(&self) -> bool { - *self == TX_LASTR::END_TRANSACTION - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFOR { - bits: u8, - } - impl TX_FIFOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_READYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_READYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_LAST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_LASTW { - #[doc = "Hold SCL low on TX_FIFO empty."] - HOLD_SCL_LOW, - #[doc = "End transaction on TX_FIFO empty."] - END_TRANSACTION, - } - impl TX_LASTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_LASTW::HOLD_SCL_LOW => false, - TX_LASTW::END_TRANSACTION => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_LASTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_LASTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_LASTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Hold SCL low on TX_FIFO empty."] - #[inline] - pub fn hold_scl_low(self) -> &'a mut W { - self.variant(TX_LASTW::HOLD_SCL_LOW) - } - #[doc = "End transaction on TX_FIFO empty."] - #[inline] - pub fn end_transaction(self) -> &'a mut W { - self.variant(TX_LASTW::END_TRANSACTION) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transmit FIFO Preload Ready."] - #[inline] - pub fn tx_ready(&self) -> TX_READYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_READYR { bits } - } - #[doc = "Bit 1 - Transmit Last. This bit is used in slave mod only. Do not use when preloading (cleared by hardware)."] - #[inline] - pub fn tx_last(&self) -> TX_LASTR { - TX_LASTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - Transmit FIFO Count. These bits reflect the number of bytes in the TX_FIFO."] - #[inline] - pub fn tx_fifo(&self) -> TX_FIFOR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transmit FIFO Preload Ready."] - #[inline] - pub fn tx_ready(&mut self) -> _TX_READYW { - _TX_READYW { w: self } - } - #[doc = "Bit 1 - Transmit Last. This bit is used in slave mod only. Do not use when preloading (cleared by hardware)."] - #[inline] - pub fn tx_last(&mut self) -> _TX_LASTW { - _TX_LASTW { w: self } - } - } - } - #[doc = "Data Register."] - pub struct FIFO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Data Register."] - pub mod fifo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u8, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Data is read from or written to this location. Transmit and receive FIFO are separate but both are addressed at this location."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Data is read from or written to this location. Transmit and receive FIFO are separate but both are addressed at this location."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Master Control Register."] - pub struct MASTER_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Master Control Register."] - pub mod master_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MASTER_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct STARTR { - bits: bool, - } - impl STARTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESTARTR { - bits: bool, - } - impl RESTARTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct STOPR { - bits: bool, - } - impl STOPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `SL_EX_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SL_EX_ADDRR { - #[doc = "7-bit address."] - _7_BITS_ADDRESS, - #[doc = "10-bit address."] - _10_BITS_ADDRESS, - } - impl SL_EX_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SL_EX_ADDRR::_7_BITS_ADDRESS => false, - SL_EX_ADDRR::_10_BITS_ADDRESS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SL_EX_ADDRR { - match value { - false => SL_EX_ADDRR::_7_BITS_ADDRESS, - true => SL_EX_ADDRR::_10_BITS_ADDRESS, - } - } - #[doc = "Checks if the value of the field is `_7_BITS_ADDRESS`"] - #[inline] - pub fn is_7_bits_address(&self) -> bool { - *self == SL_EX_ADDRR::_7_BITS_ADDRESS - } - #[doc = "Checks if the value of the field is `_10_BITS_ADDRESS`"] - #[inline] - pub fn is_10_bits_address(&self) -> bool { - *self == SL_EX_ADDRR::_10_BITS_ADDRESS - } - } - #[doc = r" Value of the field"] - pub struct MASTER_CODER { - bits: u8, - } - impl MASTER_CODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `SCL_SPEED_UP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_SPEED_UPR { - #[doc = "Master monitors SCL state."] - EN, - #[doc = "SCL state monitoring disabled."] - DIS, - } - impl SCL_SPEED_UPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCL_SPEED_UPR::EN => false, - SCL_SPEED_UPR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCL_SPEED_UPR { - match value { - false => SCL_SPEED_UPR::EN, - true => SCL_SPEED_UPR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SCL_SPEED_UPR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SCL_SPEED_UPR::DIS - } - } - #[doc = r" Proxy"] - pub struct _STARTW<'a> { - w: &'a mut W, - } - impl<'a> _STARTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESTARTW<'a> { - w: &'a mut W, - } - impl<'a> _RESTARTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _STOPW<'a> { - w: &'a mut W, - } - impl<'a> _STOPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SL_EX_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SL_EX_ADDRW { - #[doc = "7-bit address."] - _7_BITS_ADDRESS, - #[doc = "10-bit address."] - _10_BITS_ADDRESS, - } - impl SL_EX_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SL_EX_ADDRW::_7_BITS_ADDRESS => false, - SL_EX_ADDRW::_10_BITS_ADDRESS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SL_EX_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _SL_EX_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SL_EX_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "7-bit address."] - #[inline] - pub fn _7_bits_address(self) -> &'a mut W { - self.variant(SL_EX_ADDRW::_7_BITS_ADDRESS) - } - #[doc = "10-bit address."] - #[inline] - pub fn _10_bits_address(self) -> &'a mut W { - self.variant(SL_EX_ADDRW::_10_BITS_ADDRESS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MASTER_CODEW<'a> { - w: &'a mut W, - } - impl<'a> _MASTER_CODEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCL_SPEED_UP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCL_SPEED_UPW { - #[doc = "Master monitors SCL state."] - EN, - #[doc = "SCL state monitoring disabled."] - DIS, - } - impl SCL_SPEED_UPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCL_SPEED_UPW::EN => false, - SCL_SPEED_UPW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCL_SPEED_UPW<'a> { - w: &'a mut W, - } - impl<'a> _SCL_SPEED_UPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCL_SPEED_UPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Master monitors SCL state."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SCL_SPEED_UPW::EN) - } - #[doc = "SCL state monitoring disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SCL_SPEED_UPW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Setting this bit to 1 will start a master transfer."] - #[inline] - pub fn start(&self) -> STARTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - STARTR { bits } - } - #[doc = "Bit 1 - Setting this bit to 1 will generate a repeated START."] - #[inline] - pub fn restart(&self) -> RESTARTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RESTARTR { bits } - } - #[doc = "Bit 2 - Setting this bit to 1 will generate a STOP condition."] - #[inline] - pub fn stop(&self) -> STOPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - STOPR { bits } - } - #[doc = "Bit 7 - Slave Extend Address Select."] - #[inline] - pub fn sl_ex_addr(&self) -> SL_EX_ADDRR { - SL_EX_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:10 - Master Code. These bits set the Master Code used in Hs-mode operation."] - #[inline] - pub fn master_code(&self) -> MASTER_CODER { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - MASTER_CODER { bits } - } - #[doc = "Bit 11 - Serial Clock speed Up. Setting this bit disables the master's monitoring of SCL state for other external masters or slaves."] - #[inline] - pub fn scl_speed_up(&self) -> SCL_SPEED_UPR { - SCL_SPEED_UPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Setting this bit to 1 will start a master transfer."] - #[inline] - pub fn start(&mut self) -> _STARTW { - _STARTW { w: self } - } - #[doc = "Bit 1 - Setting this bit to 1 will generate a repeated START."] - #[inline] - pub fn restart(&mut self) -> _RESTARTW { - _RESTARTW { w: self } - } - #[doc = "Bit 2 - Setting this bit to 1 will generate a STOP condition."] - #[inline] - pub fn stop(&mut self) -> _STOPW { - _STOPW { w: self } - } - #[doc = "Bit 7 - Slave Extend Address Select."] - #[inline] - pub fn sl_ex_addr(&mut self) -> _SL_EX_ADDRW { - _SL_EX_ADDRW { w: self } - } - #[doc = "Bits 8:10 - Master Code. These bits set the Master Code used in Hs-mode operation."] - #[inline] - pub fn master_code(&mut self) -> _MASTER_CODEW { - _MASTER_CODEW { w: self } - } - #[doc = "Bit 11 - Serial Clock speed Up. Setting this bit disables the master's monitoring of SCL state for other external masters or slaves."] - #[inline] - pub fn scl_speed_up(&mut self) -> _SCL_SPEED_UPW { - _SCL_SPEED_UPW { w: self } - } - } - } - #[doc = "Clock Low Register."] - pub struct CLK_LO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Clock Low Register."] - pub mod clk_lo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLK_LO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CLK_LOR { - bits: u16, - } - impl CLK_LOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CLK_LOW<'a> { - w: &'a mut W, - } - impl<'a> _CLK_LOW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:8 - Clock low. In master mode, these bits define the SCL low period. In slave mode, these bits define the time SCL will be held low after data is outputted."] - #[inline] - pub fn clk_lo(&self) -> CLK_LOR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CLK_LOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:8 - Clock low. In master mode, these bits define the SCL low period. In slave mode, these bits define the time SCL will be held low after data is outputted."] - #[inline] - pub fn clk_lo(&mut self) -> _CLK_LOW { - _CLK_LOW { w: self } - } - } - } - #[doc = "Clock high Register."] - pub struct CLK_HI { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Clock high Register."] - pub mod clk_hi { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLK_HI { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CKHR { - bits: u16, - } - impl CKHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CKHW<'a> { - w: &'a mut W, - } - impl<'a> _CKHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:8 - Clock High. In master mode, these bits define the SCL high period."] - #[inline] - pub fn ckh(&self) -> CKHR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CKHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:8 - Clock High. In master mode, these bits define the SCL high period."] - #[inline] - pub fn ckh(&mut self) -> _CKHW { - _CKHW { w: self } - } - } - } - #[doc = "HS-Mode Clock Control Register"] - pub struct HS_CLK { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HS-Mode Clock Control Register"] - pub mod hs_clk { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HS_CLK { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct HS_CLK_LOR { - bits: u8, - } - impl HS_CLK_LOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct HS_CLK_HIR { - bits: u8, - } - impl HS_CLK_HIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _HS_CLK_LOW<'a> { - w: &'a mut W, - } - impl<'a> _HS_CLK_LOW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HS_CLK_HIW<'a> { - w: &'a mut W, - } - impl<'a> _HS_CLK_HIW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Slave Address."] - #[inline] - pub fn hs_clk_lo(&self) -> HS_CLK_LOR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - HS_CLK_LOR { bits } - } - #[doc = "Bits 8:15 - Slave Address."] - #[inline] - pub fn hs_clk_hi(&self) -> HS_CLK_HIR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - HS_CLK_HIR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Slave Address."] - #[inline] - pub fn hs_clk_lo(&mut self) -> _HS_CLK_LOW { - _HS_CLK_LOW { w: self } - } - #[doc = "Bits 8:15 - Slave Address."] - #[inline] - pub fn hs_clk_hi(&mut self) -> _HS_CLK_HIW { - _HS_CLK_HIW { w: self } - } - } - } - #[doc = "Timeout Register"] - pub struct TIMEOUT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Timeout Register"] - pub mod timeout { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TIMEOUT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TOR { - bits: u16, - } - impl TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TOW<'a> { - w: &'a mut W, - } - impl<'a> _TOW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Timeout"] - #[inline] - pub fn to(&self) -> TOR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - TOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Timeout"] - #[inline] - pub fn to(&mut self) -> _TOW { - _TOW { w: self } - } - } - } - #[doc = "DMA Register."] - pub struct DMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Register."] - pub mod dma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TX_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_ENR::DIS => false, - TX_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_ENR { - match value { - false => TX_ENR::DIS, - true => TX_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_ENR::EN - } - } - #[doc = "Possible values of the field `RX_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RX_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_ENR::DIS => false, - RX_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_ENR { - match value { - false => RX_ENR::DIS, - true => RX_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_ENR::EN - } - } - #[doc = "Values that can be written to the field `TX_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TX_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_ENW::DIS => false, - TX_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RX_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_ENW::DIS => false, - RX_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX channel enable."] - #[inline] - pub fn tx_en(&self) -> TX_ENR { - TX_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - RX channel enable."] - #[inline] - pub fn rx_en(&self) -> RX_ENR { - RX_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX channel enable."] - #[inline] - pub fn tx_en(&mut self) -> _TX_ENW { - _TX_ENW { w: self } - } - #[doc = "Bit 1 - RX channel enable."] - #[inline] - pub fn rx_en(&mut self) -> _RX_ENW { - _RX_ENW { w: self } - } - } - } - #[doc = "Slave Address Register."] - pub struct SLAVE_ADDR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Slave Address Register."] - pub mod slave_addr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SLAVE_ADDR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SLAVE_ADDRR { - bits: u16, - } - impl SLAVE_ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct SLAVE_ADDR_DISR { - bits: bool, - } - impl SLAVE_ADDR_DISR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SLAVE_ADDR_IDXR { - bits: u8, - } - impl SLAVE_ADDR_IDXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `EX_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EX_ADDRR { - #[doc = "7-bit address."] - _7_BITS_ADDRESS, - #[doc = "10-bit address."] - _10_BITS_ADDRESS, - } - impl EX_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EX_ADDRR::_7_BITS_ADDRESS => false, - EX_ADDRR::_10_BITS_ADDRESS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EX_ADDRR { - match value { - false => EX_ADDRR::_7_BITS_ADDRESS, - true => EX_ADDRR::_10_BITS_ADDRESS, - } - } - #[doc = "Checks if the value of the field is `_7_BITS_ADDRESS`"] - #[inline] - pub fn is_7_bits_address(&self) -> bool { - *self == EX_ADDRR::_7_BITS_ADDRESS - } - #[doc = "Checks if the value of the field is `_10_BITS_ADDRESS`"] - #[inline] - pub fn is_10_bits_address(&self) -> bool { - *self == EX_ADDRR::_10_BITS_ADDRESS - } - } - #[doc = r" Proxy"] - pub struct _SLAVE_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _SLAVE_ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SLAVE_ADDR_DISW<'a> { - w: &'a mut W, - } - impl<'a> _SLAVE_ADDR_DISW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SLAVE_ADDR_IDXW<'a> { - w: &'a mut W, - } - impl<'a> _SLAVE_ADDR_IDXW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EX_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EX_ADDRW { - #[doc = "7-bit address."] - _7_BITS_ADDRESS, - #[doc = "10-bit address."] - _10_BITS_ADDRESS, - } - impl EX_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EX_ADDRW::_7_BITS_ADDRESS => false, - EX_ADDRW::_10_BITS_ADDRESS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EX_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _EX_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EX_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "7-bit address."] - #[inline] - pub fn _7_bits_address(self) -> &'a mut W { - self.variant(EX_ADDRW::_7_BITS_ADDRESS) - } - #[doc = "10-bit address."] - #[inline] - pub fn _10_bits_address(self) -> &'a mut W { - self.variant(EX_ADDRW::_10_BITS_ADDRESS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:9 - Slave Address."] - #[inline] - pub fn slave_addr(&self) -> SLAVE_ADDRR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - SLAVE_ADDRR { bits } - } - #[doc = "Bit 10 - Slave Address DIS."] - #[inline] - pub fn slave_addr_dis(&self) -> SLAVE_ADDR_DISR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SLAVE_ADDR_DISR { bits } - } - #[doc = "Bits 11:14 - Slave Address Index."] - #[inline] - pub fn slave_addr_idx(&self) -> SLAVE_ADDR_IDXR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - SLAVE_ADDR_IDXR { bits } - } - #[doc = "Bit 15 - Extended Address Select."] - #[inline] - pub fn ex_addr(&self) -> EX_ADDRR { - EX_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:9 - Slave Address."] - #[inline] - pub fn slave_addr(&mut self) -> _SLAVE_ADDRW { - _SLAVE_ADDRW { w: self } - } - #[doc = "Bit 10 - Slave Address DIS."] - #[inline] - pub fn slave_addr_dis(&mut self) -> _SLAVE_ADDR_DISW { - _SLAVE_ADDR_DISW { w: self } - } - #[doc = "Bits 11:14 - Slave Address Index."] - #[inline] - pub fn slave_addr_idx(&mut self) -> _SLAVE_ADDR_IDXW { - _SLAVE_ADDR_IDXW { w: self } - } - #[doc = "Bit 15 - Extended Address Select."] - #[inline] - pub fn ex_addr(&mut self) -> _EX_ADDRW { - _EX_ADDRW { w: self } - } - } - } -} -#[doc = "Inter-Integrated Circuit. 1"] -pub struct I2C1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for I2C1 {} -impl I2C1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const i2c0::RegisterBlock { - 0x4001_e000 as *const _ - } -} -impl Deref for I2C1 { - type Target = i2c0::RegisterBlock; - fn deref(&self) -> &i2c0::RegisterBlock { - unsafe { &*I2C1::ptr() } - } -} -#[doc = "Inter-Integrated Circuit. 2"] -pub struct I2C2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for I2C2 {} -impl I2C2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const i2c0::RegisterBlock { - 0x4001_f000 as *const _ - } -} -impl Deref for I2C2 { - type Target = i2c0::RegisterBlock; - fn deref(&self) -> &i2c0::RegisterBlock { - unsafe { &*I2C2::ptr() } - } -} -#[doc = "Instruction Cache Controller Registers"] -pub struct ICC0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for ICC0 {} -impl ICC0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const icc0::RegisterBlock { - 0x4002_a000 as *const _ - } -} -impl Deref for ICC0 { - type Target = icc0::RegisterBlock; - fn deref(&self) -> &icc0::RegisterBlock { - unsafe { &*ICC0::ptr() } - } -} -#[doc = "Instruction Cache Controller Registers"] -pub mod icc0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Cache ID Register."] - pub cache_id: CACHE_ID, - #[doc = "0x04 - Memory Configuration Register."] - pub memcfg: MEMCFG, - _reserved0: [u8; 248usize], - #[doc = "0x100 - Cache Control and Status Register."] - pub cache_ctrl: CACHE_CTRL, - _reserved1: [u8; 1532usize], - #[doc = "0x700 - Invalidate All Registers."] - pub invalidate: INVALIDATE, - } - #[doc = "Cache ID Register."] - pub struct CACHE_ID { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cache ID Register."] - pub mod cache_id { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CACHE_ID { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct RELNUMR { - bits: u8, - } - impl RELNUMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct PARTNUMR { - bits: u8, - } - impl PARTNUMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CCHIDR { - bits: u8, - } - impl CCHIDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:5 - Release Number. Identifies the RTL release version."] - #[inline] - pub fn relnum(&self) -> RELNUMR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RELNUMR { bits } - } - #[doc = "Bits 6:9 - Part Number. This field reflects the value of C_ID_PART_NUMBER configuration parameter."] - #[inline] - pub fn partnum(&self) -> PARTNUMR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - PARTNUMR { bits } - } - #[doc = "Bits 10:15 - Cache ID. This field reflects the value of the C_ID_CACHEID configuration parameter."] - #[inline] - pub fn cchid(&self) -> CCHIDR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CCHIDR { bits } - } - } - } - #[doc = "Memory Configuration Register."] - pub struct MEMCFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Memory Configuration Register."] - pub mod memcfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::MEMCFG { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct CCHSZR { - bits: u16, - } - impl CCHSZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MEMSZR { - bits: u16, - } - impl MEMSZR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Cache Size. Indicates total size in Kbytes of cache."] - #[inline] - pub fn cchsz(&self) -> CCHSZR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - CCHSZR { bits } - } - #[doc = "Bits 16:31 - Main Memory Size. Indicates the total size, in units of 128 Kbytes, of code memory accessible to the cache controller."] - #[inline] - pub fn memsz(&self) -> MEMSZR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MEMSZR { bits } - } - } - } - #[doc = "Cache Control and Status Register."] - pub struct CACHE_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Cache Control and Status Register."] - pub mod cache_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CACHE_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CACHE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_ENR { - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - DIS, - #[doc = "Cache Enabled."] - EN, - } - impl CACHE_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CACHE_ENR::DIS => false, - CACHE_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CACHE_ENR { - match value { - false => CACHE_ENR::DIS, - true => CACHE_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CACHE_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == CACHE_ENR::EN - } - } - #[doc = "Possible values of the field `CACHE_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_RDYR { - #[doc = "Not Ready."] - NOTREADY, - #[doc = "Ready."] - READY, - } - impl CACHE_RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CACHE_RDYR::NOTREADY => false, - CACHE_RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CACHE_RDYR { - match value { - false => CACHE_RDYR::NOTREADY, - true => CACHE_RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `NOTREADY`"] - #[inline] - pub fn is_not_ready(&self) -> bool { - *self == CACHE_RDYR::NOTREADY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == CACHE_RDYR::READY - } - } - #[doc = "Values that can be written to the field `CACHE_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CACHE_ENW { - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - DIS, - #[doc = "Cache Enabled."] - EN, - } - impl CACHE_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CACHE_ENW::DIS => false, - CACHE_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CACHE_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CACHE_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CACHE_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Cache Bypassed. Instruction data is stored in the line fill buffer but is not written to main cache memory array."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CACHE_ENW::DIS) - } - #[doc = "Cache Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(CACHE_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Cache Enable. Controls whether the cache is bypassed or is in use. Changing the state of this bit will cause the instruction cache to be flushed and its contents invalidated."] - #[inline] - pub fn cache_en(&self) -> CACHE_ENR { - CACHE_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Cache Ready flag. Cleared by hardware when at any time the cache as a whole is invalidated (including a system reset). When this bit is 0, the cache is effectively in bypass mode (instruction fetches will come from main memory or from the line fill buffer). Set by hardware when the invalidate operation is complete and the cache is ready."] - #[inline] - pub fn cache_rdy(&self) -> CACHE_RDYR { - CACHE_RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Cache Enable. Controls whether the cache is bypassed or is in use. Changing the state of this bit will cause the instruction cache to be flushed and its contents invalidated."] - #[inline] - pub fn cache_en(&mut self) -> _CACHE_ENW { - _CACHE_ENW { w: self } - } - } - } - #[doc = "Invalidate All Registers."] - pub struct INVALIDATE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Invalidate All Registers."] - pub mod invalidate { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INVALIDATE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } -} -#[doc = "Instruction Cache Controller Registers 1"] -pub struct ICC1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for ICC1 {} -impl ICC1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const icc0::RegisterBlock { - 0x4002_f000 as *const _ - } -} -impl Deref for ICC1 { - type Target = icc0::RegisterBlock; - fn deref(&self) -> &icc0::RegisterBlock { - unsafe { &*ICC1::ptr() } - } -} -#[doc = "Function Control."] -pub struct FCR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for FCR {} -impl FCR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const fcr::RegisterBlock { - 0x4000_0800 as *const _ - } -} -impl Deref for FCR { - type Target = fcr::RegisterBlock; - fn deref(&self) -> &fcr::RegisterBlock { - unsafe { &*FCR::ptr() } - } -} -#[doc = "Function Control."] -pub mod fcr { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Register 0."] - pub reg0: REG0, - #[doc = "0x04 - Register 1."] - pub reg1: REG1, - #[doc = "0x08 - Register 2."] - pub reg2: REG2, - #[doc = "0x0c - Register 3."] - pub reg3: REG3, - } - #[doc = "Register 0."] - pub struct REG0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register 0."] - pub mod reg0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::REG0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `USBRCKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBRCKSELR { - #[doc = "Generated clock from system clock."] - SYS, - #[doc = "Digital clock from a GPIO."] - DIG, - } - impl USBRCKSELR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBRCKSELR::SYS => false, - USBRCKSELR::DIG => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBRCKSELR { - match value { - false => USBRCKSELR::SYS, - true => USBRCKSELR::DIG, - } - } - #[doc = "Checks if the value of the field is `SYS`"] - #[inline] - pub fn is_sys(&self) -> bool { - *self == USBRCKSELR::SYS - } - #[doc = "Checks if the value of the field is `DIG`"] - #[inline] - pub fn is_dig(&self) -> bool { - *self == USBRCKSELR::DIG - } - } - #[doc = "Possible values of the field `I2C0DGEN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C0DGEN0R { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C0DGEN0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C0DGEN0R::DIS => false, - I2C0DGEN0R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C0DGEN0R { - match value { - false => I2C0DGEN0R::DIS, - true => I2C0DGEN0R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2C0DGEN0R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2C0DGEN0R::EN - } - } - #[doc = "Possible values of the field `I2C0DGEN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C0DGEN1R { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C0DGEN1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C0DGEN1R::DIS => false, - I2C0DGEN1R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C0DGEN1R { - match value { - false => I2C0DGEN1R::DIS, - true => I2C0DGEN1R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2C0DGEN1R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2C0DGEN1R::EN - } - } - #[doc = "Possible values of the field `I2C1DGEN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1DGEN0R { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C1DGEN0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C1DGEN0R::DIS => false, - I2C1DGEN0R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C1DGEN0R { - match value { - false => I2C1DGEN0R::DIS, - true => I2C1DGEN0R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2C1DGEN0R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2C1DGEN0R::EN - } - } - #[doc = "Possible values of the field `I2C1DGEN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1DGEN1R { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C1DGEN1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2C1DGEN1R::DIS => false, - I2C1DGEN1R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2C1DGEN1R { - match value { - false => I2C1DGEN1R::DIS, - true => I2C1DGEN1R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2C1DGEN1R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2C1DGEN1R::EN - } - } - #[doc = "Values that can be written to the field `USBRCKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBRCKSELW { - #[doc = "Generated clock from system clock."] - SYS, - #[doc = "Digital clock from a GPIO."] - DIG, - } - impl USBRCKSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBRCKSELW::SYS => false, - USBRCKSELW::DIG => true, - } - } - } - #[doc = r" Proxy"] - pub struct _USBRCKSELW<'a> { - w: &'a mut W, - } - impl<'a> _USBRCKSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBRCKSELW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Generated clock from system clock."] - #[inline] - pub fn sys(self) -> &'a mut W { - self.variant(USBRCKSELW::SYS) - } - #[doc = "Digital clock from a GPIO."] - #[inline] - pub fn dig(self) -> &'a mut W { - self.variant(USBRCKSELW::DIG) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2C0DGEN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C0DGEN0W { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C0DGEN0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C0DGEN0W::DIS => false, - I2C0DGEN0W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C0DGEN0W<'a> { - w: &'a mut W, - } - impl<'a> _I2C0DGEN0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C0DGEN0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Deglitcher disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2C0DGEN0W::DIS) - } - #[doc = "Deglitcher enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2C0DGEN0W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2C0DGEN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C0DGEN1W { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C0DGEN1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C0DGEN1W::DIS => false, - I2C0DGEN1W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C0DGEN1W<'a> { - w: &'a mut W, - } - impl<'a> _I2C0DGEN1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C0DGEN1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Deglitcher disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2C0DGEN1W::DIS) - } - #[doc = "Deglitcher enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2C0DGEN1W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2C1DGEN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1DGEN0W { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C1DGEN0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C1DGEN0W::DIS => false, - I2C1DGEN0W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C1DGEN0W<'a> { - w: &'a mut W, - } - impl<'a> _I2C1DGEN0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C1DGEN0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Deglitcher disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2C1DGEN0W::DIS) - } - #[doc = "Deglitcher enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2C1DGEN0W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2C1DGEN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2C1DGEN1W { - #[doc = "Deglitcher disabled."] - DIS, - #[doc = "Deglitcher enabled."] - EN, - } - impl I2C1DGEN1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2C1DGEN1W::DIS => false, - I2C1DGEN1W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2C1DGEN1W<'a> { - w: &'a mut W, - } - impl<'a> _I2C1DGEN1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2C1DGEN1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Deglitcher disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2C1DGEN1W::DIS) - } - #[doc = "Deglitcher enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2C1DGEN1W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 16 - USB External Core Clock Select."] - #[inline] - pub fn usbrcksel(&self) -> USBRCKSELR { - USBRCKSELR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - I2C0 SDA Pad Deglitcher enable."] - #[inline] - pub fn i2c0dgen0(&self) -> I2C0DGEN0R { - I2C0DGEN0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - I2C0 SCL Pad Deglitcher enable."] - #[inline] - pub fn i2c0dgen1(&self) -> I2C0DGEN1R { - I2C0DGEN1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 22 - I2C1 SDA Pad Deglitcher enable."] - #[inline] - pub fn i2c1dgen0(&self) -> I2C1DGEN0R { - I2C1DGEN0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - I2C1 SCL Pad Deglitcher enable."] - #[inline] - pub fn i2c1dgen1(&self) -> I2C1DGEN1R { - I2C1DGEN1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 16 - USB External Core Clock Select."] - #[inline] - pub fn usbrcksel(&mut self) -> _USBRCKSELW { - _USBRCKSELW { w: self } - } - #[doc = "Bit 20 - I2C0 SDA Pad Deglitcher enable."] - #[inline] - pub fn i2c0dgen0(&mut self) -> _I2C0DGEN0W { - _I2C0DGEN0W { w: self } - } - #[doc = "Bit 21 - I2C0 SCL Pad Deglitcher enable."] - #[inline] - pub fn i2c0dgen1(&mut self) -> _I2C0DGEN1W { - _I2C0DGEN1W { w: self } - } - #[doc = "Bit 22 - I2C1 SDA Pad Deglitcher enable."] - #[inline] - pub fn i2c1dgen0(&mut self) -> _I2C1DGEN0W { - _I2C1DGEN0W { w: self } - } - #[doc = "Bit 23 - I2C1 SCL Pad Deglitcher enable."] - #[inline] - pub fn i2c1dgen1(&mut self) -> _I2C1DGEN1W { - _I2C1DGEN1W { w: self } - } - } - } - #[doc = "Register 1."] - pub struct REG1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register 1."] - pub mod reg1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::REG1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ACEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ACENR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl ACENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ACENR::DIS => false, - ACENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ACENR { - match value { - false => ACENR::DIS, - true => ACENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ACENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ACENR::EN - } - } - #[doc = "Possible values of the field `ACRUN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ACRUNR { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl ACRUNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ACRUNR::NOT => false, - ACRUNR::RUN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ACRUNR { - match value { - false => ACRUNR::NOT, - true => ACRUNR::RUN, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == ACRUNR::NOT - } - #[doc = "Checks if the value of the field is `RUN`"] - #[inline] - pub fn is_run(&self) -> bool { - *self == ACRUNR::RUN - } - } - #[doc = r" Value of the field"] - pub struct LDTRMR { - bits: bool, - } - impl LDTRMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `GAININV`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GAININVR { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl GAININVR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - GAININVR::NOT => false, - GAININVR::RUN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> GAININVR { - match value { - false => GAININVR::NOT, - true => GAININVR::RUN, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == GAININVR::NOT - } - #[doc = "Checks if the value of the field is `RUN`"] - #[inline] - pub fn is_run(&self) -> bool { - *self == GAININVR::RUN - } - } - #[doc = "Possible values of the field `ATOMIC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ATOMICR { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl ATOMICR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ATOMICR::NOT => false, - ATOMICR::RUN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ATOMICR { - match value { - false => ATOMICR::NOT, - true => ATOMICR::RUN, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == ATOMICR::NOT - } - #[doc = "Checks if the value of the field is `RUN`"] - #[inline] - pub fn is_run(&self) -> bool { - *self == ATOMICR::RUN - } - } - #[doc = r" Value of the field"] - pub struct MUR { - bits: u16, - } - impl MUR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = "Values that can be written to the field `ACEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ACENW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl ACENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ACENW::DIS => false, - ACENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ACENW<'a> { - w: &'a mut W, - } - impl<'a> _ACENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ACENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ACENW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ACENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ACRUN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ACRUNW { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl ACRUNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ACRUNW::NOT => false, - ACRUNW::RUN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ACRUNW<'a> { - w: &'a mut W, - } - impl<'a> _ACRUNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ACRUNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Running."] - #[inline] - pub fn not(self) -> &'a mut W { - self.variant(ACRUNW::NOT) - } - #[doc = "Running."] - #[inline] - pub fn run(self) -> &'a mut W { - self.variant(ACRUNW::RUN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LDTRMW<'a> { - w: &'a mut W, - } - impl<'a> _LDTRMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `GAININV`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum GAININVW { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl GAININVW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - GAININVW::NOT => false, - GAININVW::RUN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _GAININVW<'a> { - w: &'a mut W, - } - impl<'a> _GAININVW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: GAININVW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Running."] - #[inline] - pub fn not(self) -> &'a mut W { - self.variant(GAININVW::NOT) - } - #[doc = "Running."] - #[inline] - pub fn run(self) -> &'a mut W { - self.variant(GAININVW::RUN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ATOMIC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ATOMICW { - #[doc = "Not Running."] - NOT, - #[doc = "Running."] - RUN, - } - impl ATOMICW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ATOMICW::NOT => false, - ATOMICW::RUN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ATOMICW<'a> { - w: &'a mut W, - } - impl<'a> _ATOMICW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ATOMICW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not Running."] - #[inline] - pub fn not(self) -> &'a mut W { - self.variant(ATOMICW::NOT) - } - #[doc = "Running."] - #[inline] - pub fn run(self) -> &'a mut W { - self.variant(ATOMICW::RUN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MUW<'a> { - w: &'a mut W, - } - impl<'a> _MUW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Auto-calibration Enable."] - #[inline] - pub fn acen(&self) -> ACENR { - ACENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Autocalibration Run."] - #[inline] - pub fn acrun(&self) -> ACRUNR { - ACRUNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Load Trim."] - #[inline] - pub fn ldtrm(&self) -> LDTRMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LDTRMR { bits } - } - #[doc = "Bit 3 - Invert Gain."] - #[inline] - pub fn gaininv(&self) -> GAININVR { - GAININVR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Atomic mode."] - #[inline] - pub fn atomic(&self) -> ATOMICR { - ATOMICR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:19 - MU value."] - #[inline] - pub fn mu(&self) -> MUR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MUR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Auto-calibration Enable."] - #[inline] - pub fn acen(&mut self) -> _ACENW { - _ACENW { w: self } - } - #[doc = "Bit 1 - Autocalibration Run."] - #[inline] - pub fn acrun(&mut self) -> _ACRUNW { - _ACRUNW { w: self } - } - #[doc = "Bit 2 - Load Trim."] - #[inline] - pub fn ldtrm(&mut self) -> _LDTRMW { - _LDTRMW { w: self } - } - #[doc = "Bit 3 - Invert Gain."] - #[inline] - pub fn gaininv(&mut self) -> _GAININVW { - _GAININVW { w: self } - } - #[doc = "Bit 4 - Atomic mode."] - #[inline] - pub fn atomic(&mut self) -> _ATOMICW { - _ATOMICW { w: self } - } - #[doc = "Bits 8:19 - MU value."] - #[inline] - pub fn mu(&mut self) -> _MUW { - _MUW { w: self } - } - } - } - #[doc = "Register 2."] - pub struct REG2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register 2."] - pub mod reg2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::REG2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INITTRMR { - bits: u16, - } - impl INITTRMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MINTRMR { - bits: u16, - } - impl MINTRMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MAXTRMR { - bits: u16, - } - impl MAXTRMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INITTRMW<'a> { - w: &'a mut W, - } - impl<'a> _INITTRMW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MINTRMW<'a> { - w: &'a mut W, - } - impl<'a> _MINTRMW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MAXTRMW<'a> { - w: &'a mut W, - } - impl<'a> _MAXTRMW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:8 - Initial Trim Setting."] - #[inline] - pub fn inittrm(&self) -> INITTRMR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - INITTRMR { bits } - } - #[doc = "Bits 10:18 - Minimum Trim Setting."] - #[inline] - pub fn mintrm(&self) -> MINTRMR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MINTRMR { bits } - } - #[doc = "Bits 20:28 - Maximum Trim Setting."] - #[inline] - pub fn maxtrm(&self) -> MAXTRMR { - let bits = { - const MASK: u16 = 0x01ff; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - MAXTRMR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:8 - Initial Trim Setting."] - #[inline] - pub fn inittrm(&mut self) -> _INITTRMW { - _INITTRMW { w: self } - } - #[doc = "Bits 10:18 - Minimum Trim Setting."] - #[inline] - pub fn mintrm(&mut self) -> _MINTRMW { - _MINTRMW { w: self } - } - #[doc = "Bits 20:28 - Maximum Trim Setting."] - #[inline] - pub fn maxtrm(&mut self) -> _MAXTRMW { - _MAXTRMW { w: self } - } - } - } - #[doc = "Register 3."] - pub struct REG3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register 3."] - pub mod reg3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::REG3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DONECNTR { - bits: u8, - } - impl DONECNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DONECNTW<'a> { - w: &'a mut W, - } - impl<'a> _DONECNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Auto-callibration Done Counter Setting."] - #[inline] - pub fn donecnt(&self) -> DONECNTR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DONECNTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Auto-callibration Done Counter Setting."] - #[inline] - pub fn donecnt(&mut self) -> _DONECNTW { - _DONECNTW { w: self } - } - } - } -} -#[doc = "1-Wire Master Interface."] -pub struct OWM { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for OWM {} -impl OWM { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const owm::RegisterBlock { - 0x4003_d000 as *const _ - } -} -impl Deref for OWM { - type Target = owm::RegisterBlock; - fn deref(&self) -> &owm::RegisterBlock { - unsafe { &*OWM::ptr() } - } -} -#[doc = "1-Wire Master Interface."] -pub mod owm { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - 1-Wire Master Configuration."] - pub cfg: CFG, - #[doc = "0x04 - 1-Wire Master Clock Divisor."] - pub clk_div_1us: CLK_DIV_1US, - #[doc = "0x08 - 1-Wire Master Control/Status."] - pub ctrl_stat: CTRL_STAT, - #[doc = "0x0c - 1-Wire Master Data Buffer."] - pub data: DATA, - #[doc = "0x10 - 1-Wire Master Interrupt Flags."] - pub intfl: INTFL, - #[doc = "0x14 - 1-Wire Master Interrupt Enables."] - pub inten: INTEN, - } - #[doc = "1-Wire Master Configuration."] - pub struct CFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Configuration."] - pub mod cfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CFG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct LONG_LINE_MODER { - bits: bool, - } - impl LONG_LINE_MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FORCE_PRES_DETR { - bits: bool, - } - impl FORCE_PRES_DETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BIT_BANG_ENR { - bits: bool, - } - impl BIT_BANG_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EXT_PULLUP_MODER { - bits: bool, - } - impl EXT_PULLUP_MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EXT_PULLUP_ENABLER { - bits: bool, - } - impl EXT_PULLUP_ENABLER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SINGLE_BIT_MODER { - bits: bool, - } - impl SINGLE_BIT_MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OVERDRIVER { - bits: bool, - } - impl OVERDRIVER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INT_PULLUP_ENABLER { - bits: bool, - } - impl INT_PULLUP_ENABLER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _LONG_LINE_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _LONG_LINE_MODEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FORCE_PRES_DETW<'a> { - w: &'a mut W, - } - impl<'a> _FORCE_PRES_DETW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BIT_BANG_ENW<'a> { - w: &'a mut W, - } - impl<'a> _BIT_BANG_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EXT_PULLUP_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _EXT_PULLUP_MODEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EXT_PULLUP_ENABLEW<'a> { - w: &'a mut W, - } - impl<'a> _EXT_PULLUP_ENABLEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SINGLE_BIT_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _SINGLE_BIT_MODEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OVERDRIVEW<'a> { - w: &'a mut W, - } - impl<'a> _OVERDRIVEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INT_PULLUP_ENABLEW<'a> { - w: &'a mut W, - } - impl<'a> _INT_PULLUP_ENABLEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Long Line Mode."] - #[inline] - pub fn long_line_mode(&self) -> LONG_LINE_MODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LONG_LINE_MODER { bits } - } - #[doc = "Bit 1 - Force Line During Presence Detect."] - #[inline] - pub fn force_pres_det(&self) -> FORCE_PRES_DETR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FORCE_PRES_DETR { bits } - } - #[doc = "Bit 2 - Bit Bang Enable."] - #[inline] - pub fn bit_bang_en(&self) -> BIT_BANG_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BIT_BANG_ENR { bits } - } - #[doc = "Bit 3 - Provide an extra output control to control an external pullup."] - #[inline] - pub fn ext_pullup_mode(&self) -> EXT_PULLUP_MODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - EXT_PULLUP_MODER { bits } - } - #[doc = "Bit 4 - Enable External Pullup."] - #[inline] - pub fn ext_pullup_enable(&self) -> EXT_PULLUP_ENABLER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - EXT_PULLUP_ENABLER { bits } - } - #[doc = "Bit 5 - Enable Single Bit TX/RX Mode."] - #[inline] - pub fn single_bit_mode(&self) -> SINGLE_BIT_MODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SINGLE_BIT_MODER { bits } - } - #[doc = "Bit 6 - Enables overdrive speed for 1-Wire operations."] - #[inline] - pub fn overdrive(&self) -> OVERDRIVER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OVERDRIVER { bits } - } - #[doc = "Bit 7 - Enable intenral pullup."] - #[inline] - pub fn int_pullup_enable(&self) -> INT_PULLUP_ENABLER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - INT_PULLUP_ENABLER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Long Line Mode."] - #[inline] - pub fn long_line_mode(&mut self) -> _LONG_LINE_MODEW { - _LONG_LINE_MODEW { w: self } - } - #[doc = "Bit 1 - Force Line During Presence Detect."] - #[inline] - pub fn force_pres_det(&mut self) -> _FORCE_PRES_DETW { - _FORCE_PRES_DETW { w: self } - } - #[doc = "Bit 2 - Bit Bang Enable."] - #[inline] - pub fn bit_bang_en(&mut self) -> _BIT_BANG_ENW { - _BIT_BANG_ENW { w: self } - } - #[doc = "Bit 3 - Provide an extra output control to control an external pullup."] - #[inline] - pub fn ext_pullup_mode(&mut self) -> _EXT_PULLUP_MODEW { - _EXT_PULLUP_MODEW { w: self } - } - #[doc = "Bit 4 - Enable External Pullup."] - #[inline] - pub fn ext_pullup_enable(&mut self) -> _EXT_PULLUP_ENABLEW { - _EXT_PULLUP_ENABLEW { w: self } - } - #[doc = "Bit 5 - Enable Single Bit TX/RX Mode."] - #[inline] - pub fn single_bit_mode(&mut self) -> _SINGLE_BIT_MODEW { - _SINGLE_BIT_MODEW { w: self } - } - #[doc = "Bit 6 - Enables overdrive speed for 1-Wire operations."] - #[inline] - pub fn overdrive(&mut self) -> _OVERDRIVEW { - _OVERDRIVEW { w: self } - } - #[doc = "Bit 7 - Enable intenral pullup."] - #[inline] - pub fn int_pullup_enable(&mut self) -> _INT_PULLUP_ENABLEW { - _INT_PULLUP_ENABLEW { w: self } - } - } - } - #[doc = "1-Wire Master Clock Divisor."] - pub struct CLK_DIV_1US { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Clock Divisor."] - pub mod clk_div_1us { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLK_DIV_1US { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DIVISORR { - bits: u8, - } - impl DIVISORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DIVISORW<'a> { - w: &'a mut W, - } - impl<'a> _DIVISORW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Clock Divisor for 1Mhz."] - #[inline] - pub fn divisor(&self) -> DIVISORR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DIVISORR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Clock Divisor for 1Mhz."] - #[inline] - pub fn divisor(&mut self) -> _DIVISORW { - _DIVISORW { w: self } - } - } - } - #[doc = "1-Wire Master Control/Status."] - pub struct CTRL_STAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Control/Status."] - pub mod ctrl_stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL_STAT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct START_OW_RESETR { - bits: bool, - } - impl START_OW_RESETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SRA_MODER { - bits: bool, - } - impl SRA_MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BIT_BANG_OER { - bits: bool, - } - impl BIT_BANG_OER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OW_INPUTR { - bits: bool, - } - impl OW_INPUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PRESENCE_DETECTR { - bits: bool, - } - impl PRESENCE_DETECTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _START_OW_RESETW<'a> { - w: &'a mut W, - } - impl<'a> _START_OW_RESETW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SRA_MODEW<'a> { - w: &'a mut W, - } - impl<'a> _SRA_MODEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BIT_BANG_OEW<'a> { - w: &'a mut W, - } - impl<'a> _BIT_BANG_OEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Start OW Reset."] - #[inline] - pub fn start_ow_reset(&self) -> START_OW_RESETR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - START_OW_RESETR { bits } - } - #[doc = "Bit 1 - SRA Mode."] - #[inline] - pub fn sra_mode(&self) -> SRA_MODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SRA_MODER { bits } - } - #[doc = "Bit 2 - Bit Bang Output Enable."] - #[inline] - pub fn bit_bang_oe(&self) -> BIT_BANG_OER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BIT_BANG_OER { bits } - } - #[doc = "Bit 3 - OW Input State."] - #[inline] - pub fn ow_input(&self) -> OW_INPUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OW_INPUTR { bits } - } - #[doc = "Bit 7 - Presence Pulse Detected."] - #[inline] - pub fn presence_detect(&self) -> PRESENCE_DETECTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PRESENCE_DETECTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Start OW Reset."] - #[inline] - pub fn start_ow_reset(&mut self) -> _START_OW_RESETW { - _START_OW_RESETW { w: self } - } - #[doc = "Bit 1 - SRA Mode."] - #[inline] - pub fn sra_mode(&mut self) -> _SRA_MODEW { - _SRA_MODEW { w: self } - } - #[doc = "Bit 2 - Bit Bang Output Enable."] - #[inline] - pub fn bit_bang_oe(&mut self) -> _BIT_BANG_OEW { - _BIT_BANG_OEW { w: self } - } - } - } - #[doc = "1-Wire Master Data Buffer."] - pub struct DATA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Data Buffer."] - pub mod data { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DATA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_RXR { - bits: u8, - } - impl TX_RXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_RXW<'a> { - w: &'a mut W, - } - impl<'a> _TX_RXW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - TX/RX Buffer."] - #[inline] - pub fn tx_rx(&self) -> TX_RXR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_RXR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - TX/RX Buffer."] - #[inline] - pub fn tx_rx(&mut self) -> _TX_RXW { - _TX_RXW { w: self } - } - } - } - #[doc = "1-Wire Master Interrupt Flags."] - pub struct INTFL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Interrupt Flags."] - pub mod intfl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTFL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct OW_RESET_DONER { - bits: bool, - } - impl OW_RESET_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_DATA_EMPTYR { - bits: bool, - } - impl TX_DATA_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_DATA_READYR { - bits: bool, - } - impl RX_DATA_READYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LINE_SHORTR { - bits: bool, - } - impl LINE_SHORTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LINE_LOWR { - bits: bool, - } - impl LINE_LOWR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _OW_RESET_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _OW_RESET_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_DATA_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_DATA_EMPTYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_DATA_READYW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DATA_READYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LINE_SHORTW<'a> { - w: &'a mut W, - } - impl<'a> _LINE_SHORTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LINE_LOWW<'a> { - w: &'a mut W, - } - impl<'a> _LINE_LOWW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - OW Reset Sequence Completed."] - #[inline] - pub fn ow_reset_done(&self) -> OW_RESET_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OW_RESET_DONER { bits } - } - #[doc = "Bit 1 - TX Data Empty Interrupt Flag."] - #[inline] - pub fn tx_data_empty(&self) -> TX_DATA_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_DATA_EMPTYR { bits } - } - #[doc = "Bit 2 - RX Data Ready Interrupt Flag"] - #[inline] - pub fn rx_data_ready(&self) -> RX_DATA_READYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_DATA_READYR { bits } - } - #[doc = "Bit 3 - OW Line Short Detected Interrupt Flag."] - #[inline] - pub fn line_short(&self) -> LINE_SHORTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LINE_SHORTR { bits } - } - #[doc = "Bit 4 - OW Line Low Detected Interrupt Flag."] - #[inline] - pub fn line_low(&self) -> LINE_LOWR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LINE_LOWR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - OW Reset Sequence Completed."] - #[inline] - pub fn ow_reset_done(&mut self) -> _OW_RESET_DONEW { - _OW_RESET_DONEW { w: self } - } - #[doc = "Bit 1 - TX Data Empty Interrupt Flag."] - #[inline] - pub fn tx_data_empty(&mut self) -> _TX_DATA_EMPTYW { - _TX_DATA_EMPTYW { w: self } - } - #[doc = "Bit 2 - RX Data Ready Interrupt Flag"] - #[inline] - pub fn rx_data_ready(&mut self) -> _RX_DATA_READYW { - _RX_DATA_READYW { w: self } - } - #[doc = "Bit 3 - OW Line Short Detected Interrupt Flag."] - #[inline] - pub fn line_short(&mut self) -> _LINE_SHORTW { - _LINE_SHORTW { w: self } - } - #[doc = "Bit 4 - OW Line Low Detected Interrupt Flag."] - #[inline] - pub fn line_low(&mut self) -> _LINE_LOWW { - _LINE_LOWW { w: self } - } - } - } - #[doc = "1-Wire Master Interrupt Enables."] - pub struct INTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "1-Wire Master Interrupt Enables."] - pub mod inten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct OW_RESET_DONER { - bits: bool, - } - impl OW_RESET_DONER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_DATA_EMPTYR { - bits: bool, - } - impl TX_DATA_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_DATA_READYR { - bits: bool, - } - impl RX_DATA_READYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LINE_SHORTR { - bits: bool, - } - impl LINE_SHORTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LINE_LOWR { - bits: bool, - } - impl LINE_LOWR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _OW_RESET_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _OW_RESET_DONEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_DATA_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_DATA_EMPTYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_DATA_READYW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DATA_READYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LINE_SHORTW<'a> { - w: &'a mut W, - } - impl<'a> _LINE_SHORTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LINE_LOWW<'a> { - w: &'a mut W, - } - impl<'a> _LINE_LOWW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - OW Reset Sequence Completed."] - #[inline] - pub fn ow_reset_done(&self) -> OW_RESET_DONER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - OW_RESET_DONER { bits } - } - #[doc = "Bit 1 - Tx Data Empty Interrupt Enable."] - #[inline] - pub fn tx_data_empty(&self) -> TX_DATA_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_DATA_EMPTYR { bits } - } - #[doc = "Bit 2 - Rx Data Ready Interrupt Enable."] - #[inline] - pub fn rx_data_ready(&self) -> RX_DATA_READYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_DATA_READYR { bits } - } - #[doc = "Bit 3 - OW Line Short Detected Interrupt Enable."] - #[inline] - pub fn line_short(&self) -> LINE_SHORTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LINE_SHORTR { bits } - } - #[doc = "Bit 4 - OW Line Low Detected Interrupt Enable."] - #[inline] - pub fn line_low(&self) -> LINE_LOWR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LINE_LOWR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - OW Reset Sequence Completed."] - #[inline] - pub fn ow_reset_done(&mut self) -> _OW_RESET_DONEW { - _OW_RESET_DONEW { w: self } - } - #[doc = "Bit 1 - Tx Data Empty Interrupt Enable."] - #[inline] - pub fn tx_data_empty(&mut self) -> _TX_DATA_EMPTYW { - _TX_DATA_EMPTYW { w: self } - } - #[doc = "Bit 2 - Rx Data Ready Interrupt Enable."] - #[inline] - pub fn rx_data_ready(&mut self) -> _RX_DATA_READYW { - _RX_DATA_READYW { w: self } - } - #[doc = "Bit 3 - OW Line Short Detected Interrupt Enable."] - #[inline] - pub fn line_short(&mut self) -> _LINE_SHORTW { - _LINE_SHORTW { w: self } - } - #[doc = "Bit 4 - OW Line Low Detected Interrupt Enable."] - #[inline] - pub fn line_low(&mut self) -> _LINE_LOWW { - _LINE_LOWW { w: self } - } - } - } -} -#[doc = "Pulse Train Generation"] -pub struct PTG { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PTG {} -impl PTG { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const ptg::RegisterBlock { - 0x4003_c000 as *const _ - } -} -impl Deref for PTG { - type Target = ptg::RegisterBlock; - fn deref(&self) -> &ptg::RegisterBlock { - unsafe { &*PTG::ptr() } - } -} -#[doc = "Pulse Train Generation"] -pub mod ptg { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Global Enable/Disable Controls for All Pulse Trains"] - pub enable: ENABLE, - #[doc = "0x04 - Global Resync (All Pulse Trains) Control"] - pub resync: RESYNC, - #[doc = "0x08 - Pulse Train Interrupt Flags"] - pub intfl: INTFL, - #[doc = "0x0c - Pulse Train Interrupt Enable/Disable"] - pub inten: INTEN, - #[doc = "0x10 - Pulse Train Global Safe Enable."] - pub safe_en: SAFE_EN, - #[doc = "0x14 - Pulse Train Global Safe Disable."] - pub safe_dis: SAFE_DIS, - } - #[doc = "Global Enable/Disable Controls for All Pulse Trains"] - pub struct ENABLE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Global Enable/Disable Controls for All Pulse Trains"] - pub mod enable { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ENABLE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct PT0R { - bits: bool, - } - impl PT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT1R { - bits: bool, - } - impl PT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT2R { - bits: bool, - } - impl PT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT3R { - bits: bool, - } - impl PT3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT4R { - bits: bool, - } - impl PT4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT5R { - bits: bool, - } - impl PT5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT6R { - bits: bool, - } - impl PT6R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT7R { - bits: bool, - } - impl PT7R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT8R { - bits: bool, - } - impl PT8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT9R { - bits: bool, - } - impl PT9R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT10R { - bits: bool, - } - impl PT10R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT11R { - bits: bool, - } - impl PT11R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT12R { - bits: bool, - } - impl PT12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT13R { - bits: bool, - } - impl PT13R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT14R { - bits: bool, - } - impl PT14R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT15R { - bits: bool, - } - impl PT15R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Enable/Disable control for PT0"] - #[inline] - pub fn pt0(&self) -> PT0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT0R { bits } - } - #[doc = "Bit 1 - Enable/Disable control for PT1"] - #[inline] - pub fn pt1(&self) -> PT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT1R { bits } - } - #[doc = "Bit 2 - Enable/Disable control for PT2"] - #[inline] - pub fn pt2(&self) -> PT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT2R { bits } - } - #[doc = "Bit 3 - Enable/Disable control for PT3"] - #[inline] - pub fn pt3(&self) -> PT3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT3R { bits } - } - #[doc = "Bit 4 - Enable/Disable control for PT4"] - #[inline] - pub fn pt4(&self) -> PT4R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT4R { bits } - } - #[doc = "Bit 5 - Enable/Disable control for PT5"] - #[inline] - pub fn pt5(&self) -> PT5R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT5R { bits } - } - #[doc = "Bit 6 - Enable/Disable control for PT6"] - #[inline] - pub fn pt6(&self) -> PT6R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT6R { bits } - } - #[doc = "Bit 7 - Enable/Disable control for PT7"] - #[inline] - pub fn pt7(&self) -> PT7R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT7R { bits } - } - #[doc = "Bit 8 - Enable/Disable control for PT8"] - #[inline] - pub fn pt8(&self) -> PT8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT8R { bits } - } - #[doc = "Bit 9 - Enable/Disable control for PT9"] - #[inline] - pub fn pt9(&self) -> PT9R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT9R { bits } - } - #[doc = "Bit 10 - Enable/Disable control for PT10"] - #[inline] - pub fn pt10(&self) -> PT10R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT10R { bits } - } - #[doc = "Bit 11 - Enable/Disable control for PT11"] - #[inline] - pub fn pt11(&self) -> PT11R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT11R { bits } - } - #[doc = "Bit 12 - Enable/Disable control for PT12"] - #[inline] - pub fn pt12(&self) -> PT12R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT12R { bits } - } - #[doc = "Bit 13 - Enable/Disable control for PT13"] - #[inline] - pub fn pt13(&self) -> PT13R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT13R { bits } - } - #[doc = "Bit 14 - Enable/Disable control for PT14"] - #[inline] - pub fn pt14(&self) -> PT14R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT14R { bits } - } - #[doc = "Bit 15 - Enable/Disable control for PT15"] - #[inline] - pub fn pt15(&self) -> PT15R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT15R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable/Disable control for PT0"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1 - Enable/Disable control for PT1"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2 - Enable/Disable control for PT2"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3 - Enable/Disable control for PT3"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4 - Enable/Disable control for PT4"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5 - Enable/Disable control for PT5"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6 - Enable/Disable control for PT6"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7 - Enable/Disable control for PT7"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8 - Enable/Disable control for PT8"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9 - Enable/Disable control for PT9"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10 - Enable/Disable control for PT10"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11 - Enable/Disable control for PT11"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12 - Enable/Disable control for PT12"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13 - Enable/Disable control for PT13"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14 - Enable/Disable control for PT14"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15 - Enable/Disable control for PT15"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } - #[doc = "Global Resync (All Pulse Trains) Control"] - pub struct RESYNC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Global Resync (All Pulse Trains) Control"] - pub mod resync { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RESYNC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct PT0R { - bits: bool, - } - impl PT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT1R { - bits: bool, - } - impl PT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT2R { - bits: bool, - } - impl PT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT3R { - bits: bool, - } - impl PT3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT4R { - bits: bool, - } - impl PT4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT5R { - bits: bool, - } - impl PT5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT6R { - bits: bool, - } - impl PT6R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT7R { - bits: bool, - } - impl PT7R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT8R { - bits: bool, - } - impl PT8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT9R { - bits: bool, - } - impl PT9R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT10R { - bits: bool, - } - impl PT10R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT11R { - bits: bool, - } - impl PT11R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT12R { - bits: bool, - } - impl PT12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT13R { - bits: bool, - } - impl PT13R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT14R { - bits: bool, - } - impl PT14R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT15R { - bits: bool, - } - impl PT15R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Resync control for PT0"] - #[inline] - pub fn pt0(&self) -> PT0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT0R { bits } - } - #[doc = "Bit 1 - Resync control for PT1"] - #[inline] - pub fn pt1(&self) -> PT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT1R { bits } - } - #[doc = "Bit 2 - Resync control for PT2"] - #[inline] - pub fn pt2(&self) -> PT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT2R { bits } - } - #[doc = "Bit 3 - Resync control for PT3"] - #[inline] - pub fn pt3(&self) -> PT3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT3R { bits } - } - #[doc = "Bit 4 - Resync control for PT4"] - #[inline] - pub fn pt4(&self) -> PT4R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT4R { bits } - } - #[doc = "Bit 5 - Resync control for PT5"] - #[inline] - pub fn pt5(&self) -> PT5R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT5R { bits } - } - #[doc = "Bit 6 - Resync control for PT6"] - #[inline] - pub fn pt6(&self) -> PT6R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT6R { bits } - } - #[doc = "Bit 7 - Resync control for PT7"] - #[inline] - pub fn pt7(&self) -> PT7R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT7R { bits } - } - #[doc = "Bit 8 - Resync control for PT8"] - #[inline] - pub fn pt8(&self) -> PT8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT8R { bits } - } - #[doc = "Bit 9 - Resync control for PT9"] - #[inline] - pub fn pt9(&self) -> PT9R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT9R { bits } - } - #[doc = "Bit 10 - Resync control for PT10"] - #[inline] - pub fn pt10(&self) -> PT10R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT10R { bits } - } - #[doc = "Bit 11 - Resync control for PT11"] - #[inline] - pub fn pt11(&self) -> PT11R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT11R { bits } - } - #[doc = "Bit 12 - Resync control for PT12"] - #[inline] - pub fn pt12(&self) -> PT12R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT12R { bits } - } - #[doc = "Bit 13 - Resync control for PT13"] - #[inline] - pub fn pt13(&self) -> PT13R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT13R { bits } - } - #[doc = "Bit 14 - Resync control for PT14"] - #[inline] - pub fn pt14(&self) -> PT14R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT14R { bits } - } - #[doc = "Bit 15 - Resync control for PT15"] - #[inline] - pub fn pt15(&self) -> PT15R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT15R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Resync control for PT0"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1 - Resync control for PT1"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2 - Resync control for PT2"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3 - Resync control for PT3"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4 - Resync control for PT4"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5 - Resync control for PT5"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6 - Resync control for PT6"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7 - Resync control for PT7"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8 - Resync control for PT8"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9 - Resync control for PT9"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10 - Resync control for PT10"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11 - Resync control for PT11"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12 - Resync control for PT12"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13 - Resync control for PT13"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14 - Resync control for PT14"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15 - Resync control for PT15"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } - #[doc = "Pulse Train Interrupt Flags"] - pub struct INTFL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Interrupt Flags"] - pub mod intfl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTFL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct PT0R { - bits: bool, - } - impl PT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT1R { - bits: bool, - } - impl PT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT2R { - bits: bool, - } - impl PT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT3R { - bits: bool, - } - impl PT3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT4R { - bits: bool, - } - impl PT4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT5R { - bits: bool, - } - impl PT5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT6R { - bits: bool, - } - impl PT6R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT7R { - bits: bool, - } - impl PT7R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT8R { - bits: bool, - } - impl PT8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT9R { - bits: bool, - } - impl PT9R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT10R { - bits: bool, - } - impl PT10R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT11R { - bits: bool, - } - impl PT11R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT12R { - bits: bool, - } - impl PT12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT13R { - bits: bool, - } - impl PT13R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT14R { - bits: bool, - } - impl PT14R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT15R { - bits: bool, - } - impl PT15R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Pulse Train 0 Stopped Interrupt Flag"] - #[inline] - pub fn pt0(&self) -> PT0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT0R { bits } - } - #[doc = "Bit 1 - Pulse Train 1 Stopped Interrupt Flag"] - #[inline] - pub fn pt1(&self) -> PT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT1R { bits } - } - #[doc = "Bit 2 - Pulse Train 2 Stopped Interrupt Flag"] - #[inline] - pub fn pt2(&self) -> PT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT2R { bits } - } - #[doc = "Bit 3 - Pulse Train 3 Stopped Interrupt Flag"] - #[inline] - pub fn pt3(&self) -> PT3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT3R { bits } - } - #[doc = "Bit 4 - Pulse Train 4 Stopped Interrupt Flag"] - #[inline] - pub fn pt4(&self) -> PT4R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT4R { bits } - } - #[doc = "Bit 5 - Pulse Train 5 Stopped Interrupt Flag"] - #[inline] - pub fn pt5(&self) -> PT5R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT5R { bits } - } - #[doc = "Bit 6 - Pulse Train 6 Stopped Interrupt Flag"] - #[inline] - pub fn pt6(&self) -> PT6R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT6R { bits } - } - #[doc = "Bit 7 - Pulse Train 7 Stopped Interrupt Flag"] - #[inline] - pub fn pt7(&self) -> PT7R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT7R { bits } - } - #[doc = "Bit 8 - Pulse Train 8 Stopped Interrupt Flag"] - #[inline] - pub fn pt8(&self) -> PT8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT8R { bits } - } - #[doc = "Bit 9 - Pulse Train 9 Stopped Interrupt Flag"] - #[inline] - pub fn pt9(&self) -> PT9R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT9R { bits } - } - #[doc = "Bit 10 - Pulse Train 10 Stopped Interrupt Flag"] - #[inline] - pub fn pt10(&self) -> PT10R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT10R { bits } - } - #[doc = "Bit 11 - Pulse Train 11 Stopped Interrupt Flag"] - #[inline] - pub fn pt11(&self) -> PT11R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT11R { bits } - } - #[doc = "Bit 12 - Pulse Train 12 Stopped Interrupt Flag"] - #[inline] - pub fn pt12(&self) -> PT12R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT12R { bits } - } - #[doc = "Bit 13 - Pulse Train 13 Stopped Interrupt Flag"] - #[inline] - pub fn pt13(&self) -> PT13R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT13R { bits } - } - #[doc = "Bit 14 - Pulse Train 14 Stopped Interrupt Flag"] - #[inline] - pub fn pt14(&self) -> PT14R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT14R { bits } - } - #[doc = "Bit 15 - Pulse Train 15 Stopped Interrupt Flag"] - #[inline] - pub fn pt15(&self) -> PT15R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT15R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Pulse Train 0 Stopped Interrupt Flag"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1 - Pulse Train 1 Stopped Interrupt Flag"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2 - Pulse Train 2 Stopped Interrupt Flag"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3 - Pulse Train 3 Stopped Interrupt Flag"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4 - Pulse Train 4 Stopped Interrupt Flag"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5 - Pulse Train 5 Stopped Interrupt Flag"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6 - Pulse Train 6 Stopped Interrupt Flag"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7 - Pulse Train 7 Stopped Interrupt Flag"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8 - Pulse Train 8 Stopped Interrupt Flag"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9 - Pulse Train 9 Stopped Interrupt Flag"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10 - Pulse Train 10 Stopped Interrupt Flag"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11 - Pulse Train 11 Stopped Interrupt Flag"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12 - Pulse Train 12 Stopped Interrupt Flag"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13 - Pulse Train 13 Stopped Interrupt Flag"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14 - Pulse Train 14 Stopped Interrupt Flag"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15 - Pulse Train 15 Stopped Interrupt Flag"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } - #[doc = "Pulse Train Interrupt Enable/Disable"] - pub struct INTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Interrupt Enable/Disable"] - pub mod inten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct PT0R { - bits: bool, - } - impl PT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT1R { - bits: bool, - } - impl PT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT2R { - bits: bool, - } - impl PT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT3R { - bits: bool, - } - impl PT3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT4R { - bits: bool, - } - impl PT4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT5R { - bits: bool, - } - impl PT5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT6R { - bits: bool, - } - impl PT6R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT7R { - bits: bool, - } - impl PT7R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT8R { - bits: bool, - } - impl PT8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT9R { - bits: bool, - } - impl PT9R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT10R { - bits: bool, - } - impl PT10R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT11R { - bits: bool, - } - impl PT11R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT12R { - bits: bool, - } - impl PT12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT13R { - bits: bool, - } - impl PT13R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT14R { - bits: bool, - } - impl PT14R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT15R { - bits: bool, - } - impl PT15R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Pulse Train 0 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt0(&self) -> PT0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT0R { bits } - } - #[doc = "Bit 1 - Pulse Train 1 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt1(&self) -> PT1R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT1R { bits } - } - #[doc = "Bit 2 - Pulse Train 2 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt2(&self) -> PT2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT2R { bits } - } - #[doc = "Bit 3 - Pulse Train 3 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt3(&self) -> PT3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT3R { bits } - } - #[doc = "Bit 4 - Pulse Train 4 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt4(&self) -> PT4R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT4R { bits } - } - #[doc = "Bit 5 - Pulse Train 5 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt5(&self) -> PT5R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT5R { bits } - } - #[doc = "Bit 6 - Pulse Train 6 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt6(&self) -> PT6R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT6R { bits } - } - #[doc = "Bit 7 - Pulse Train 7 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt7(&self) -> PT7R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT7R { bits } - } - #[doc = "Bit 8 - Pulse Train 8 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt8(&self) -> PT8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT8R { bits } - } - #[doc = "Bit 9 - Pulse Train 9 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt9(&self) -> PT9R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT9R { bits } - } - #[doc = "Bit 10 - Pulse Train 10 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt10(&self) -> PT10R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT10R { bits } - } - #[doc = "Bit 11 - Pulse Train 11 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt11(&self) -> PT11R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT11R { bits } - } - #[doc = "Bit 12 - Pulse Train 12 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt12(&self) -> PT12R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT12R { bits } - } - #[doc = "Bit 13 - Pulse Train 13 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt13(&self) -> PT13R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT13R { bits } - } - #[doc = "Bit 14 - Pulse Train 14 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt14(&self) -> PT14R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT14R { bits } - } - #[doc = "Bit 15 - Pulse Train 15 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt15(&self) -> PT15R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PT15R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Pulse Train 0 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1 - Pulse Train 1 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2 - Pulse Train 2 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3 - Pulse Train 3 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4 - Pulse Train 4 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5 - Pulse Train 5 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6 - Pulse Train 6 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7 - Pulse Train 7 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8 - Pulse Train 8 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9 - Pulse Train 9 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10 - Pulse Train 10 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11 - Pulse Train 11 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12 - Pulse Train 12 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13 - Pulse Train 13 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14 - Pulse Train 14 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15 - Pulse Train 15 Stopped Interrupt Enable/Disable"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } - #[doc = "Pulse Train Global Safe Enable."] - pub struct SAFE_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Global Safe Enable."] - pub mod safe_en { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SAFE_EN { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } - #[doc = "Pulse Train Global Safe Disable."] - pub struct SAFE_DIS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Global Safe Disable."] - pub mod safe_dis { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SAFE_DIS { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _PT0W<'a> { - w: &'a mut W, - } - impl<'a> _PT0W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT1W<'a> { - w: &'a mut W, - } - impl<'a> _PT1W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT2W<'a> { - w: &'a mut W, - } - impl<'a> _PT2W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT3W<'a> { - w: &'a mut W, - } - impl<'a> _PT3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT4W<'a> { - w: &'a mut W, - } - impl<'a> _PT4W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT5W<'a> { - w: &'a mut W, - } - impl<'a> _PT5W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT6W<'a> { - w: &'a mut W, - } - impl<'a> _PT6W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT7W<'a> { - w: &'a mut W, - } - impl<'a> _PT7W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT8W<'a> { - w: &'a mut W, - } - impl<'a> _PT8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT9W<'a> { - w: &'a mut W, - } - impl<'a> _PT9W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT10W<'a> { - w: &'a mut W, - } - impl<'a> _PT10W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT11W<'a> { - w: &'a mut W, - } - impl<'a> _PT11W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT12W<'a> { - w: &'a mut W, - } - impl<'a> _PT12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT13W<'a> { - w: &'a mut W, - } - impl<'a> _PT13W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT14W<'a> { - w: &'a mut W, - } - impl<'a> _PT14W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT15W<'a> { - w: &'a mut W, - } - impl<'a> _PT15W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0"] - #[inline] - pub fn pt0(&mut self) -> _PT0W { - _PT0W { w: self } - } - #[doc = "Bit 1"] - #[inline] - pub fn pt1(&mut self) -> _PT1W { - _PT1W { w: self } - } - #[doc = "Bit 2"] - #[inline] - pub fn pt2(&mut self) -> _PT2W { - _PT2W { w: self } - } - #[doc = "Bit 3"] - #[inline] - pub fn pt3(&mut self) -> _PT3W { - _PT3W { w: self } - } - #[doc = "Bit 4"] - #[inline] - pub fn pt4(&mut self) -> _PT4W { - _PT4W { w: self } - } - #[doc = "Bit 5"] - #[inline] - pub fn pt5(&mut self) -> _PT5W { - _PT5W { w: self } - } - #[doc = "Bit 6"] - #[inline] - pub fn pt6(&mut self) -> _PT6W { - _PT6W { w: self } - } - #[doc = "Bit 7"] - #[inline] - pub fn pt7(&mut self) -> _PT7W { - _PT7W { w: self } - } - #[doc = "Bit 8"] - #[inline] - pub fn pt8(&mut self) -> _PT8W { - _PT8W { w: self } - } - #[doc = "Bit 9"] - #[inline] - pub fn pt9(&mut self) -> _PT9W { - _PT9W { w: self } - } - #[doc = "Bit 10"] - #[inline] - pub fn pt10(&mut self) -> _PT10W { - _PT10W { w: self } - } - #[doc = "Bit 11"] - #[inline] - pub fn pt11(&mut self) -> _PT11W { - _PT11W { w: self } - } - #[doc = "Bit 12"] - #[inline] - pub fn pt12(&mut self) -> _PT12W { - _PT12W { w: self } - } - #[doc = "Bit 13"] - #[inline] - pub fn pt13(&mut self) -> _PT13W { - _PT13W { w: self } - } - #[doc = "Bit 14"] - #[inline] - pub fn pt14(&mut self) -> _PT14W { - _PT14W { w: self } - } - #[doc = "Bit 15"] - #[inline] - pub fn pt15(&mut self) -> _PT15W { - _PT15W { w: self } - } - } - } -} -#[doc = "Pulse Train"] -pub struct PT { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT {} -impl PT { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c020 as *const _ - } -} -impl Deref for PT { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT::ptr() } - } -} -#[doc = "Pulse Train"] -pub mod pt { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Pulse Train Configuration"] - pub rate_length: RATE_LENGTH, - #[doc = "0x04 - Write the repeating bit pattern that is shifted out, LSB first, when configured in Pulse Train mode. See PT_RATE_LENGTH.mode for setting the length."] - pub train: TRAIN, - #[doc = "0x08 - Pulse Train Loop Count"] - pub loop_: LOOP, - #[doc = "0x0c - Pulse Train Auto-Restart Configuration."] - pub restart: RESTART, - } - #[doc = "Pulse Train Configuration"] - pub struct RATE_LENGTH { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Configuration"] - pub mod rate_length { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RATE_LENGTH { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RATE_CONTROLR { - bits: u32, - } - impl RATE_CONTROLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = "Possible values of the field `mode`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "Pulse train, 32 bit pattern."] - _32_BIT, - #[doc = "Square wave mode."] - SQUARE_WAVE, - #[doc = "Pulse train, 2 bit pattern."] - _2_BIT, - #[doc = "Pulse train, 3 bit pattern."] - _3_BIT, - #[doc = "Pulse train, 4 bit pattern."] - _4_BIT, - #[doc = "Pulse train, 5 bit pattern."] - _5_BIT, - #[doc = "Pulse train, 6 bit pattern."] - _6_BIT, - #[doc = "Pulse train, 7 bit pattern."] - _7_BIT, - #[doc = "Pulse train, 8 bit pattern."] - _8_BIT, - #[doc = "Pulse train, 9 bit pattern."] - _9_BIT, - #[doc = "Pulse train, 10 bit pattern."] - _10_BIT, - #[doc = "Pulse train, 11 bit pattern."] - _11_BIT, - #[doc = "Pulse train, 12 bit pattern."] - _12_BIT, - #[doc = "Pulse train, 13 bit pattern."] - _13_BIT, - #[doc = "Pulse train, 14 bit pattern."] - _14_BIT, - #[doc = "Pulse train, 15 bit pattern."] - _15_BIT, - #[doc = "Pulse train, 16 bit pattern."] - _16_BIT, - #[doc = "Pulse train, 17 bit pattern."] - _17_BIT, - #[doc = "Pulse train, 18 bit pattern."] - _18_BIT, - #[doc = "Pulse train, 19 bit pattern."] - _19_BIT, - #[doc = "Pulse train, 20 bit pattern."] - _20_BIT, - #[doc = "Pulse train, 21 bit pattern."] - _21_BIT, - #[doc = "Pulse train, 22 bit pattern."] - _22_BIT, - #[doc = "Pulse train, 23 bit pattern."] - _23_BIT, - #[doc = "Pulse train, 24 bit pattern."] - _24_BIT, - #[doc = "Pulse train, 25 bit pattern."] - _25_BIT, - #[doc = "Pulse train, 26 bit pattern."] - _26_BIT, - #[doc = "Pulse train, 27 bit pattern."] - _27_BIT, - #[doc = "Pulse train, 28 bit pattern."] - _28_BIT, - #[doc = "Pulse train, 29 bit pattern."] - _29_BIT, - #[doc = "Pulse train, 30 bit pattern."] - _30_BIT, - #[doc = "Pulse train, 31 bit pattern."] - _31_BIT, - } - impl MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - MODER::_32_BIT => 0, - MODER::SQUARE_WAVE => 0x01, - MODER::_2_BIT => 0x02, - MODER::_3_BIT => 0x03, - MODER::_4_BIT => 0x04, - MODER::_5_BIT => 0x05, - MODER::_6_BIT => 0x06, - MODER::_7_BIT => 0x07, - MODER::_8_BIT => 0x08, - MODER::_9_BIT => 0x09, - MODER::_10_BIT => 0x0a, - MODER::_11_BIT => 0x0b, - MODER::_12_BIT => 0x0c, - MODER::_13_BIT => 0x0d, - MODER::_14_BIT => 0x0e, - MODER::_15_BIT => 0x0f, - MODER::_16_BIT => 0x10, - MODER::_17_BIT => 0x11, - MODER::_18_BIT => 0x12, - MODER::_19_BIT => 0x13, - MODER::_20_BIT => 0x14, - MODER::_21_BIT => 0x15, - MODER::_22_BIT => 0x16, - MODER::_23_BIT => 0x17, - MODER::_24_BIT => 0x18, - MODER::_25_BIT => 0x19, - MODER::_26_BIT => 0x1a, - MODER::_27_BIT => 0x1b, - MODER::_28_BIT => 0x1c, - MODER::_29_BIT => 0x1d, - MODER::_30_BIT => 0x1e, - MODER::_31_BIT => 0x1f, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> MODER { - match value { - 0 => MODER::_32_BIT, - 1 => MODER::SQUARE_WAVE, - 2 => MODER::_2_BIT, - 3 => MODER::_3_BIT, - 4 => MODER::_4_BIT, - 5 => MODER::_5_BIT, - 6 => MODER::_6_BIT, - 7 => MODER::_7_BIT, - 8 => MODER::_8_BIT, - 9 => MODER::_9_BIT, - 10 => MODER::_10_BIT, - 11 => MODER::_11_BIT, - 12 => MODER::_12_BIT, - 13 => MODER::_13_BIT, - 14 => MODER::_14_BIT, - 15 => MODER::_15_BIT, - 16 => MODER::_16_BIT, - 17 => MODER::_17_BIT, - 18 => MODER::_18_BIT, - 19 => MODER::_19_BIT, - 20 => MODER::_20_BIT, - 21 => MODER::_21_BIT, - 22 => MODER::_22_BIT, - 23 => MODER::_23_BIT, - 24 => MODER::_24_BIT, - 25 => MODER::_25_BIT, - 26 => MODER::_26_BIT, - 27 => MODER::_27_BIT, - 28 => MODER::_28_BIT, - 29 => MODER::_29_BIT, - 30 => MODER::_30_BIT, - 31 => MODER::_31_BIT, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_32_BIT`"] - #[inline] - pub fn is_32_bit(&self) -> bool { - *self == MODER::_32_BIT - } - #[doc = "Checks if the value of the field is `SQUARE_WAVE`"] - #[inline] - pub fn is_square_wave(&self) -> bool { - *self == MODER::SQUARE_WAVE - } - #[doc = "Checks if the value of the field is `_2_BIT`"] - #[inline] - pub fn is_2_bit(&self) -> bool { - *self == MODER::_2_BIT - } - #[doc = "Checks if the value of the field is `_3_BIT`"] - #[inline] - pub fn is_3_bit(&self) -> bool { - *self == MODER::_3_BIT - } - #[doc = "Checks if the value of the field is `_4_BIT`"] - #[inline] - pub fn is_4_bit(&self) -> bool { - *self == MODER::_4_BIT - } - #[doc = "Checks if the value of the field is `_5_BIT`"] - #[inline] - pub fn is_5_bit(&self) -> bool { - *self == MODER::_5_BIT - } - #[doc = "Checks if the value of the field is `_6_BIT`"] - #[inline] - pub fn is_6_bit(&self) -> bool { - *self == MODER::_6_BIT - } - #[doc = "Checks if the value of the field is `_7_BIT`"] - #[inline] - pub fn is_7_bit(&self) -> bool { - *self == MODER::_7_BIT - } - #[doc = "Checks if the value of the field is `_8_BIT`"] - #[inline] - pub fn is_8_bit(&self) -> bool { - *self == MODER::_8_BIT - } - #[doc = "Checks if the value of the field is `_9_BIT`"] - #[inline] - pub fn is_9_bit(&self) -> bool { - *self == MODER::_9_BIT - } - #[doc = "Checks if the value of the field is `_10_BIT`"] - #[inline] - pub fn is_10_bit(&self) -> bool { - *self == MODER::_10_BIT - } - #[doc = "Checks if the value of the field is `_11_BIT`"] - #[inline] - pub fn is_11_bit(&self) -> bool { - *self == MODER::_11_BIT - } - #[doc = "Checks if the value of the field is `_12_BIT`"] - #[inline] - pub fn is_12_bit(&self) -> bool { - *self == MODER::_12_BIT - } - #[doc = "Checks if the value of the field is `_13_BIT`"] - #[inline] - pub fn is_13_bit(&self) -> bool { - *self == MODER::_13_BIT - } - #[doc = "Checks if the value of the field is `_14_BIT`"] - #[inline] - pub fn is_14_bit(&self) -> bool { - *self == MODER::_14_BIT - } - #[doc = "Checks if the value of the field is `_15_BIT`"] - #[inline] - pub fn is_15_bit(&self) -> bool { - *self == MODER::_15_BIT - } - #[doc = "Checks if the value of the field is `_16_BIT`"] - #[inline] - pub fn is_16_bit(&self) -> bool { - *self == MODER::_16_BIT - } - #[doc = "Checks if the value of the field is `_17_BIT`"] - #[inline] - pub fn is_17_bit(&self) -> bool { - *self == MODER::_17_BIT - } - #[doc = "Checks if the value of the field is `_18_BIT`"] - #[inline] - pub fn is_18_bit(&self) -> bool { - *self == MODER::_18_BIT - } - #[doc = "Checks if the value of the field is `_19_BIT`"] - #[inline] - pub fn is_19_bit(&self) -> bool { - *self == MODER::_19_BIT - } - #[doc = "Checks if the value of the field is `_20_BIT`"] - #[inline] - pub fn is_20_bit(&self) -> bool { - *self == MODER::_20_BIT - } - #[doc = "Checks if the value of the field is `_21_BIT`"] - #[inline] - pub fn is_21_bit(&self) -> bool { - *self == MODER::_21_BIT - } - #[doc = "Checks if the value of the field is `_22_BIT`"] - #[inline] - pub fn is_22_bit(&self) -> bool { - *self == MODER::_22_BIT - } - #[doc = "Checks if the value of the field is `_23_BIT`"] - #[inline] - pub fn is_23_bit(&self) -> bool { - *self == MODER::_23_BIT - } - #[doc = "Checks if the value of the field is `_24_BIT`"] - #[inline] - pub fn is_24_bit(&self) -> bool { - *self == MODER::_24_BIT - } - #[doc = "Checks if the value of the field is `_25_BIT`"] - #[inline] - pub fn is_25_bit(&self) -> bool { - *self == MODER::_25_BIT - } - #[doc = "Checks if the value of the field is `_26_BIT`"] - #[inline] - pub fn is_26_bit(&self) -> bool { - *self == MODER::_26_BIT - } - #[doc = "Checks if the value of the field is `_27_BIT`"] - #[inline] - pub fn is_27_bit(&self) -> bool { - *self == MODER::_27_BIT - } - #[doc = "Checks if the value of the field is `_28_BIT`"] - #[inline] - pub fn is_28_bit(&self) -> bool { - *self == MODER::_28_BIT - } - #[doc = "Checks if the value of the field is `_29_BIT`"] - #[inline] - pub fn is_29_bit(&self) -> bool { - *self == MODER::_29_BIT - } - #[doc = "Checks if the value of the field is `_30_BIT`"] - #[inline] - pub fn is_30_bit(&self) -> bool { - *self == MODER::_30_BIT - } - #[doc = "Checks if the value of the field is `_31_BIT`"] - #[inline] - pub fn is_31_bit(&self) -> bool { - *self == MODER::_31_BIT - } - } - #[doc = r" Proxy"] - pub struct _RATE_CONTROLW<'a> { - w: &'a mut W, - } - impl<'a> _RATE_CONTROLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x07ff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `mode`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "Pulse train, 32 bit pattern."] - _32_BIT, - #[doc = "Square wave mode."] - SQUARE_WAVE, - #[doc = "Pulse train, 2 bit pattern."] - _2_BIT, - #[doc = "Pulse train, 3 bit pattern."] - _3_BIT, - #[doc = "Pulse train, 4 bit pattern."] - _4_BIT, - #[doc = "Pulse train, 5 bit pattern."] - _5_BIT, - #[doc = "Pulse train, 6 bit pattern."] - _6_BIT, - #[doc = "Pulse train, 7 bit pattern."] - _7_BIT, - #[doc = "Pulse train, 8 bit pattern."] - _8_BIT, - #[doc = "Pulse train, 9 bit pattern."] - _9_BIT, - #[doc = "Pulse train, 10 bit pattern."] - _10_BIT, - #[doc = "Pulse train, 11 bit pattern."] - _11_BIT, - #[doc = "Pulse train, 12 bit pattern."] - _12_BIT, - #[doc = "Pulse train, 13 bit pattern."] - _13_BIT, - #[doc = "Pulse train, 14 bit pattern."] - _14_BIT, - #[doc = "Pulse train, 15 bit pattern."] - _15_BIT, - #[doc = "Pulse train, 16 bit pattern."] - _16_BIT, - #[doc = "Pulse train, 17 bit pattern."] - _17_BIT, - #[doc = "Pulse train, 18 bit pattern."] - _18_BIT, - #[doc = "Pulse train, 19 bit pattern."] - _19_BIT, - #[doc = "Pulse train, 20 bit pattern."] - _20_BIT, - #[doc = "Pulse train, 21 bit pattern."] - _21_BIT, - #[doc = "Pulse train, 22 bit pattern."] - _22_BIT, - #[doc = "Pulse train, 23 bit pattern."] - _23_BIT, - #[doc = "Pulse train, 24 bit pattern."] - _24_BIT, - #[doc = "Pulse train, 25 bit pattern."] - _25_BIT, - #[doc = "Pulse train, 26 bit pattern."] - _26_BIT, - #[doc = "Pulse train, 27 bit pattern."] - _27_BIT, - #[doc = "Pulse train, 28 bit pattern."] - _28_BIT, - #[doc = "Pulse train, 29 bit pattern."] - _29_BIT, - #[doc = "Pulse train, 30 bit pattern."] - _30_BIT, - #[doc = "Pulse train, 31 bit pattern."] - _31_BIT, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - MODEW::_32_BIT => 0, - MODEW::SQUARE_WAVE => 1, - MODEW::_2_BIT => 2, - MODEW::_3_BIT => 3, - MODEW::_4_BIT => 4, - MODEW::_5_BIT => 5, - MODEW::_6_BIT => 6, - MODEW::_7_BIT => 7, - MODEW::_8_BIT => 8, - MODEW::_9_BIT => 9, - MODEW::_10_BIT => 10, - MODEW::_11_BIT => 11, - MODEW::_12_BIT => 12, - MODEW::_13_BIT => 13, - MODEW::_14_BIT => 14, - MODEW::_15_BIT => 15, - MODEW::_16_BIT => 16, - MODEW::_17_BIT => 17, - MODEW::_18_BIT => 18, - MODEW::_19_BIT => 19, - MODEW::_20_BIT => 20, - MODEW::_21_BIT => 21, - MODEW::_22_BIT => 22, - MODEW::_23_BIT => 23, - MODEW::_24_BIT => 24, - MODEW::_25_BIT => 25, - MODEW::_26_BIT => 26, - MODEW::_27_BIT => 27, - MODEW::_28_BIT => 28, - MODEW::_29_BIT => 29, - MODEW::_30_BIT => 30, - MODEW::_31_BIT => 31, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Pulse train, 32 bit pattern."] - #[inline] - pub fn _32_bit(self) -> &'a mut W { - self.variant(MODEW::_32_BIT) - } - #[doc = "Square wave mode."] - #[inline] - pub fn square_wave(self) -> &'a mut W { - self.variant(MODEW::SQUARE_WAVE) - } - #[doc = "Pulse train, 2 bit pattern."] - #[inline] - pub fn _2_bit(self) -> &'a mut W { - self.variant(MODEW::_2_BIT) - } - #[doc = "Pulse train, 3 bit pattern."] - #[inline] - pub fn _3_bit(self) -> &'a mut W { - self.variant(MODEW::_3_BIT) - } - #[doc = "Pulse train, 4 bit pattern."] - #[inline] - pub fn _4_bit(self) -> &'a mut W { - self.variant(MODEW::_4_BIT) - } - #[doc = "Pulse train, 5 bit pattern."] - #[inline] - pub fn _5_bit(self) -> &'a mut W { - self.variant(MODEW::_5_BIT) - } - #[doc = "Pulse train, 6 bit pattern."] - #[inline] - pub fn _6_bit(self) -> &'a mut W { - self.variant(MODEW::_6_BIT) - } - #[doc = "Pulse train, 7 bit pattern."] - #[inline] - pub fn _7_bit(self) -> &'a mut W { - self.variant(MODEW::_7_BIT) - } - #[doc = "Pulse train, 8 bit pattern."] - #[inline] - pub fn _8_bit(self) -> &'a mut W { - self.variant(MODEW::_8_BIT) - } - #[doc = "Pulse train, 9 bit pattern."] - #[inline] - pub fn _9_bit(self) -> &'a mut W { - self.variant(MODEW::_9_BIT) - } - #[doc = "Pulse train, 10 bit pattern."] - #[inline] - pub fn _10_bit(self) -> &'a mut W { - self.variant(MODEW::_10_BIT) - } - #[doc = "Pulse train, 11 bit pattern."] - #[inline] - pub fn _11_bit(self) -> &'a mut W { - self.variant(MODEW::_11_BIT) - } - #[doc = "Pulse train, 12 bit pattern."] - #[inline] - pub fn _12_bit(self) -> &'a mut W { - self.variant(MODEW::_12_BIT) - } - #[doc = "Pulse train, 13 bit pattern."] - #[inline] - pub fn _13_bit(self) -> &'a mut W { - self.variant(MODEW::_13_BIT) - } - #[doc = "Pulse train, 14 bit pattern."] - #[inline] - pub fn _14_bit(self) -> &'a mut W { - self.variant(MODEW::_14_BIT) - } - #[doc = "Pulse train, 15 bit pattern."] - #[inline] - pub fn _15_bit(self) -> &'a mut W { - self.variant(MODEW::_15_BIT) - } - #[doc = "Pulse train, 16 bit pattern."] - #[inline] - pub fn _16_bit(self) -> &'a mut W { - self.variant(MODEW::_16_BIT) - } - #[doc = "Pulse train, 17 bit pattern."] - #[inline] - pub fn _17_bit(self) -> &'a mut W { - self.variant(MODEW::_17_BIT) - } - #[doc = "Pulse train, 18 bit pattern."] - #[inline] - pub fn _18_bit(self) -> &'a mut W { - self.variant(MODEW::_18_BIT) - } - #[doc = "Pulse train, 19 bit pattern."] - #[inline] - pub fn _19_bit(self) -> &'a mut W { - self.variant(MODEW::_19_BIT) - } - #[doc = "Pulse train, 20 bit pattern."] - #[inline] - pub fn _20_bit(self) -> &'a mut W { - self.variant(MODEW::_20_BIT) - } - #[doc = "Pulse train, 21 bit pattern."] - #[inline] - pub fn _21_bit(self) -> &'a mut W { - self.variant(MODEW::_21_BIT) - } - #[doc = "Pulse train, 22 bit pattern."] - #[inline] - pub fn _22_bit(self) -> &'a mut W { - self.variant(MODEW::_22_BIT) - } - #[doc = "Pulse train, 23 bit pattern."] - #[inline] - pub fn _23_bit(self) -> &'a mut W { - self.variant(MODEW::_23_BIT) - } - #[doc = "Pulse train, 24 bit pattern."] - #[inline] - pub fn _24_bit(self) -> &'a mut W { - self.variant(MODEW::_24_BIT) - } - #[doc = "Pulse train, 25 bit pattern."] - #[inline] - pub fn _25_bit(self) -> &'a mut W { - self.variant(MODEW::_25_BIT) - } - #[doc = "Pulse train, 26 bit pattern."] - #[inline] - pub fn _26_bit(self) -> &'a mut W { - self.variant(MODEW::_26_BIT) - } - #[doc = "Pulse train, 27 bit pattern."] - #[inline] - pub fn _27_bit(self) -> &'a mut W { - self.variant(MODEW::_27_BIT) - } - #[doc = "Pulse train, 28 bit pattern."] - #[inline] - pub fn _28_bit(self) -> &'a mut W { - self.variant(MODEW::_28_BIT) - } - #[doc = "Pulse train, 29 bit pattern."] - #[inline] - pub fn _29_bit(self) -> &'a mut W { - self.variant(MODEW::_29_BIT) - } - #[doc = "Pulse train, 30 bit pattern."] - #[inline] - pub fn _30_bit(self) -> &'a mut W { - self.variant(MODEW::_30_BIT) - } - #[doc = "Pulse train, 31 bit pattern."] - #[inline] - pub fn _31_bit(self) -> &'a mut W { - self.variant(MODEW::_31_BIT) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:26 - Pulse Train Enable and Rate Control. Set to 0 to disable the Pulse Train."] - #[inline] - pub fn rate_control(&self) -> RATE_CONTROLR { - let bits = { - const MASK: u32 = 0x07ff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - RATE_CONTROLR { bits } - } - #[doc = "Bits 27:31 - Pulse Train Output Mode/Train Length"] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: u8 = 0x1f; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:26 - Pulse Train Enable and Rate Control. Set to 0 to disable the Pulse Train."] - #[inline] - pub fn rate_control(&mut self) -> _RATE_CONTROLW { - _RATE_CONTROLW { w: self } - } - #[doc = "Bits 27:31 - Pulse Train Output Mode/Train Length"] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - } - } - #[doc = "Write the repeating bit pattern that is shifted out, LSB first, when configured in Pulse Train mode. See PT_RATE_LENGTH.mode for setting the length."] - pub struct TRAIN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Write the repeating bit pattern that is shifted out, LSB first, when configured in Pulse Train mode. See PT_RATE_LENGTH.mode for setting the length."] - pub mod train { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TRAIN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Pulse Train Loop Count"] - pub struct LOOP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Loop Count"] - pub mod loop_ { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LOOP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct COUNTR { - bits: u16, - } - impl COUNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct DELAYR { - bits: u16, - } - impl DELAYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _COUNTW<'a> { - w: &'a mut W, - } - impl<'a> _COUNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DELAYW<'a> { - w: &'a mut W, - } - impl<'a> _DELAYW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Number of loops for this pulse train to repeat."] - #[inline] - pub fn count(&self) -> COUNTR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - COUNTR { bits } - } - #[doc = "Bits 16:27 - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"] - #[inline] - pub fn delay(&self) -> DELAYR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - DELAYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Number of loops for this pulse train to repeat."] - #[inline] - pub fn count(&mut self) -> _COUNTW { - _COUNTW { w: self } - } - #[doc = "Bits 16:27 - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"] - #[inline] - pub fn delay(&mut self) -> _DELAYW { - _DELAYW { w: self } - } - } - } - #[doc = "Pulse Train Auto-Restart Configuration."] - pub struct RESTART { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Auto-Restart Configuration."] - pub mod restart { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RESTART { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct PT_X_SELECTR { - bits: u8, - } - impl PT_X_SELECTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct ON_PT_X_LOOP_EXITR { - bits: bool, - } - impl ON_PT_X_LOOP_EXITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PT_Y_SELECTR { - bits: u8, - } - impl PT_Y_SELECTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct ON_PT_Y_LOOP_EXITR { - bits: bool, - } - impl ON_PT_Y_LOOP_EXITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _PT_X_SELECTW<'a> { - w: &'a mut W, - } - impl<'a> _PT_X_SELECTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ON_PT_X_LOOP_EXITW<'a> { - w: &'a mut W, - } - impl<'a> _ON_PT_X_LOOP_EXITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PT_Y_SELECTW<'a> { - w: &'a mut W, - } - impl<'a> _PT_Y_SELECTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ON_PT_Y_LOOP_EXITW<'a> { - w: &'a mut W, - } - impl<'a> _ON_PT_Y_LOOP_EXITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:4 - Auto-Restart PT X Select"] - #[inline] - pub fn pt_x_select(&self) -> PT_X_SELECTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - PT_X_SELECTR { bits } - } - #[doc = "Bit 7 - Enable Auto-Restart on PT X Loop Exit"] - #[inline] - pub fn on_pt_x_loop_exit(&self) -> ON_PT_X_LOOP_EXITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ON_PT_X_LOOP_EXITR { bits } - } - #[doc = "Bits 8:12 - Auto-Restart PT Y Select"] - #[inline] - pub fn pt_y_select(&self) -> PT_Y_SELECTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - PT_Y_SELECTR { bits } - } - #[doc = "Bit 15 - Enable Auto-Restart on PT Y Loop Exit"] - #[inline] - pub fn on_pt_y_loop_exit(&self) -> ON_PT_Y_LOOP_EXITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ON_PT_Y_LOOP_EXITR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:4 - Auto-Restart PT X Select"] - #[inline] - pub fn pt_x_select(&mut self) -> _PT_X_SELECTW { - _PT_X_SELECTW { w: self } - } - #[doc = "Bit 7 - Enable Auto-Restart on PT X Loop Exit"] - #[inline] - pub fn on_pt_x_loop_exit(&mut self) -> _ON_PT_X_LOOP_EXITW { - _ON_PT_X_LOOP_EXITW { w: self } - } - #[doc = "Bits 8:12 - Auto-Restart PT Y Select"] - #[inline] - pub fn pt_y_select(&mut self) -> _PT_Y_SELECTW { - _PT_Y_SELECTW { w: self } - } - #[doc = "Bit 15 - Enable Auto-Restart on PT Y Loop Exit"] - #[inline] - pub fn on_pt_y_loop_exit(&mut self) -> _ON_PT_Y_LOOP_EXITW { - _ON_PT_Y_LOOP_EXITW { w: self } - } - } - } -} -#[doc = "Pulse Train 1"] -pub struct PT1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT1 {} -impl PT1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c040 as *const _ - } -} -impl Deref for PT1 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT1::ptr() } - } -} -#[doc = "Pulse Train 2"] -pub struct PT2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT2 {} -impl PT2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c060 as *const _ - } -} -impl Deref for PT2 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT2::ptr() } - } -} -#[doc = "Pulse Train 3"] -pub struct PT3 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT3 {} -impl PT3 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c080 as *const _ - } -} -impl Deref for PT3 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT3::ptr() } - } -} -#[doc = "Pulse Train 4"] -pub struct PT4 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT4 {} -impl PT4 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c0a0 as *const _ - } -} -impl Deref for PT4 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT4::ptr() } - } -} -#[doc = "Pulse Train 5"] -pub struct PT5 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT5 {} -impl PT5 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c0c0 as *const _ - } -} -impl Deref for PT5 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT5::ptr() } - } -} -#[doc = "Pulse Train 6"] -pub struct PT6 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT6 {} -impl PT6 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c0e0 as *const _ - } -} -impl Deref for PT6 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT6::ptr() } - } -} -#[doc = "Pulse Train 7"] -pub struct PT7 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT7 {} -impl PT7 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c100 as *const _ - } -} -impl Deref for PT7 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT7::ptr() } - } -} -#[doc = "Pulse Train 8"] -pub struct PT8 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT8 {} -impl PT8 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c120 as *const _ - } -} -impl Deref for PT8 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT8::ptr() } - } -} -#[doc = "Pulse Train 9"] -pub struct PT9 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT9 {} -impl PT9 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c140 as *const _ - } -} -impl Deref for PT9 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT9::ptr() } - } -} -#[doc = "Pulse Train 10"] -pub struct PT10 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT10 {} -impl PT10 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c160 as *const _ - } -} -impl Deref for PT10 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT10::ptr() } - } -} -#[doc = "Pulse Train 11"] -pub struct PT11 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT11 {} -impl PT11 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c180 as *const _ - } -} -impl Deref for PT11 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT11::ptr() } - } -} -#[doc = "Pulse Train 12"] -pub struct PT12 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT12 {} -impl PT12 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c1a0 as *const _ - } -} -impl Deref for PT12 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT12::ptr() } - } -} -#[doc = "Pulse Train 13"] -pub struct PT13 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT13 {} -impl PT13 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c1c0 as *const _ - } -} -impl Deref for PT13 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT13::ptr() } - } -} -#[doc = "Pulse Train 14"] -pub struct PT14 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT14 {} -impl PT14 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c1e0 as *const _ - } -} -impl Deref for PT14 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT14::ptr() } - } -} -#[doc = "Pulse Train 15"] -pub struct PT15 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PT15 {} -impl PT15 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pt::RegisterBlock { - 0x4003_c200 as *const _ - } -} -impl Deref for PT15 { - type Target = pt::RegisterBlock; - fn deref(&self) -> &pt::RegisterBlock { - unsafe { &*PT15::ptr() } - } -} -#[doc = "Power Sequencer / Low Power Control Register."] -pub struct PWRSEQ { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for PWRSEQ {} -impl PWRSEQ { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const pwrseq::RegisterBlock { - 0x4000_6800 as *const _ - } -} -impl Deref for PWRSEQ { - type Target = pwrseq::RegisterBlock; - fn deref(&self) -> &pwrseq::RegisterBlock { - unsafe { &*PWRSEQ::ptr() } - } -} -#[doc = "Power Sequencer / Low Power Control Register."] -pub mod pwrseq { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Low Power Control Register."] - pub lpcn: LPCN, - #[doc = "0x04 - Low Power I/O Wakeup Status Register 0. This register indicates the low power wakeup status for GPIO0."] - pub lpwkst0: LPWKST0, - #[doc = "0x08 - Low Power I/O Wakeup Enable Register 0. This register enables low power wakeup functionality for GPIO0."] - pub lpwken0: LPWKEN0, - #[doc = "0x0c - Low Power I/O Wakeup Status Register 1. This register indicates the low power wakeup status for GPIO1."] - pub lpwkst1: LPWKST1, - #[doc = "0x10 - Low Power I/O Wakeup Enable Register 1. This register enables low power wakeup functionality for GPIO1."] - pub lpwken1: LPWKEN1, - #[doc = "0x14 - Low Power I/O Wakeup Status Register 2. This register indicates the low power wakeup status for GPIO2."] - pub lpwkst2: LPWKST2, - #[doc = "0x18 - Low Power I/O Wakeup Enable Register 2. This register enables low power wakeup functionality for GPIO2."] - pub lpwken2: LPWKEN2, - #[doc = "0x1c - Low Power I/O Wakeup Status Register 3. This register indicates the low power wakeup status for GPIO3."] - pub lpwkst3: LPWKST3, - #[doc = "0x20 - Low Power I/O Wakeup Enable Register 3. This register enables low power wakeup functionality for GPIO3."] - pub lpwken3: LPWKEN3, - _reserved0: [u8; 12usize], - #[doc = "0x30 - Low Power Peripheral Wakeup Status Register."] - pub lppwst: LPPWST, - #[doc = "0x34 - Low Power Peripheral Wakeup Enable Register."] - pub lppwen: LPPWEN, - _reserved1: [u8; 8usize], - #[doc = "0x40 - Low Power Memory Shutdown Control."] - pub lpmemsd: LPMEMSD, - #[doc = "0x44 - Low Power VDD Domain Power Down Control."] - pub lpvddpd: LPVDDPD, - #[doc = "0x48 - General Purpose Register 0"] - pub gp0: GP0, - #[doc = "0x4c - General Purpose Register 1"] - pub gp1: GP1, - #[doc = "0x50 - Low Power Multi-Core Status"] - pub lpmcstat: LPMCSTAT, - #[doc = "0x54 - Low Power Multi-Core Request"] - pub lpmcreq: LPMCREQ, - } - #[doc = "Low Power Control Register."] - pub struct LPCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Control Register."] - pub mod lpcn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `RAMRET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RAMRETR { - #[doc = "Disable Ram Retention."] - DIS, - #[doc = "Enable System RAM 0 retention."] - EN1, - #[doc = "Enable System RAM 0 and 1 retention."] - EN2, - #[doc = "Enable System RAM 0 and 1 retention, if RREGEN=0, Enable all System RAM retention."] - EN3, - } - impl RAMRETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - RAMRETR::DIS => 0, - RAMRETR::EN1 => 0x01, - RAMRETR::EN2 => 0x02, - RAMRETR::EN3 => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> RAMRETR { - match value { - 0 => RAMRETR::DIS, - 1 => RAMRETR::EN1, - 2 => RAMRETR::EN2, - 3 => RAMRETR::EN3, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RAMRETR::DIS - } - #[doc = "Checks if the value of the field is `EN1`"] - #[inline] - pub fn is_en1(&self) -> bool { - *self == RAMRETR::EN1 - } - #[doc = "Checks if the value of the field is `EN2`"] - #[inline] - pub fn is_en2(&self) -> bool { - *self == RAMRETR::EN2 - } - #[doc = "Checks if the value of the field is `EN3`"] - #[inline] - pub fn is_en3(&self) -> bool { - *self == RAMRETR::EN3 - } - } - #[doc = "Possible values of the field `OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OVRR { - #[doc = "0.9V 24MHz"] - _0_9V, - #[doc = "1.0V 48MHz"] - _1_0V, - #[doc = "1.1V 96MHz"] - _1_1V, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl OVRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - OVRR::_0_9V => 0, - OVRR::_1_0V => 0x01, - OVRR::_1_1V => 0x02, - OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> OVRR { - match value { - 0 => OVRR::_0_9V, - 1 => OVRR::_1_0V, - 2 => OVRR::_1_1V, - i => OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0_9V`"] - #[inline] - pub fn is_0_9v(&self) -> bool { - *self == OVRR::_0_9V - } - #[doc = "Checks if the value of the field is `_1_0V`"] - #[inline] - pub fn is_1_0v(&self) -> bool { - *self == OVRR::_1_0V - } - #[doc = "Checks if the value of the field is `_1_1V`"] - #[inline] - pub fn is_1_1v(&self) -> bool { - *self == OVRR::_1_1V - } - } - #[doc = "Possible values of the field `BLKDET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BLKDETR { - #[doc = "enable"] - ENABLED, - #[doc = "disable"] - DISABLE, - } - impl BLKDETR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BLKDETR::ENABLED => false, - BLKDETR::DISABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BLKDETR { - match value { - false => BLKDETR::ENABLED, - true => BLKDETR::DISABLE, - } - } - #[doc = "Checks if the value of the field is `ENABLED`"] - #[inline] - pub fn is_enabled(&self) -> bool { - *self == BLKDETR::ENABLED - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == BLKDETR::DISABLE - } - } - #[doc = r" Value of the field"] - pub struct FVDDENR { - bits: bool, - } - impl FVDDENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `RREGEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RREGENR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl RREGENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RREGENR::DIS => false, - RREGENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RREGENR { - match value { - false => RREGENR::DIS, - true => RREGENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RREGENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RREGENR::EN - } - } - #[doc = "Possible values of the field `BCKGRND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BCKGRNDR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl BCKGRNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BCKGRNDR::DIS => false, - BCKGRNDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BCKGRNDR { - match value { - false => BCKGRNDR::DIS, - true => BCKGRNDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BCKGRNDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BCKGRNDR::EN - } - } - #[doc = "Possible values of the field `FWKM`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FWKMR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl FWKMR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FWKMR::DIS => false, - FWKMR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FWKMR { - match value { - false => FWKMR::DIS, - true => FWKMR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FWKMR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FWKMR::EN - } - } - #[doc = "Possible values of the field `BGOFF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BGOFFR { - #[doc = "Bandgap is always ON."] - ON, - #[doc = "Bandgap is OFF in DeepSleep mode(default)."] - OFF, - } - impl BGOFFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BGOFFR::ON => false, - BGOFFR::OFF => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BGOFFR { - match value { - false => BGOFFR::ON, - true => BGOFFR::OFF, - } - } - #[doc = "Checks if the value of the field is `ON`"] - #[inline] - pub fn is_on(&self) -> bool { - *self == BGOFFR::ON - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == BGOFFR::OFF - } - } - #[doc = "Possible values of the field `PORVDDCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDCMDR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDCMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PORVDDCMDR::DIS => false, - PORVDDCMDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PORVDDCMDR { - match value { - false => PORVDDCMDR::DIS, - true => PORVDDCMDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PORVDDCMDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PORVDDCMDR::EN - } - } - #[doc = "Possible values of the field `VDDCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDCMDR { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDCMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDCMDR::EN => false, - VDDCMDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDCMDR { - match value { - false => VDDCMDR::EN, - true => VDDCMDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDCMDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDCMDR::DIS - } - } - #[doc = "Possible values of the field `VRTCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VRTCMDR { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VRTCMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VRTCMDR::EN => false, - VRTCMDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VRTCMDR { - match value { - false => VRTCMDR::EN, - true => VRTCMDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VRTCMDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VRTCMDR::DIS - } - } - #[doc = "Possible values of the field `VDDAMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDAMDR { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDAMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDAMDR::EN => false, - VDDAMDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDAMDR { - match value { - false => VDDAMDR::EN, - true => VDDAMDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDAMDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDAMDR::DIS - } - } - #[doc = "Possible values of the field `VDDIOMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDIOMDR { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDIOMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDIOMDR::EN => false, - VDDIOMDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDIOMDR { - match value { - false => VDDIOMDR::EN, - true => VDDIOMDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDIOMDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDIOMDR::DIS - } - } - #[doc = "Possible values of the field `VDDIOHMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDIOHMDR { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDIOHMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDIOHMDR::EN => false, - VDDIOHMDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDIOHMDR { - match value { - false => VDDIOHMDR::EN, - true => VDDIOHMDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDIOHMDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDIOHMDR::DIS - } - } - #[doc = "Possible values of the field `PORVDDIOMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDIOMDR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDIOMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PORVDDIOMDR::DIS => false, - PORVDDIOMDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PORVDDIOMDR { - match value { - false => PORVDDIOMDR::DIS, - true => PORVDDIOMDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PORVDDIOMDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PORVDDIOMDR::EN - } - } - #[doc = "Possible values of the field `PORVDDIOHMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDIOHMDR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDIOHMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PORVDDIOHMDR::DIS => false, - PORVDDIOHMDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PORVDDIOHMDR { - match value { - false => PORVDDIOHMDR::DIS, - true => PORVDDIOHMDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PORVDDIOHMDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PORVDDIOHMDR::EN - } - } - #[doc = "Possible values of the field `VDDBMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDBMDR { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl VDDBMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDBMDR::DIS => false, - VDDBMDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDBMDR { - match value { - false => VDDBMDR::DIS, - true => VDDBMDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDBMDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDBMDR::EN - } - } - #[doc = "Values that can be written to the field `RAMRET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RAMRETW { - #[doc = "Disable Ram Retention."] - DIS, - #[doc = "Enable System RAM 0 retention."] - EN1, - #[doc = "Enable System RAM 0 and 1 retention."] - EN2, - #[doc = "Enable System RAM 0 and 1 retention, if RREGEN=0, Enable all System RAM retention."] - EN3, - } - impl RAMRETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - RAMRETW::DIS => 0, - RAMRETW::EN1 => 1, - RAMRETW::EN2 => 2, - RAMRETW::EN3 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _RAMRETW<'a> { - w: &'a mut W, - } - impl<'a> _RAMRETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RAMRETW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Disable Ram Retention."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RAMRETW::DIS) - } - #[doc = "Enable System RAM 0 retention."] - #[inline] - pub fn en1(self) -> &'a mut W { - self.variant(RAMRETW::EN1) - } - #[doc = "Enable System RAM 0 and 1 retention."] - #[inline] - pub fn en2(self) -> &'a mut W { - self.variant(RAMRETW::EN2) - } - #[doc = "Enable System RAM 0 and 1 retention, if RREGEN=0, Enable all System RAM retention."] - #[inline] - pub fn en3(self) -> &'a mut W { - self.variant(RAMRETW::EN3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum OVRW { - #[doc = "0.9V 24MHz"] - _0_9V, - #[doc = "1.0V 48MHz"] - _1_0V, - #[doc = "1.1V 96MHz"] - _1_1V, - } - impl OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - OVRW::_0_9V => 0, - OVRW::_1_0V => 1, - OVRW::_1_1V => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _OVRW<'a> { - w: &'a mut W, - } - impl<'a> _OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: OVRW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "0.9V 24MHz"] - #[inline] - pub fn _0_9v(self) -> &'a mut W { - self.variant(OVRW::_0_9V) - } - #[doc = "1.0V 48MHz"] - #[inline] - pub fn _1_0v(self) -> &'a mut W { - self.variant(OVRW::_1_0V) - } - #[doc = "1.1V 96MHz"] - #[inline] - pub fn _1_1v(self) -> &'a mut W { - self.variant(OVRW::_1_1V) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BLKDET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BLKDETW { - #[doc = "enable"] - ENABLED, - #[doc = "disable"] - DISABLE, - } - impl BLKDETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BLKDETW::ENABLED => false, - BLKDETW::DISABLE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BLKDETW<'a> { - w: &'a mut W, - } - impl<'a> _BLKDETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BLKDETW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "enable"] - #[inline] - pub fn enabled(self) -> &'a mut W { - self.variant(BLKDETW::ENABLED) - } - #[doc = "disable"] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(BLKDETW::DISABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FVDDENW<'a> { - w: &'a mut W, - } - impl<'a> _FVDDENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RREGEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RREGENW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl RREGENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RREGENW::DIS => false, - RREGENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RREGENW<'a> { - w: &'a mut W, - } - impl<'a> _RREGENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RREGENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RREGENW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RREGENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BCKGRND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BCKGRNDW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl BCKGRNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BCKGRNDW::DIS => false, - BCKGRNDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BCKGRNDW<'a> { - w: &'a mut W, - } - impl<'a> _BCKGRNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BCKGRNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BCKGRNDW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BCKGRNDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FWKM`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FWKMW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl FWKMW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FWKMW::DIS => false, - FWKMW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FWKMW<'a> { - w: &'a mut W, - } - impl<'a> _FWKMW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FWKMW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FWKMW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FWKMW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BGOFF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BGOFFW { - #[doc = "Bandgap is always ON."] - ON, - #[doc = "Bandgap is OFF in DeepSleep mode(default)."] - OFF, - } - impl BGOFFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BGOFFW::ON => false, - BGOFFW::OFF => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BGOFFW<'a> { - w: &'a mut W, - } - impl<'a> _BGOFFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BGOFFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Bandgap is always ON."] - #[inline] - pub fn on(self) -> &'a mut W { - self.variant(BGOFFW::ON) - } - #[doc = "Bandgap is OFF in DeepSleep mode(default)."] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(BGOFFW::OFF) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PORVDDCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDCMDW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDCMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PORVDDCMDW::DIS => false, - PORVDDCMDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PORVDDCMDW<'a> { - w: &'a mut W, - } - impl<'a> _PORVDDCMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PORVDDCMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PORVDDCMDW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PORVDDCMDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDCMDW { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDCMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDCMDW::EN => false, - VDDCMDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDCMDW<'a> { - w: &'a mut W, - } - impl<'a> _VDDCMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDCMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable if Bandgap is ON(default)"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDCMDW::EN) - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDCMDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VRTCMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VRTCMDW { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VRTCMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VRTCMDW::EN => false, - VRTCMDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VRTCMDW<'a> { - w: &'a mut W, - } - impl<'a> _VRTCMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VRTCMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable if Bandgap is ON(default)"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VRTCMDW::EN) - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VRTCMDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDAMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDAMDW { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDAMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDAMDW::EN => false, - VDDAMDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDAMDW<'a> { - w: &'a mut W, - } - impl<'a> _VDDAMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDAMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable if Bandgap is ON(default)"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDAMDW::EN) - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDAMDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDIOMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDIOMDW { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDIOMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDIOMDW::EN => false, - VDDIOMDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDIOMDW<'a> { - w: &'a mut W, - } - impl<'a> _VDDIOMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDIOMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable if Bandgap is ON(default)"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDIOMDW::EN) - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDIOMDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDIOHMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDIOHMDW { - #[doc = "Enable if Bandgap is ON(default)"] - EN, - #[doc = "Disabled."] - DIS, - } - impl VDDIOHMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDIOHMDW::EN => false, - VDDIOHMDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDIOHMDW<'a> { - w: &'a mut W, - } - impl<'a> _VDDIOHMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDIOHMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable if Bandgap is ON(default)"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDIOHMDW::EN) - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDIOHMDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PORVDDIOMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDIOMDW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDIOMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PORVDDIOMDW::DIS => false, - PORVDDIOMDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PORVDDIOMDW<'a> { - w: &'a mut W, - } - impl<'a> _PORVDDIOMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PORVDDIOMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PORVDDIOMDW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PORVDDIOMDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PORVDDIOHMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PORVDDIOHMDW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl PORVDDIOHMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PORVDDIOHMDW::DIS => false, - PORVDDIOHMDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PORVDDIOHMDW<'a> { - w: &'a mut W, - } - impl<'a> _PORVDDIOHMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PORVDDIOHMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PORVDDIOHMDW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PORVDDIOHMDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDBMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDBMDW { - #[doc = "Disabled."] - DIS, - #[doc = "Enabled."] - EN, - } - impl VDDBMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDBMDW::DIS => false, - VDDBMDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDBMDW<'a> { - w: &'a mut W, - } - impl<'a> _VDDBMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDBMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDBMDW::DIS) - } - #[doc = "Enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDBMDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:1 - System RAM retention in BACKUP mode. These two bits are used in conjuction with RREGEN bit."] - #[inline] - pub fn ramret(&self) -> RAMRETR { - RAMRETR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 4:5 - Operating Voltage Range"] - #[inline] - pub fn ovr(&self) -> OVRR { - OVRR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 6 - Block Auto-Detect"] - #[inline] - pub fn blkdet(&self) -> BLKDETR { - BLKDETR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Flash VDD Enabled"] - #[inline] - pub fn fvdden(&self) -> FVDDENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FVDDENR { bits } - } - #[doc = "Bit 8 - Retention Regulator Enable. This bit controls the retention regulator in BACKUP mode."] - #[inline] - pub fn rregen(&self) -> RREGENR { - RREGENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Background Mode ENable. This bit allows low-power background mode operations, while the CPU is in DeepSleep."] - #[inline] - pub fn bckgrnd(&self) -> BCKGRNDR { - BCKGRNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Fast Wake-Up Mode. This bit enables fast wake-up from DeepSleep mode. (5uS typical)."] - #[inline] - pub fn fwkm(&self) -> FWKMR { - FWKMR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Bandgap OFF. This controls the System Bandgap in DeepSleep mode."] - #[inline] - pub fn bgoff(&self) -> BGOFFR { - BGOFFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - VDDC(VCore) Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDC supply in DeepSleep and BACKUP mode."] - #[inline] - pub fn porvddcmd(&self) -> PORVDDCMDR { - PORVDDCMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - VDDC(Vcore) Monitor Disable. This bit controls the power monitor on the VCore supply in all operating modes."] - #[inline] - pub fn vddcmd(&self) -> VDDCMDR { - VDDCMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - VRTC Monitor Disable. This bit controls the power monitor on the Always-On Supply in all operating modes."] - #[inline] - pub fn vrtcmd(&self) -> VRTCMDR { - VRTCMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 22 - VDDA Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddamd(&self) -> VDDAMDR { - VDDAMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - VDDIO Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddiomd(&self) -> VDDIOMDR { - VDDIOMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 24 - VFDDIOH Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddiohmd(&self) -> VDDIOHMDR { - VDDIOHMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 25 - VDDIO Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDIO supply in all operating mods."] - #[inline] - pub fn porvddiomd(&self) -> PORVDDIOMDR { - PORVDDIOMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 26 - VDDIOH Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDIOH supply in all operating mods."] - #[inline] - pub fn porvddiohmd(&self) -> PORVDDIOHMDR { - PORVDDIOHMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 27 - VDDB Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDB supply in all operating mods."] - #[inline] - pub fn vddbmd(&self) -> VDDBMDR { - VDDBMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - System RAM retention in BACKUP mode. These two bits are used in conjuction with RREGEN bit."] - #[inline] - pub fn ramret(&mut self) -> _RAMRETW { - _RAMRETW { w: self } - } - #[doc = "Bits 4:5 - Operating Voltage Range"] - #[inline] - pub fn ovr(&mut self) -> _OVRW { - _OVRW { w: self } - } - #[doc = "Bit 6 - Block Auto-Detect"] - #[inline] - pub fn blkdet(&mut self) -> _BLKDETW { - _BLKDETW { w: self } - } - #[doc = "Bit 7 - Flash VDD Enabled"] - #[inline] - pub fn fvdden(&mut self) -> _FVDDENW { - _FVDDENW { w: self } - } - #[doc = "Bit 8 - Retention Regulator Enable. This bit controls the retention regulator in BACKUP mode."] - #[inline] - pub fn rregen(&mut self) -> _RREGENW { - _RREGENW { w: self } - } - #[doc = "Bit 9 - Background Mode ENable. This bit allows low-power background mode operations, while the CPU is in DeepSleep."] - #[inline] - pub fn bckgrnd(&mut self) -> _BCKGRNDW { - _BCKGRNDW { w: self } - } - #[doc = "Bit 10 - Fast Wake-Up Mode. This bit enables fast wake-up from DeepSleep mode. (5uS typical)."] - #[inline] - pub fn fwkm(&mut self) -> _FWKMW { - _FWKMW { w: self } - } - #[doc = "Bit 11 - Bandgap OFF. This controls the System Bandgap in DeepSleep mode."] - #[inline] - pub fn bgoff(&mut self) -> _BGOFFW { - _BGOFFW { w: self } - } - #[doc = "Bit 12 - VDDC(VCore) Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDC supply in DeepSleep and BACKUP mode."] - #[inline] - pub fn porvddcmd(&mut self) -> _PORVDDCMDW { - _PORVDDCMDW { w: self } - } - #[doc = "Bit 20 - VDDC(Vcore) Monitor Disable. This bit controls the power monitor on the VCore supply in all operating modes."] - #[inline] - pub fn vddcmd(&mut self) -> _VDDCMDW { - _VDDCMDW { w: self } - } - #[doc = "Bit 21 - VRTC Monitor Disable. This bit controls the power monitor on the Always-On Supply in all operating modes."] - #[inline] - pub fn vrtcmd(&mut self) -> _VRTCMDW { - _VRTCMDW { w: self } - } - #[doc = "Bit 22 - VDDA Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddamd(&mut self) -> _VDDAMDW { - _VDDAMDW { w: self } - } - #[doc = "Bit 23 - VDDIO Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddiomd(&mut self) -> _VDDIOMDW { - _VDDIOMDW { w: self } - } - #[doc = "Bit 24 - VFDDIOH Monitor Disable. This bit controls the power monitor of the Analog Supply in all operating modes."] - #[inline] - pub fn vddiohmd(&mut self) -> _VDDIOHMDW { - _VDDIOHMDW { w: self } - } - #[doc = "Bit 25 - VDDIO Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDIO supply in all operating mods."] - #[inline] - pub fn porvddiomd(&mut self) -> _PORVDDIOMDW { - _PORVDDIOMDW { w: self } - } - #[doc = "Bit 26 - VDDIOH Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDIOH supply in all operating mods."] - #[inline] - pub fn porvddiohmd(&mut self) -> _PORVDDIOHMDW { - _PORVDDIOHMDW { w: self } - } - #[doc = "Bit 27 - VDDB Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDB supply in all operating mods."] - #[inline] - pub fn vddbmd(&mut self) -> _VDDBMDW { - _VDDBMDW { w: self } - } - } - } - #[doc = "Low Power I/O Wakeup Status Register 0. This register indicates the low power wakeup status for GPIO0."] - pub struct LPWKST0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Status Register 0. This register indicates the low power wakeup status for GPIO0."] - pub mod lpwkst0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKST0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct WAKESTR { - bits: bool, - } - impl WAKESTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _WAKESTW<'a> { - w: &'a mut W, - } - impl<'a> _WAKESTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Wakeup IRQ flags (write ones to clear). One or more of these bits will be set when the corresponding dedicated GPIO pin(s) transition(s) from low to high or high to low. If GPIO wakeup source is selected, using PM.GPIOWKEN register, and the corresponding bit is also selected in LPWKEN register, an interrupt will be gnerated to wake up the CPU from a low power mode."] - #[inline] - pub fn wakest(&self) -> WAKESTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WAKESTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wakeup IRQ flags (write ones to clear). One or more of these bits will be set when the corresponding dedicated GPIO pin(s) transition(s) from low to high or high to low. If GPIO wakeup source is selected, using PM.GPIOWKEN register, and the corresponding bit is also selected in LPWKEN register, an interrupt will be gnerated to wake up the CPU from a low power mode."] - #[inline] - pub fn wakest(&mut self) -> _WAKESTW { - _WAKESTW { w: self } - } - } - } - #[doc = "Low Power I/O Wakeup Enable Register 0. This register enables low power wakeup functionality for GPIO0."] - pub struct LPWKEN0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Enable Register 0. This register enables low power wakeup functionality for GPIO0."] - pub mod lpwken0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKEN0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct WAKEENR { - bits: u32, - } - impl WAKEENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _WAKEENW<'a> { - w: &'a mut W, - } - impl<'a> _WAKEENW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:30 - Enable wakeup. These bits allow wakeup from the corresponding GPIO pin(s) on transition(s) from low to high or high to low when PM.GPIOWKEN is set. Wakeup status is indicated in PPWKST register."] - #[inline] - pub fn wakeen(&self) -> WAKEENR { - let bits = { - const MASK: u32 = 0x7fff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - WAKEENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:30 - Enable wakeup. These bits allow wakeup from the corresponding GPIO pin(s) on transition(s) from low to high or high to low when PM.GPIOWKEN is set. Wakeup status is indicated in PPWKST register."] - #[inline] - pub fn wakeen(&mut self) -> _WAKEENW { - _WAKEENW { w: self } - } - } - } - #[doc = "Low Power I/O Wakeup Status Register 1. This register indicates the low power wakeup status for GPIO1."] - pub struct LPWKST1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Status Register 1. This register indicates the low power wakeup status for GPIO1."] - pub mod lpwkst1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKST1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power I/O Wakeup Enable Register 1. This register enables low power wakeup functionality for GPIO1."] - pub struct LPWKEN1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Enable Register 1. This register enables low power wakeup functionality for GPIO1."] - pub mod lpwken1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKEN1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power I/O Wakeup Status Register 2. This register indicates the low power wakeup status for GPIO2."] - pub struct LPWKST2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Status Register 2. This register indicates the low power wakeup status for GPIO2."] - pub mod lpwkst2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKST2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power I/O Wakeup Enable Register 2. This register enables low power wakeup functionality for GPIO2."] - pub struct LPWKEN2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Enable Register 2. This register enables low power wakeup functionality for GPIO2."] - pub mod lpwken2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKEN2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power I/O Wakeup Status Register 3. This register indicates the low power wakeup status for GPIO3."] - pub struct LPWKST3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Status Register 3. This register indicates the low power wakeup status for GPIO3."] - pub mod lpwkst3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKST3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power I/O Wakeup Enable Register 3. This register enables low power wakeup functionality for GPIO3."] - pub struct LPWKEN3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power I/O Wakeup Enable Register 3. This register enables low power wakeup functionality for GPIO3."] - pub mod lpwken3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPWKEN3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power Peripheral Wakeup Status Register."] - pub struct LPPWST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Peripheral Wakeup Status Register."] - pub mod lppwst { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPPWST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBLSWKSTR { - bits: u8, - } - impl USBLSWKSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct USBVBUSWKSTR { - bits: bool, - } - impl USBVBUSWKSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDMAWKSTR { - bits: bool, - } - impl SDMAWKSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BBMODESTR { - bits: bool, - } - impl BBMODESTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _USBLSWKSTW<'a> { - w: &'a mut W, - } - impl<'a> _USBLSWKSTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBVBUSWKSTW<'a> { - w: &'a mut W, - } - impl<'a> _USBVBUSWKSTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDMAWKSTW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAWKSTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BBMODESTW<'a> { - w: &'a mut W, - } - impl<'a> _BBMODESTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:1 - USB UTMI Linestate Detect Wakeup Flag(write one to clear). One or both of these bits will be set when the USB bus activity causes the linestate to change and the device to wake while USB wakeup is enabled using PMLUSBWKEN."] - #[inline] - pub fn usblswkst(&self) -> USBLSWKSTR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - USBLSWKSTR { bits } - } - #[doc = "Bit 2 - USB VBUS Detect Wakeup Flag (write one to clear). This bit will be set when the USB power supply is powered on or powered off."] - #[inline] - pub fn usbvbuswkst(&self) -> USBVBUSWKSTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBVBUSWKSTR { bits } - } - #[doc = "Bit 3 - Smart DMA Detect Wakeup Flag (write one to clear). This bit will be set when the SDMA IRQ transition from low to high or on high to low."] - #[inline] - pub fn sdmawkst(&self) -> SDMAWKSTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDMAWKSTR { bits } - } - #[doc = "Bit 16 - Battery Back Wakeup Flag (write one to clear). This bit will be set when exiting Battery Backup Mode."] - #[inline] - pub fn bbmodest(&self) -> BBMODESTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BBMODESTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - USB UTMI Linestate Detect Wakeup Flag(write one to clear). One or both of these bits will be set when the USB bus activity causes the linestate to change and the device to wake while USB wakeup is enabled using PMLUSBWKEN."] - #[inline] - pub fn usblswkst(&mut self) -> _USBLSWKSTW { - _USBLSWKSTW { w: self } - } - #[doc = "Bit 2 - USB VBUS Detect Wakeup Flag (write one to clear). This bit will be set when the USB power supply is powered on or powered off."] - #[inline] - pub fn usbvbuswkst(&mut self) -> _USBVBUSWKSTW { - _USBVBUSWKSTW { w: self } - } - #[doc = "Bit 3 - Smart DMA Detect Wakeup Flag (write one to clear). This bit will be set when the SDMA IRQ transition from low to high or on high to low."] - #[inline] - pub fn sdmawkst(&mut self) -> _SDMAWKSTW { - _SDMAWKSTW { w: self } - } - #[doc = "Bit 16 - Battery Back Wakeup Flag (write one to clear). This bit will be set when exiting Battery Backup Mode."] - #[inline] - pub fn bbmodest(&mut self) -> _BBMODESTW { - _BBMODESTW { w: self } - } - } - } - #[doc = "Low Power Peripheral Wakeup Enable Register."] - pub struct LPPWEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Peripheral Wakeup Enable Register."] - pub mod lppwen { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPPWEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBLSWKENR { - bits: u8, - } - impl USBLSWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct USBVBUSWKENR { - bits: bool, - } - impl USBVBUSWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDMAWKENR { - bits: bool, - } - impl SDMAWKENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _USBLSWKENW<'a> { - w: &'a mut W, - } - impl<'a> _USBLSWKENW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _USBVBUSWKENW<'a> { - w: &'a mut W, - } - impl<'a> _USBVBUSWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDMAWKENW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAWKENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:1 - USB UTMI Linestate Detect Wakeup Enable. These bits allow wakeup from the corresponding USB linestate signal(s) on transition(s) from low to high or high to low when PM.USBWKEN is set."] - #[inline] - pub fn usblswken(&self) -> USBLSWKENR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - USBLSWKENR { bits } - } - #[doc = "Bit 2 - USB VBUS Detect Wakeup Enable. This bit allows wakeup from the USB power supply on or off status."] - #[inline] - pub fn usbvbuswken(&self) -> USBVBUSWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - USBVBUSWKENR { bits } - } - #[doc = "Bit 3 - Smart DMA Wakeup Enable. This bit allows wakeup from the Smart DMA IRQ."] - #[inline] - pub fn sdmawken(&self) -> SDMAWKENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDMAWKENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - USB UTMI Linestate Detect Wakeup Enable. These bits allow wakeup from the corresponding USB linestate signal(s) on transition(s) from low to high or high to low when PM.USBWKEN is set."] - #[inline] - pub fn usblswken(&mut self) -> _USBLSWKENW { - _USBLSWKENW { w: self } - } - #[doc = "Bit 2 - USB VBUS Detect Wakeup Enable. This bit allows wakeup from the USB power supply on or off status."] - #[inline] - pub fn usbvbuswken(&mut self) -> _USBVBUSWKENW { - _USBVBUSWKENW { w: self } - } - #[doc = "Bit 3 - Smart DMA Wakeup Enable. This bit allows wakeup from the Smart DMA IRQ."] - #[inline] - pub fn sdmawken(&mut self) -> _SDMAWKENW { - _SDMAWKENW { w: self } - } - } - } - #[doc = "Low Power Memory Shutdown Control."] - pub struct LPMEMSD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Memory Shutdown Control."] - pub mod lpmemsd { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPMEMSD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SRAM0SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM0SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM0SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM0SDR::NORMAL => false, - SRAM0SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM0SDR { - match value { - false => SRAM0SDR::NORMAL, - true => SRAM0SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM0SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM0SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM1SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM1SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM1SDR::NORMAL => false, - SRAM1SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM1SDR { - match value { - false => SRAM1SDR::NORMAL, - true => SRAM1SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM1SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM1SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM2SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM2SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM2SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM2SDR::NORMAL => false, - SRAM2SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM2SDR { - match value { - false => SRAM2SDR::NORMAL, - true => SRAM2SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM2SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM2SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM3SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM3SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM3SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM3SDR::NORMAL => false, - SRAM3SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM3SDR { - match value { - false => SRAM3SDR::NORMAL, - true => SRAM3SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM3SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM3SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM4SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM4SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM4SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM4SDR::NORMAL => false, - SRAM4SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM4SDR { - match value { - false => SRAM4SDR::NORMAL, - true => SRAM4SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM4SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM4SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM5SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM5SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM5SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM5SDR::NORMAL => false, - SRAM5SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM5SDR { - match value { - false => SRAM5SDR::NORMAL, - true => SRAM5SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM5SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM5SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SRAM6SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM6SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM6SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRAM6SDR::NORMAL => false, - SRAM6SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRAM6SDR { - match value { - false => SRAM6SDR::NORMAL, - true => SRAM6SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SRAM6SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SRAM6SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `ICACHESD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICACHESDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ICACHESDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ICACHESDR::NORMAL => false, - ICACHESDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ICACHESDR { - match value { - false => ICACHESDR::NORMAL, - true => ICACHESDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == ICACHESDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == ICACHESDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `ICACHEXIPSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICACHEXIPSDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ICACHEXIPSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ICACHEXIPSDR::NORMAL => false, - ICACHEXIPSDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ICACHEXIPSDR { - match value { - false => ICACHEXIPSDR::NORMAL, - true => ICACHEXIPSDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == ICACHEXIPSDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == ICACHEXIPSDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `SCACHESD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCACHESDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SCACHESDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCACHESDR::NORMAL => false, - SCACHESDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCACHESDR { - match value { - false => SCACHESDR::NORMAL, - true => SCACHESDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == SCACHESDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == SCACHESDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `CRYPTOSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOSDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl CRYPTOSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOSDR::NORMAL => false, - CRYPTOSDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOSDR { - match value { - false => CRYPTOSDR::NORMAL, - true => CRYPTOSDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == CRYPTOSDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == CRYPTOSDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `USBFIFOSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBFIFOSDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl USBFIFOSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBFIFOSDR::NORMAL => false, - USBFIFOSDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBFIFOSDR { - match value { - false => USBFIFOSDR::NORMAL, - true => USBFIFOSDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == USBFIFOSDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == USBFIFOSDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `ROMSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ROMSDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ROMSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ROMSDR::NORMAL => false, - ROMSDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ROMSDR { - match value { - false => ROMSDR::NORMAL, - true => ROMSDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == ROMSDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == ROMSDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `ROM1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ROM1SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ROM1SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ROM1SDR::NORMAL => false, - ROM1SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ROM1SDR { - match value { - false => ROM1SDR::NORMAL, - true => ROM1SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == ROM1SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == ROM1SDR::SHUTDOWN - } - } - #[doc = "Possible values of the field `IC1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC1SDR { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl IC1SDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - IC1SDR::NORMAL => false, - IC1SDR::SHUTDOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> IC1SDR { - match value { - false => IC1SDR::NORMAL, - true => IC1SDR::SHUTDOWN, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == IC1SDR::NORMAL - } - #[doc = "Checks if the value of the field is `SHUTDOWN`"] - #[inline] - pub fn is_shutdown(&self) -> bool { - *self == IC1SDR::SHUTDOWN - } - } - #[doc = "Values that can be written to the field `SRAM0SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM0SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM0SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM0SDW::NORMAL => false, - SRAM0SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM0SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM0SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM0SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM0SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM0SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM1SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM1SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM1SDW::NORMAL => false, - SRAM1SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM1SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM1SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM1SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM1SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM1SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM2SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM2SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM2SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM2SDW::NORMAL => false, - SRAM2SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM2SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM2SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM2SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM2SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM2SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM3SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM3SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM3SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM3SDW::NORMAL => false, - SRAM3SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM3SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM3SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM3SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM3SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM3SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM4SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM4SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM4SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM4SDW::NORMAL => false, - SRAM4SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM4SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM4SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM4SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM4SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM4SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM5SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM5SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM5SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM5SDW::NORMAL => false, - SRAM5SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM5SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM5SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM5SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM5SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM5SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRAM6SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRAM6SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SRAM6SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SRAM6SDW::NORMAL => false, - SRAM6SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SRAM6SDW<'a> { - w: &'a mut W, - } - impl<'a> _SRAM6SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRAM6SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SRAM6SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SRAM6SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ICACHESD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICACHESDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ICACHESDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ICACHESDW::NORMAL => false, - ICACHESDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ICACHESDW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHESDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ICACHESDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(ICACHESDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(ICACHESDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ICACHEXIPSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ICACHEXIPSDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ICACHEXIPSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ICACHEXIPSDW::NORMAL => false, - ICACHEXIPSDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ICACHEXIPSDW<'a> { - w: &'a mut W, - } - impl<'a> _ICACHEXIPSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ICACHEXIPSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(ICACHEXIPSDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(ICACHEXIPSDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCACHESD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCACHESDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl SCACHESDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCACHESDW::NORMAL => false, - SCACHESDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCACHESDW<'a> { - w: &'a mut W, - } - impl<'a> _SCACHESDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCACHESDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(SCACHESDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(SCACHESDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOSDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl CRYPTOSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOSDW::NORMAL => false, - CRYPTOSDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOSDW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(CRYPTOSDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(CRYPTOSDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBFIFOSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBFIFOSDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl USBFIFOSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBFIFOSDW::NORMAL => false, - USBFIFOSDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _USBFIFOSDW<'a> { - w: &'a mut W, - } - impl<'a> _USBFIFOSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBFIFOSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(USBFIFOSDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(USBFIFOSDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ROMSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ROMSDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ROMSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ROMSDW::NORMAL => false, - ROMSDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ROMSDW<'a> { - w: &'a mut W, - } - impl<'a> _ROMSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ROMSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(ROMSDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(ROMSDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ROM1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ROM1SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl ROM1SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ROM1SDW::NORMAL => false, - ROM1SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ROM1SDW<'a> { - w: &'a mut W, - } - impl<'a> _ROM1SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ROM1SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(ROM1SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(ROM1SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `IC1SD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IC1SDW { - #[doc = "Normal Operating Mode."] - NORMAL, - #[doc = "Shutdown Mode."] - SHUTDOWN, - } - impl IC1SDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - IC1SDW::NORMAL => false, - IC1SDW::SHUTDOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _IC1SDW<'a> { - w: &'a mut W, - } - impl<'a> _IC1SDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: IC1SDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Operating Mode."] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(IC1SDW::NORMAL) - } - #[doc = "Shutdown Mode."] - #[inline] - pub fn shutdown(self) -> &'a mut W { - self.variant(IC1SDW::SHUTDOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - System RAM block 0 Shut Down."] - #[inline] - pub fn sram0sd(&self) -> SRAM0SDR { - SRAM0SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - System RAM block 1 Shut Down."] - #[inline] - pub fn sram1sd(&self) -> SRAM1SDR { - SRAM1SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - System RAM block 2 Shut Down."] - #[inline] - pub fn sram2sd(&self) -> SRAM2SDR { - SRAM2SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - System RAM block 3 Shut Down."] - #[inline] - pub fn sram3sd(&self) -> SRAM3SDR { - SRAM3SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - System RAM block 4 Shut Down."] - #[inline] - pub fn sram4sd(&self) -> SRAM4SDR { - SRAM4SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - System RAM block 5 Shut Down."] - #[inline] - pub fn sram5sd(&self) -> SRAM5SDR { - SRAM5SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - System RAM block 6 Shut Down."] - #[inline] - pub fn sram6sd(&self) -> SRAM6SDR { - SRAM6SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Instruction Cache RAM Shut Down."] - #[inline] - pub fn icachesd(&self) -> ICACHESDR { - ICACHESDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - XiP Instruction Cache RAM Shut Down."] - #[inline] - pub fn icachexipsd(&self) -> ICACHEXIPSDR { - ICACHEXIPSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - System Cache RAM Shut Down."] - #[inline] - pub fn scachesd(&self) -> SCACHESDR { - SCACHESDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Crypto MAA RAM Shut Down."] - #[inline] - pub fn cryptosd(&self) -> CRYPTOSDR { - CRYPTOSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - USB FIFO Shut Down."] - #[inline] - pub fn usbfifosd(&self) -> USBFIFOSDR { - USBFIFOSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - ROM Shut Down."] - #[inline] - pub fn romsd(&self) -> ROMSDR { - ROMSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - ROM1 Shut Down."] - #[inline] - pub fn rom1sd(&self) -> ROM1SDR { - ROM1SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - ICache 1 Shut Down."] - #[inline] - pub fn ic1sd(&self) -> IC1SDR { - IC1SDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - System RAM block 0 Shut Down."] - #[inline] - pub fn sram0sd(&mut self) -> _SRAM0SDW { - _SRAM0SDW { w: self } - } - #[doc = "Bit 1 - System RAM block 1 Shut Down."] - #[inline] - pub fn sram1sd(&mut self) -> _SRAM1SDW { - _SRAM1SDW { w: self } - } - #[doc = "Bit 2 - System RAM block 2 Shut Down."] - #[inline] - pub fn sram2sd(&mut self) -> _SRAM2SDW { - _SRAM2SDW { w: self } - } - #[doc = "Bit 3 - System RAM block 3 Shut Down."] - #[inline] - pub fn sram3sd(&mut self) -> _SRAM3SDW { - _SRAM3SDW { w: self } - } - #[doc = "Bit 4 - System RAM block 4 Shut Down."] - #[inline] - pub fn sram4sd(&mut self) -> _SRAM4SDW { - _SRAM4SDW { w: self } - } - #[doc = "Bit 5 - System RAM block 5 Shut Down."] - #[inline] - pub fn sram5sd(&mut self) -> _SRAM5SDW { - _SRAM5SDW { w: self } - } - #[doc = "Bit 6 - System RAM block 6 Shut Down."] - #[inline] - pub fn sram6sd(&mut self) -> _SRAM6SDW { - _SRAM6SDW { w: self } - } - #[doc = "Bit 7 - Instruction Cache RAM Shut Down."] - #[inline] - pub fn icachesd(&mut self) -> _ICACHESDW { - _ICACHESDW { w: self } - } - #[doc = "Bit 8 - XiP Instruction Cache RAM Shut Down."] - #[inline] - pub fn icachexipsd(&mut self) -> _ICACHEXIPSDW { - _ICACHEXIPSDW { w: self } - } - #[doc = "Bit 9 - System Cache RAM Shut Down."] - #[inline] - pub fn scachesd(&mut self) -> _SCACHESDW { - _SCACHESDW { w: self } - } - #[doc = "Bit 10 - Crypto MAA RAM Shut Down."] - #[inline] - pub fn cryptosd(&mut self) -> _CRYPTOSDW { - _CRYPTOSDW { w: self } - } - #[doc = "Bit 11 - USB FIFO Shut Down."] - #[inline] - pub fn usbfifosd(&mut self) -> _USBFIFOSDW { - _USBFIFOSDW { w: self } - } - #[doc = "Bit 12 - ROM Shut Down."] - #[inline] - pub fn romsd(&mut self) -> _ROMSDW { - _ROMSDW { w: self } - } - #[doc = "Bit 13 - ROM1 Shut Down."] - #[inline] - pub fn rom1sd(&mut self) -> _ROM1SDW { - _ROM1SDW { w: self } - } - #[doc = "Bit 14 - ICache 1 Shut Down."] - #[inline] - pub fn ic1sd(&mut self) -> _IC1SDW { - _IC1SDW { w: self } - } - } - } - #[doc = "Low Power VDD Domain Power Down Control."] - pub struct LPVDDPD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power VDD Domain Power Down Control."] - pub mod lpvddpd { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPVDDPD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `VREGOBPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VREGOBPDR { - #[doc = "Enabled in backup mode."] - UP, - #[doc = "Disabled in backup mode."] - DOWN, - } - impl VREGOBPDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VREGOBPDR::UP => false, - VREGOBPDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VREGOBPDR { - match value { - false => VREGOBPDR::UP, - true => VREGOBPDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VREGOBPDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VREGOBPDR::DOWN - } - } - #[doc = "Possible values of the field `VREGODPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VREGODPDR { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VREGODPDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VREGODPDR::UP => false, - VREGODPDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VREGODPDR { - match value { - false => VREGODPDR::UP, - true => VREGODPDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VREGODPDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VREGODPDR::DOWN - } - } - #[doc = "Possible values of the field `VDD2PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD2PDR { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD2PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDD2PDR::UP => false, - VDD2PDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDD2PDR { - match value { - false => VDD2PDR::UP, - true => VDD2PDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VDD2PDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VDD2PDR::DOWN - } - } - #[doc = "Possible values of the field `VDD3PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD3PDR { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD3PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDD3PDR::UP => false, - VDD3PDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDD3PDR { - match value { - false => VDD3PDR::UP, - true => VDD3PDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VDD3PDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VDD3PDR::DOWN - } - } - #[doc = "Possible values of the field `VDD4PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD4PDR { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD4PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDD4PDR::UP => false, - VDD4PDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDD4PDR { - match value { - false => VDD4PDR::UP, - true => VDD4PDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VDD4PDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VDD4PDR::DOWN - } - } - #[doc = "Possible values of the field `VDD5PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD5PDR { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD5PDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDD5PDR::UP => false, - VDD5PDR::DOWN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDD5PDR { - match value { - false => VDD5PDR::UP, - true => VDD5PDR::DOWN, - } - } - #[doc = "Checks if the value of the field is `UP`"] - #[inline] - pub fn is_up(&self) -> bool { - *self == VDD5PDR::UP - } - #[doc = "Checks if the value of the field is `DOWN`"] - #[inline] - pub fn is_down(&self) -> bool { - *self == VDD5PDR::DOWN - } - } - #[doc = "Values that can be written to the field `VREGOBPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VREGOBPDW { - #[doc = "Enabled in backup mode."] - UP, - #[doc = "Disabled in backup mode."] - DOWN, - } - impl VREGOBPDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VREGOBPDW::UP => false, - VREGOBPDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VREGOBPDW<'a> { - w: &'a mut W, - } - impl<'a> _VREGOBPDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VREGOBPDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled in backup mode."] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VREGOBPDW::UP) - } - #[doc = "Disabled in backup mode."] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VREGOBPDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VREGODPD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VREGODPDW { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VREGODPDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VREGODPDW::UP => false, - VREGODPDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VREGODPDW<'a> { - w: &'a mut W, - } - impl<'a> _VREGODPDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VREGODPDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled"] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VREGODPDW::UP) - } - #[doc = "Disabled"] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VREGODPDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDD2PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD2PDW { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD2PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDD2PDW::UP => false, - VDD2PDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDD2PDW<'a> { - w: &'a mut W, - } - impl<'a> _VDD2PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDD2PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled"] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VDD2PDW::UP) - } - #[doc = "Disabled"] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VDD2PDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDD3PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD3PDW { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD3PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDD3PDW::UP => false, - VDD3PDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDD3PDW<'a> { - w: &'a mut W, - } - impl<'a> _VDD3PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDD3PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled"] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VDD3PDW::UP) - } - #[doc = "Disabled"] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VDD3PDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDD4PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD4PDW { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD4PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDD4PDW::UP => false, - VDD4PDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDD4PDW<'a> { - w: &'a mut W, - } - impl<'a> _VDD4PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDD4PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled"] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VDD4PDW::UP) - } - #[doc = "Disabled"] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VDD4PDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDD5PD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDD5PDW { - #[doc = "Enabled"] - UP, - #[doc = "Disabled"] - DOWN, - } - impl VDD5PDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDD5PDW::UP => false, - VDD5PDW::DOWN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDD5PDW<'a> { - w: &'a mut W, - } - impl<'a> _VDD5PDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDD5PDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enabled"] - #[inline] - pub fn up(self) -> &'a mut W { - self.variant(VDD5PDW::UP) - } - #[doc = "Disabled"] - #[inline] - pub fn down(self) -> &'a mut W { - self.variant(VDD5PDW::DOWN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Power down SIMO Vreg B (VCOREB+VDDC) in backup mode."] - #[inline] - pub fn vregobpd(&self) -> VREGOBPDR { - VREGOBPDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Power down SIMO Vreg D (BTLE)."] - #[inline] - pub fn vregodpd(&self) -> VREGODPDR { - VREGODPDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Power down VDD2 (CPU0+peripherals)."] - #[inline] - pub fn vdd2pd(&self) -> VDD2PDR { - VDD2PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Power down VDD3 (CPU1+audio)."] - #[inline] - pub fn vdd3pd(&self) -> VDD3PDR { - VDD3PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Power down VDD4 (SDMA+peripherals)."] - #[inline] - pub fn vdd4pd(&self) -> VDD4PDR { - VDD4PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Power down VDD5 (BTLE digital)."] - #[inline] - pub fn vdd5pd(&self) -> VDD5PDR { - VDD5PDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Power down SIMO Vreg B (VCOREB+VDDC) in backup mode."] - #[inline] - pub fn vregobpd(&mut self) -> _VREGOBPDW { - _VREGOBPDW { w: self } - } - #[doc = "Bit 1 - Power down SIMO Vreg D (BTLE)."] - #[inline] - pub fn vregodpd(&mut self) -> _VREGODPDW { - _VREGODPDW { w: self } - } - #[doc = "Bit 8 - Power down VDD2 (CPU0+peripherals)."] - #[inline] - pub fn vdd2pd(&mut self) -> _VDD2PDW { - _VDD2PDW { w: self } - } - #[doc = "Bit 9 - Power down VDD3 (CPU1+audio)."] - #[inline] - pub fn vdd3pd(&mut self) -> _VDD3PDW { - _VDD3PDW { w: self } - } - #[doc = "Bit 10 - Power down VDD4 (SDMA+peripherals)."] - #[inline] - pub fn vdd4pd(&mut self) -> _VDD4PDW { - _VDD4PDW { w: self } - } - #[doc = "Bit 11 - Power down VDD5 (BTLE digital)."] - #[inline] - pub fn vdd5pd(&mut self) -> _VDD5PDW { - _VDD5PDW { w: self } - } - } - } - #[doc = "General Purpose Register 0"] - pub struct GP0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "General Purpose Register 0"] - pub mod gp0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GP0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "General Purpose Register 1"] - pub struct GP1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "General Purpose Register 1"] - pub mod gp1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GP1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power Multi-Core Status"] - pub struct LPMCSTAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Multi-Core Status"] - pub mod lpmcstat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPMCSTAT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Low Power Multi-Core Request"] - pub struct LPMCREQ { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Low Power Multi-Core Request"] - pub mod lpmcreq { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::LPMCREQ { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } -} -#[doc = "Real Time Clock and Alarm."] -pub struct RTC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for RTC {} -impl RTC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const rtc::RegisterBlock { - 0x4000_6000 as *const _ - } -} -impl Deref for RTC { - type Target = rtc::RegisterBlock; - fn deref(&self) -> &rtc::RegisterBlock { - unsafe { &*RTC::ptr() } - } -} -#[doc = "Real Time Clock and Alarm."] -pub mod rtc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - RTC Second Counter. This register contains the 32-bit second counter."] - pub sec: SEC, - #[doc = "0x04 - RTC Sub-second Counter. This counter increments at 256Hz. RTC_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub ssec: SSEC, - #[doc = "0x08 - Time-of-day Alarm."] - pub ras: RAS, - #[doc = "0x0c - RTC sub-second alarm. This register contains the reload value for the sub-second alarm."] - pub rssa: RSSA, - #[doc = "0x10 - RTC Control Register."] - pub ctrl: CTRL, - #[doc = "0x14 - RTC Trim Register."] - pub trim: TRIM, - #[doc = "0x18 - RTC Oscillator Control Register."] - pub oscctrl: OSCCTRL, - } - #[doc = "RTC Second Counter. This register contains the 32-bit second counter."] - pub struct SEC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Second Counter. This register contains the 32-bit second counter."] - pub mod sec { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SEC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "RTC Sub-second Counter. This counter increments at 256Hz. RTC_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub struct SSEC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Sub-second Counter. This counter increments at 256Hz. RTC_SEC is incremented when this register rolls over from 0xFF to 0x00."] - pub mod ssec { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SSEC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RTSSR { - bits: u8, - } - impl RTSSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RTSSW<'a> { - w: &'a mut W, - } - impl<'a> _RTSSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - RTC Sub-second Counter."] - #[inline] - pub fn rtss(&self) -> RTSSR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RTSSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - RTC Sub-second Counter."] - #[inline] - pub fn rtss(&mut self) -> _RTSSW { - _RTSSW { w: self } - } - } - } - #[doc = "Time-of-day Alarm."] - pub struct RAS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Time-of-day Alarm."] - pub mod ras { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RAS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RASR { - bits: u32, - } - impl RASR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RASW<'a> { - w: &'a mut W, - } - impl<'a> _RASW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x000f_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:19 - Time-of-day Alarm."] - #[inline] - pub fn ras(&self) -> RASR { - let bits = { - const MASK: u32 = 0x000f_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - RASR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:19 - Time-of-day Alarm."] - #[inline] - pub fn ras(&mut self) -> _RASW { - _RASW { w: self } - } - } - } - #[doc = "RTC sub-second alarm. This register contains the reload value for the sub-second alarm."] - pub struct RSSA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC sub-second alarm. This register contains the reload value for the sub-second alarm."] - pub mod rssa { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RSSA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RSSAR { - bits: u32, - } - impl RSSAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RSSAW<'a> { - w: &'a mut W, - } - impl<'a> _RSSAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - This register contains the reload value for the sub-second alarm."] - #[inline] - pub fn rssa(&self) -> RSSAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - RSSAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - This register contains the reload value for the sub-second alarm."] - #[inline] - pub fn rssa(&mut self) -> _RSSAW { - _RSSAW { w: self } - } - } - } - #[doc = "RTC Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `RTCE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RTCER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RTCER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RTCER::DIS => false, - RTCER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RTCER { - match value { - false => RTCER::DIS, - true => RTCER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RTCER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RTCER::EN - } - } - #[doc = "Possible values of the field `ADE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ADER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADER::DIS => false, - ADER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADER { - match value { - false => ADER::DIS, - true => ADER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ADER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ADER::EN - } - } - #[doc = "Possible values of the field `ASE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ASER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ASER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ASER::DIS => false, - ASER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ASER { - match value { - false => ASER::DIS, - true => ASER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ASER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ASER::EN - } - } - #[doc = "Possible values of the field `BUSY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSYR { - #[doc = "Idle."] - IDLE, - #[doc = "Busy."] - BUSY, - } - impl BUSYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSYR::IDLE => false, - BUSYR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSYR { - match value { - false => BUSYR::IDLE, - true => BUSYR::BUSY, - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == BUSYR::IDLE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == BUSYR::BUSY - } - } - #[doc = "Possible values of the field `RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYR { - #[doc = "Register has not updated."] - BUSY, - #[doc = "Ready."] - READY, - } - impl RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RDYR::BUSY => false, - RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RDYR { - match value { - false => RDYR::BUSY, - true => RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == RDYR::BUSY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == RDYR::READY - } - } - #[doc = "Possible values of the field `RDYE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYER { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RDYER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RDYER::DIS => false, - RDYER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RDYER { - match value { - false => RDYER::DIS, - true => RDYER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RDYER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RDYER::EN - } - } - #[doc = "Possible values of the field `ALDF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ALDFR { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl ALDFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ALDFR::INACTIVE => false, - ALDFR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ALDFR { - match value { - false => ALDFR::INACTIVE, - true => ALDFR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ALDFR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ALDFR::PENDING - } - } - #[doc = "Possible values of the field `ALSF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ALSFR { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl ALSFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ALSFR::INACTIVE => false, - ALSFR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ALSFR { - match value { - false => ALSFR::INACTIVE, - true => ALSFR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == ALSFR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == ALSFR::PENDING - } - } - #[doc = "Possible values of the field `SQE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQER { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl SQER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SQER::INACTIVE => false, - SQER::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SQER { - match value { - false => SQER::INACTIVE, - true => SQER::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == SQER::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == SQER::PENDING - } - } - #[doc = "Possible values of the field `FT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FTR { - #[doc = "1 Hz (Compensated)."] - FREQ1HZ, - #[doc = "512 Hz (Compensated)."] - FREQ512HZ, - #[doc = "4 KHz."] - FREQ4KHZ, - #[doc = "RTC Input Clock / 8."] - CLKDIV8, - } - impl FTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - FTR::FREQ1HZ => 0, - FTR::FREQ512HZ => 0x01, - FTR::FREQ4KHZ => 0x02, - FTR::CLKDIV8 => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> FTR { - match value { - 0 => FTR::FREQ1HZ, - 1 => FTR::FREQ512HZ, - 2 => FTR::FREQ4KHZ, - 3 => FTR::CLKDIV8, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `FREQ1HZ`"] - #[inline] - pub fn is_freq1hz(&self) -> bool { - *self == FTR::FREQ1HZ - } - #[doc = "Checks if the value of the field is `FREQ512HZ`"] - #[inline] - pub fn is_freq512hz(&self) -> bool { - *self == FTR::FREQ512HZ - } - #[doc = "Checks if the value of the field is `FREQ4KHZ`"] - #[inline] - pub fn is_freq4khz(&self) -> bool { - *self == FTR::FREQ4KHZ - } - #[doc = "Checks if the value of the field is `CLKDIV8`"] - #[inline] - pub fn is_clk_div8(&self) -> bool { - *self == FTR::CLKDIV8 - } - } - #[doc = "Possible values of the field `X32KMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32KMDR { - #[doc = "Always operate in Noise Immune Mode. Oscillator warm-up required."] - NOISEIMMUNEMODE, - #[doc = "Always operate in Quiet Mode. No oscillator warm-up required."] - QUIETMODE, - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - QUIETINSTOPWITHWARMUP, - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will not wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - QUIETINSTOPNOWARMUP, - } - impl X32KMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - X32KMDR::NOISEIMMUNEMODE => 0, - X32KMDR::QUIETMODE => 0x01, - X32KMDR::QUIETINSTOPWITHWARMUP => 0x02, - X32KMDR::QUIETINSTOPNOWARMUP => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> X32KMDR { - match value { - 0 => X32KMDR::NOISEIMMUNEMODE, - 1 => X32KMDR::QUIETMODE, - 2 => X32KMDR::QUIETINSTOPWITHWARMUP, - 3 => X32KMDR::QUIETINSTOPNOWARMUP, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `NOISEIMMUNEMODE`"] - #[inline] - pub fn is_noise_immune_mode(&self) -> bool { - *self == X32KMDR::NOISEIMMUNEMODE - } - #[doc = "Checks if the value of the field is `QUIETMODE`"] - #[inline] - pub fn is_quiet_mode(&self) -> bool { - *self == X32KMDR::QUIETMODE - } - #[doc = "Checks if the value of the field is `QUIETINSTOPWITHWARMUP`"] - #[inline] - pub fn is_quiet_in_stop_with_warmup(&self) -> bool { - *self == X32KMDR::QUIETINSTOPWITHWARMUP - } - #[doc = "Checks if the value of the field is `QUIETINSTOPNOWARMUP`"] - #[inline] - pub fn is_quiet_in_stop_no_warmup(&self) -> bool { - *self == X32KMDR::QUIETINSTOPNOWARMUP - } - } - #[doc = "Possible values of the field `WE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WER { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl WER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WER::INACTIVE => false, - WER::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WER { - match value { - false => WER::INACTIVE, - true => WER::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == WER::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == WER::PENDING - } - } - #[doc = "Values that can be written to the field `RTCE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RTCEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RTCEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RTCEW::DIS => false, - RTCEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RTCEW<'a> { - w: &'a mut W, - } - impl<'a> _RTCEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RTCEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RTCEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RTCEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ADEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ADEW::DIS => false, - ADEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ADEW<'a> { - w: &'a mut W, - } - impl<'a> _ADEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ADEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ADEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ASE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ASEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl ASEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ASEW::DIS => false, - ASEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ASEW<'a> { - w: &'a mut W, - } - impl<'a> _ASEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ASEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ASEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ASEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYW { - #[doc = "Register has not updated."] - BUSY, - #[doc = "Ready."] - READY, - } - impl RDYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RDYW::BUSY => false, - RDYW::READY => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RDYW<'a> { - w: &'a mut W, - } - impl<'a> _RDYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RDYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Register has not updated."] - #[inline] - pub fn busy(self) -> &'a mut W { - self.variant(RDYW::BUSY) - } - #[doc = "Ready."] - #[inline] - pub fn ready(self) -> &'a mut W { - self.variant(RDYW::READY) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RDYE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RDYEW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RDYEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RDYEW::DIS => false, - RDYEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RDYEW<'a> { - w: &'a mut W, - } - impl<'a> _RDYEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RDYEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RDYEW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RDYEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SQE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SQEW { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl SQEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SQEW::INACTIVE => false, - SQEW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SQEW<'a> { - w: &'a mut W, - } - impl<'a> _SQEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SQEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not active"] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(SQEW::INACTIVE) - } - #[doc = "Active"] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(SQEW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FTW { - #[doc = "1 Hz (Compensated)."] - FREQ1HZ, - #[doc = "512 Hz (Compensated)."] - FREQ512HZ, - #[doc = "4 KHz."] - FREQ4KHZ, - #[doc = "RTC Input Clock / 8."] - CLKDIV8, - } - impl FTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - FTW::FREQ1HZ => 0, - FTW::FREQ512HZ => 1, - FTW::FREQ4KHZ => 2, - FTW::CLKDIV8 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _FTW<'a> { - w: &'a mut W, - } - impl<'a> _FTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FTW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "1 Hz (Compensated)."] - #[inline] - pub fn freq1hz(self) -> &'a mut W { - self.variant(FTW::FREQ1HZ) - } - #[doc = "512 Hz (Compensated)."] - #[inline] - pub fn freq512hz(self) -> &'a mut W { - self.variant(FTW::FREQ512HZ) - } - #[doc = "4 KHz."] - #[inline] - pub fn freq4khz(self) -> &'a mut W { - self.variant(FTW::FREQ4KHZ) - } - #[doc = "RTC Input Clock / 8."] - #[inline] - pub fn clk_div8(self) -> &'a mut W { - self.variant(FTW::CLKDIV8) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `X32KMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum X32KMDW { - #[doc = "Always operate in Noise Immune Mode. Oscillator warm-up required."] - NOISEIMMUNEMODE, - #[doc = "Always operate in Quiet Mode. No oscillator warm-up required."] - QUIETMODE, - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - QUIETINSTOPWITHWARMUP, - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will not wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - QUIETINSTOPNOWARMUP, - } - impl X32KMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - X32KMDW::NOISEIMMUNEMODE => 0, - X32KMDW::QUIETMODE => 1, - X32KMDW::QUIETINSTOPWITHWARMUP => 2, - X32KMDW::QUIETINSTOPNOWARMUP => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _X32KMDW<'a> { - w: &'a mut W, - } - impl<'a> _X32KMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: X32KMDW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Always operate in Noise Immune Mode. Oscillator warm-up required."] - #[inline] - pub fn noise_immune_mode(self) -> &'a mut W { - self.variant(X32KMDW::NOISEIMMUNEMODE) - } - #[doc = "Always operate in Quiet Mode. No oscillator warm-up required."] - #[inline] - pub fn quiet_mode(self) -> &'a mut W { - self.variant(X32KMDW::QUIETMODE) - } - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - #[inline] - pub fn quiet_in_stop_with_warmup(self) -> &'a mut W { - self.variant(X32KMDW::QUIETINSTOPWITHWARMUP) - } - #[doc = "Operate in Noise Immune Mode normally, switch to Quiet Mode on Stop Mode entry. Will not wait for 32K oscillator warm-up before code execution on Stop Mode exit."] - #[inline] - pub fn quiet_in_stop_no_warmup(self) -> &'a mut W { - self.variant(X32KMDW::QUIETINSTOPNOWARMUP) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WEW { - #[doc = "Not active"] - INACTIVE, - #[doc = "Active"] - PENDING, - } - impl WEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WEW::INACTIVE => false, - WEW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WEW<'a> { - w: &'a mut W, - } - impl<'a> _WEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Not active"] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(WEW::INACTIVE) - } - #[doc = "Active"] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(WEW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Real Time Clock Enable. This bit enables the Real Time Clock. This bit can only be written when WE=1 and BUSY =0. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn rtce(&self) -> RTCER { - RTCER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Alarm Time-of-Day Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ade(&self) -> ADER { - ADER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Alarm Sub-second Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ase(&self) -> ASER { - ASER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - RTC Busy. This bit is set to 1 by hardware when changes to RTC registers required a synchronized version of the register to be in place. This bit is automatically cleared by hardware."] - #[inline] - pub fn busy(&self) -> BUSYR { - BUSYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - RTC Ready. This bit is set to 1 by hardware when the RTC count registers update. It can be cleared to 0 by software at any time. It will also be cleared to 0 by hardware just prior to an update of the RTC count register."] - #[inline] - pub fn rdy(&self) -> RDYR { - RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - RTC Ready Interrupt Enable."] - #[inline] - pub fn rdye(&self) -> RDYER { - RDYER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Time-of-Day Alarm Interrupt Flag. This alarm is qualified as wake-up source to the processor."] - #[inline] - pub fn aldf(&self) -> ALDFR { - ALDFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Sub-second Alarm Interrupt Flag. This alarm is qualified as wake-up source to the processor."] - #[inline] - pub fn alsf(&self) -> ALSFR { - ALSFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Square Wave Output Enable."] - #[inline] - pub fn sqe(&self) -> SQER { - SQER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 9:10 - Frequency Output Selection. When SQE=1, these bits specify the output frequency on the SQW pin."] - #[inline] - pub fn ft(&self) -> FTR { - FTR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 11:12 - 32KHz Oscillator Mode."] - #[inline] - pub fn x32kmd(&self) -> X32KMDR { - X32KMDR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 15 - Write Enable. This register bit serves as a protection mechanism against unintentional writes to critical RTC bits."] - #[inline] - pub fn we(&self) -> WER { - WER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x08 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Real Time Clock Enable. This bit enables the Real Time Clock. This bit can only be written when WE=1 and BUSY =0. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn rtce(&mut self) -> _RTCEW { - _RTCEW { w: self } - } - #[doc = "Bit 1 - Alarm Time-of-Day Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ade(&mut self) -> _ADEW { - _ADEW { w: self } - } - #[doc = "Bit 2 - Alarm Sub-second Interrupt Enable. Change to this bit is effective only after BUSY is cleared from 1 to 0."] - #[inline] - pub fn ase(&mut self) -> _ASEW { - _ASEW { w: self } - } - #[doc = "Bit 4 - RTC Ready. This bit is set to 1 by hardware when the RTC count registers update. It can be cleared to 0 by software at any time. It will also be cleared to 0 by hardware just prior to an update of the RTC count register."] - #[inline] - pub fn rdy(&mut self) -> _RDYW { - _RDYW { w: self } - } - #[doc = "Bit 5 - RTC Ready Interrupt Enable."] - #[inline] - pub fn rdye(&mut self) -> _RDYEW { - _RDYEW { w: self } - } - #[doc = "Bit 8 - Square Wave Output Enable."] - #[inline] - pub fn sqe(&mut self) -> _SQEW { - _SQEW { w: self } - } - #[doc = "Bits 9:10 - Frequency Output Selection. When SQE=1, these bits specify the output frequency on the SQW pin."] - #[inline] - pub fn ft(&mut self) -> _FTW { - _FTW { w: self } - } - #[doc = "Bits 11:12 - 32KHz Oscillator Mode."] - #[inline] - pub fn x32kmd(&mut self) -> _X32KMDW { - _X32KMDW { w: self } - } - #[doc = "Bit 15 - Write Enable. This register bit serves as a protection mechanism against unintentional writes to critical RTC bits."] - #[inline] - pub fn we(&mut self) -> _WEW { - _WEW { w: self } - } - } - } - #[doc = "RTC Trim Register."] - pub struct TRIM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Trim Register."] - pub mod trim { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TRIM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TRIMR { - bits: u8, - } - impl TRIMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct VBATTMRR { - bits: u32, - } - impl VBATTMRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TRIMW<'a> { - w: &'a mut W, - } - impl<'a> _TRIMW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VBATTMRW<'a> { - w: &'a mut W, - } - impl<'a> _VBATTMRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - RTC Trim. This register contains the 2's complement value that specifies the trim resolution. Each increment or decrement of the bit adds or subtracts 1ppm at each 4KHz clock value, with a maximum correction of +/- 127ppm."] - #[inline] - pub fn trim(&self) -> TRIMR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TRIMR { bits } - } - #[doc = "Bits 8:31 - VBAT Timer Value. When RTC is running off of VBAT, this field is incremented every 32 seconds."] - #[inline] - pub fn vbattmr(&self) -> VBATTMRR { - let bits = { - const MASK: u32 = 0x00ff_ffff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - VBATTMRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - RTC Trim. This register contains the 2's complement value that specifies the trim resolution. Each increment or decrement of the bit adds or subtracts 1ppm at each 4KHz clock value, with a maximum correction of +/- 127ppm."] - #[inline] - pub fn trim(&mut self) -> _TRIMW { - _TRIMW { w: self } - } - #[doc = "Bits 8:31 - VBAT Timer Value. When RTC is running off of VBAT, this field is incremented every 32 seconds."] - #[inline] - pub fn vbattmr(&mut self) -> _VBATTMRW { - _VBATTMRW { w: self } - } - } - } - #[doc = "RTC Oscillator Control Register."] - pub struct OSCCTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Oscillator Control Register."] - pub mod oscctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OSCCTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct FLITER_ENR { - bits: bool, - } - impl FLITER_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `IBIAS_SEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IBIAS_SELR { - #[doc = "Selects 2X bias current for RTC oscillator"] - _2X, - #[doc = "Selects 4X bias current for RTC oscillator"] - _4X, - } - impl IBIAS_SELR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - IBIAS_SELR::_2X => false, - IBIAS_SELR::_4X => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> IBIAS_SELR { - match value { - false => IBIAS_SELR::_2X, - true => IBIAS_SELR::_4X, - } - } - #[doc = "Checks if the value of the field is `_2X`"] - #[inline] - pub fn is_2x(&self) -> bool { - *self == IBIAS_SELR::_2X - } - #[doc = "Checks if the value of the field is `_4X`"] - #[inline] - pub fn is_4x(&self) -> bool { - *self == IBIAS_SELR::_4X - } - } - #[doc = r" Value of the field"] - pub struct HYST_ENR { - bits: bool, - } - impl HYST_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IBIAS_ENR { - bits: bool, - } - impl IBIAS_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BYPASSR { - bits: bool, - } - impl BYPASSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct _32KOUTR { - bits: bool, - } - impl _32KOUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _FLITER_ENW<'a> { - w: &'a mut W, - } - impl<'a> _FLITER_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `IBIAS_SEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum IBIAS_SELW { - #[doc = "Selects 2X bias current for RTC oscillator"] - _2X, - #[doc = "Selects 4X bias current for RTC oscillator"] - _4X, - } - impl IBIAS_SELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - IBIAS_SELW::_2X => false, - IBIAS_SELW::_4X => true, - } - } - } - #[doc = r" Proxy"] - pub struct _IBIAS_SELW<'a> { - w: &'a mut W, - } - impl<'a> _IBIAS_SELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: IBIAS_SELW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Selects 2X bias current for RTC oscillator"] - #[inline] - pub fn _2x(self) -> &'a mut W { - self.variant(IBIAS_SELW::_2X) - } - #[doc = "Selects 4X bias current for RTC oscillator"] - #[inline] - pub fn _4x(self) -> &'a mut W { - self.variant(IBIAS_SELW::_4X) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HYST_ENW<'a> { - w: &'a mut W, - } - impl<'a> _HYST_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IBIAS_ENW<'a> { - w: &'a mut W, - } - impl<'a> _IBIAS_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BYPASSW<'a> { - w: &'a mut W, - } - impl<'a> _BYPASSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct __32KOUTW<'a> { - w: &'a mut W, - } - impl<'a> __32KOUTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - RTC Oscillator Filter Enable"] - #[inline] - pub fn fliter_en(&self) -> FLITER_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - FLITER_ENR { bits } - } - #[doc = "Bit 1 - RTC Oscillator 4X Bias Current Select"] - #[inline] - pub fn ibias_sel(&self) -> IBIAS_SELR { - IBIAS_SELR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RTC Oscillator Hysteresis Buffer Enable"] - #[inline] - pub fn hyst_en(&self) -> HYST_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HYST_ENR { bits } - } - #[doc = "Bit 3 - RTC Oscillator Bias Current Enable"] - #[inline] - pub fn ibias_en(&self) -> IBIAS_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IBIAS_ENR { bits } - } - #[doc = "Bit 4 - RTC Crystal Bypass"] - #[inline] - pub fn bypass(&self) -> BYPASSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BYPASSR { bits } - } - #[doc = "Bit 5 - RTC 32kHz Square Wave Output"] - #[inline] - pub fn _32kout(&self) -> _32KOUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - _32KOUTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - RTC Oscillator Filter Enable"] - #[inline] - pub fn fliter_en(&mut self) -> _FLITER_ENW { - _FLITER_ENW { w: self } - } - #[doc = "Bit 1 - RTC Oscillator 4X Bias Current Select"] - #[inline] - pub fn ibias_sel(&mut self) -> _IBIAS_SELW { - _IBIAS_SELW { w: self } - } - #[doc = "Bit 2 - RTC Oscillator Hysteresis Buffer Enable"] - #[inline] - pub fn hyst_en(&mut self) -> _HYST_ENW { - _HYST_ENW { w: self } - } - #[doc = "Bit 3 - RTC Oscillator Bias Current Enable"] - #[inline] - pub fn ibias_en(&mut self) -> _IBIAS_ENW { - _IBIAS_ENW { w: self } - } - #[doc = "Bit 4 - RTC Crystal Bypass"] - #[inline] - pub fn bypass(&mut self) -> _BYPASSW { - _BYPASSW { w: self } - } - #[doc = "Bit 5 - RTC 32kHz Square Wave Output"] - #[inline] - pub fn _32kout(&mut self) -> __32KOUTW { - __32KOUTW { w: self } - } - } - } -} -#[doc = "Resource Protection Unit"] -pub struct RPU { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for RPU {} -impl RPU { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const rpu::RegisterBlock { - 0x4000_2000 as *const _ - } -} -impl Deref for RPU { - type Target = rpu::RegisterBlock; - fn deref(&self) -> &rpu::RegisterBlock { - unsafe { &*RPU::ptr() } - } -} -#[doc = "Resource Protection Unit"] -pub mod rpu { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - GCR Protection Register"] - pub gcr: GCR, - #[doc = "0x04 - SIR Protection Register"] - pub sir: SIR, - #[doc = "0x08 - FCR Protection Register"] - pub fcr: FCR, - #[doc = "0x0c - Crypto Protection Register"] - pub crypto: CRYPTO, - _reserved0: [u8; 32usize], - #[doc = "0x30 - Watchdog 0 Protection Register"] - pub wdt0: WDT0, - #[doc = "0x34 - Watchdog 1 Protection Register"] - pub wdt1: WDT1, - #[doc = "0x38 - Watchdog 2 Protection Register"] - pub wdt2: WDT2, - _reserved1: [u8; 4usize], - #[doc = "0x40 - SMON Protection Register"] - pub smon: SMON, - #[doc = "0x44 - SIMO Protection Register"] - pub simo: SIMO, - #[doc = "0x48 - DVS Protection Register"] - pub dvs: DVS, - _reserved2: [u8; 8usize], - #[doc = "0x54 - BBSIR Protection Register"] - pub bbsir: BBSIR, - _reserved3: [u8; 8usize], - #[doc = "0x60 - RTC Protection Register"] - pub rtc: RTC, - #[doc = "0x64 - Wakeup Timer Protection Register"] - pub wut: WUT, - #[doc = "0x68 - Power Sequencer Protection Register"] - pub pwrseq: PWRSEQ, - #[doc = "0x6c - BBCR Protection Register"] - pub bbcr: BBCR, - _reserved4: [u8; 16usize], - #[doc = "0x80 - GPIO0 Protection Register"] - pub gpio0: GPIO0, - _reserved5: [u8; 12usize], - #[doc = "0x90 - GPIO1 Protection Register"] - pub gpio1: GPIO1, - _reserved6: [u8; 108usize], - #[doc = "0x100 - TMR0 Protection Register"] - pub tmr0: TMR0, - _reserved7: [u8; 12usize], - #[doc = "0x110 - TMR1 Protection Register"] - pub tmr1: TMR1, - _reserved8: [u8; 12usize], - #[doc = "0x120 - TMR2 Protection Register"] - pub tmr2: TMR2, - _reserved9: [u8; 12usize], - #[doc = "0x130 - TMR3 Protection Register"] - pub tmr3: TMR3, - _reserved10: [u8; 12usize], - #[doc = "0x140 - TMR4 Protection Register"] - pub tmr4: TMR4, - _reserved11: [u8; 12usize], - #[doc = "0x150 - TMR5 Protection Register"] - pub tmr5: TMR5, - _reserved12: [u8; 92usize], - #[doc = "0x1b0 - HTimer0 Protection Register"] - pub htimer0: HTIMER0, - _reserved13: [u8; 12usize], - #[doc = "0x1c0 - HTimer1 Protection Register"] - pub htimer1: HTIMER1, - _reserved14: [u8; 12usize], - #[doc = "0x1d0 - I2C0 Protection Register"] - pub i2c0: I2C0, - _reserved15: [u8; 12usize], - #[doc = "0x1e0 - I2C1 Protection Register"] - pub i2c1: I2C1, - _reserved16: [u8; 12usize], - #[doc = "0x1f0 - I2C2 Protection Register"] - pub i2c2: I2C2, - _reserved17: [u8; 108usize], - #[doc = "0x260 - SPI-XIP Master Protection Register"] - pub spixipm: SPIXIPM, - _reserved18: [u8; 12usize], - #[doc = "0x270 - SPI-XIP Master Controller Protection Register"] - pub spixipmc: SPIXIPMC, - _reserved19: [u8; 12usize], - #[doc = "0x280 - DMA0 Protection Register"] - pub dma0: DMA0, - _reserved20: [u8; 12usize], - #[doc = "0x290 - Flash 0 Protection Register"] - pub flc0: FLC0, - #[doc = "0x294 - Flash 1 Protection Register"] - pub flc1: FLC1, - _reserved21: [u8; 8usize], - #[doc = "0x2a0 - Instruction Cache 0 Protection Register"] - pub icache0: ICACHE0, - #[doc = "0x2a4 - Instruction Cache 1 Protection Register"] - pub icache1: ICACHE1, - _reserved22: [u8; 72usize], - #[doc = "0x2f0 - Instruction Cache XIP Protection Register"] - pub icachexip: ICACHEXIP, - _reserved23: [u8; 60usize], - #[doc = "0x330 - Data Cache Controller Protection Register"] - pub dcache: DCACHE, - _reserved24: [u8; 12usize], - #[doc = "0x340 - ADC Protection Register"] - pub adc: ADC, - _reserved25: [u8; 12usize], - #[doc = "0x350 - DMA1 Protection Register"] - pub dma1: DMA1, - _reserved26: [u8; 12usize], - #[doc = "0x360 - SDMA Protection Register"] - pub sdma: SDMA, - _reserved27: [u8; 12usize], - #[doc = "0x370 - SDHC Controller Protection Register"] - pub sdhcctrl: SDHCCTRL, - _reserved28: [u8; 44usize], - #[doc = "0x3a0 - SPI Data Controller Protection Register"] - pub spid: SPID, - _reserved29: [u8; 28usize], - #[doc = "0x3c0 - Pulse Train Protection Register"] - pub pt: PT, - _reserved30: [u8; 12usize], - #[doc = "0x3d0 - One Wire Master Protection Register"] - pub owm: OWM, - _reserved31: [u8; 12usize], - #[doc = "0x3e0 - Semaphores Protection Register"] - pub sema: SEMA, - _reserved32: [u8; 60usize], - #[doc = "0x420 - UART0 Protection Register"] - pub uart0: UART0, - _reserved33: [u8; 12usize], - #[doc = "0x430 - UART1 Protection Register"] - pub uart1: UART1, - _reserved34: [u8; 12usize], - #[doc = "0x440 - UART2 Protection Register"] - pub uart2: UART2, - _reserved35: [u8; 28usize], - #[doc = "0x460 - QSPI1 Protection Register"] - pub qspi1: QSPI1, - _reserved36: [u8; 28usize], - #[doc = "0x480 - QSPI2 Protection Register"] - pub qspi2: QSPI2, - _reserved37: [u8; 60usize], - #[doc = "0x4c0 - Audio Subsystem Protection Register"] - pub audio: AUDIO, - _reserved38: [u8; 12usize], - #[doc = "0x4d0 - TRNG Protection Register"] - pub trng: TRNG, - _reserved39: [u8; 44usize], - #[doc = "0x500 - BTLE Registers Protection Register"] - pub btle: BTLE, - _reserved40: [u8; 1548usize], - #[doc = "0xb10 - USBHS Protection Register"] - pub usbhs: USBHS, - _reserved41: [u8; 76usize], - #[doc = "0xb60 - SDIO Protection Register"] - pub sdio: SDIO, - _reserved42: [u8; 92usize], - #[doc = "0xbc0 - SPI XIP Master FIFO Protection Register"] - pub spixipmfifo: SPIXIPMFIFO, - _reserved43: [u8; 28usize], - #[doc = "0xbe0 - QSPI0 Protection Register"] - pub qspi0: QSPI0, - _reserved44: [u8; 796usize], - #[doc = "0xf00 - SRAM0 Protection Register"] - pub sram0: SRAM0, - _reserved45: [u8; 12usize], - #[doc = "0xf10 - SRAM1 Protection Register"] - pub sram1: SRAM1, - _reserved46: [u8; 12usize], - #[doc = "0xf20 - SRAM2 Protection Register"] - pub sram2: SRAM2, - _reserved47: [u8; 12usize], - #[doc = "0xf30 - SRAM3 Protection Register"] - pub sram3: SRAM3, - _reserved48: [u8; 12usize], - #[doc = "0xf40 - SRAM4 Protection Register"] - pub sram4: SRAM4, - _reserved49: [u8; 12usize], - #[doc = "0xf50 - SRAM5 Protection Register"] - pub sram5: SRAM5, - _reserved50: [u8; 12usize], - #[doc = "0xf60 - SRAM6 Protection Register"] - pub sram6: SRAM6, - } - #[doc = "GCR Protection Register"] - pub struct GCR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GCR Protection Register"] - pub mod gcr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GCR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GCR"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GCR"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GCR"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GCR"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GCR"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GCR"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GCR"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GCR"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GCR"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GCR"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GCR"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GCR"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GCR"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GCR"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GCR"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GCR"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GCR"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GCR"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SIR Protection Register"] - pub struct SIR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SIR Protection Register"] - pub mod sir { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SIR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SIR"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SIR"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SIR"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SIR"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SIR"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SIR"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SIR"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SIR"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SIR"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SIR"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SIR"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SIR"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SIR"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SIR"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SIR"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SIR"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SIR"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SIR"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "FCR Protection Register"] - pub struct FCR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "FCR Protection Register"] - pub mod fcr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FCR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the FCR"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the FCR"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the FCR"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the FCR"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the FCR"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the FCR"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the FCR"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the FCR"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the FCR"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the FCR"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the FCR"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the FCR"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the FCR"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the FCR"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the FCR"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the FCR"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the FCR"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the FCR"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Crypto Protection Register"] - pub struct CRYPTO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Crypto Protection Register"] - pub mod crypto { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CRYPTO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Crypto"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Crypto"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Crypto"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Crypto"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Crypto"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Crypto"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Crypto"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Crypto"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Crypto"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Crypto"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Crypto"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Crypto"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Crypto"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Crypto"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Crypto"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Crypto"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Crypto"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Crypto"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Watchdog 0 Protection Register"] - pub struct WDT0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Watchdog 0 Protection Register"] - pub mod wdt0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WDT0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Watchdog 1 Protection Register"] - pub struct WDT1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Watchdog 1 Protection Register"] - pub mod wdt1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WDT1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Watchdog 2 Protection Register"] - pub struct WDT2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Watchdog 2 Protection Register"] - pub mod wdt2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WDT2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 2"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 2"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 2"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 2"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 2"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 2"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 2"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 2"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 2"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Watchdog 2"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Watchdog 2"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Watchdog 2"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Watchdog 2"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Watchdog 2"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Watchdog 2"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Watchdog 2"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Watchdog 2"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Watchdog 2"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SMON Protection Register"] - pub struct SMON { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SMON Protection Register"] - pub mod smon { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SMON { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SMON"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SMON"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SMON"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SMON"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SMON"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SMON"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SMON"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SMON"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SMON"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SMON"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SMON"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SMON"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SMON"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SMON"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SMON"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SMON"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SMON"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SMON"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SIMO Protection Register"] - pub struct SIMO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SIMO Protection Register"] - pub mod simo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SIMO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SIMO"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SIMO"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SIMO"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SIMO"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SIMO"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SIMO"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SIMO"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SIMO"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SIMO"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SIMO"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SIMO"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SIMO"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SIMO"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SIMO"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SIMO"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SIMO"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SIMO"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SIMO"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "DVS Protection Register"] - pub struct DVS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DVS Protection Register"] - pub mod dvs { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DVS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DVS"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DVS"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DVS"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DVS"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DVS"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DVS"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DVS"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DVS"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DVS"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DVS"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DVS"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DVS"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DVS"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DVS"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DVS"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DVS"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DVS"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DVS"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "BBSIR Protection Register"] - pub struct BBSIR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "BBSIR Protection Register"] - pub mod bbsir { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BBSIR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BBSIR"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BBSIR"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BBSIR"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BBSIR"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BBSIR"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BBSIR"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BBSIR"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BBSIR"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BBSIR"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BBSIR"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BBSIR"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BBSIR"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BBSIR"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BBSIR"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BBSIR"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BBSIR"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BBSIR"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BBSIR"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "RTC Protection Register"] - pub struct RTC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "RTC Protection Register"] - pub mod rtc { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RTC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the RTC"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the RTC"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the RTC"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the RTC"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the RTC"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the RTC"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the RTC"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the RTC"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the RTC"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the RTC"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the RTC"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the RTC"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the RTC"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the RTC"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the RTC"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the RTC"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the RTC"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the RTC"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Wakeup Timer Protection Register"] - pub struct WUT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Protection Register"] - pub mod wut { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WUT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Wakeup Timer"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Wakeup Timer"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Wakeup Timer"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Wakeup Timer"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Wakeup Timer"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Wakeup Timer"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Wakeup Timer"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Wakeup Timer"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Wakeup Timer"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Wakeup Timer"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Wakeup Timer"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Wakeup Timer"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Wakeup Timer"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Wakeup Timer"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Wakeup Timer"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Wakeup Timer"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Wakeup Timer"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Wakeup Timer"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Power Sequencer Protection Register"] - pub struct PWRSEQ { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Power Sequencer Protection Register"] - pub mod pwrseq { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PWRSEQ { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Power Sequencer"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Power Sequencer"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Power Sequencer"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Power Sequencer"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Power Sequencer"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Power Sequencer"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Power Sequencer"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Power Sequencer"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Power Sequencer"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Power Sequencer"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Power Sequencer"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Power Sequencer"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Power Sequencer"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Power Sequencer"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Power Sequencer"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Power Sequencer"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Power Sequencer"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Power Sequencer"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "BBCR Protection Register"] - pub struct BBCR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "BBCR Protection Register"] - pub mod bbcr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BBCR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BBCR"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BBCR"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BBCR"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BBCR"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BBCR"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BBCR"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BBCR"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BBCR"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BBCR"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BBCR"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BBCR"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BBCR"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BBCR"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BBCR"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BBCR"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BBCR"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BBCR"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BBCR"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "GPIO0 Protection Register"] - pub struct GPIO0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO0 Protection Register"] - pub mod gpio0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GPIO0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GPIO0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GPIO0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GPIO0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GPIO0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GPIO0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GPIO0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GPIO0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GPIO0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GPIO0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GPIO0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GPIO0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GPIO0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GPIO0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GPIO0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GPIO0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GPIO0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GPIO0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GPIO0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "GPIO1 Protection Register"] - pub struct GPIO1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "GPIO1 Protection Register"] - pub mod gpio1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GPIO1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GPIO1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GPIO1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GPIO1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GPIO1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GPIO1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GPIO1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GPIO1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GPIO1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GPIO1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the GPIO1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the GPIO1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the GPIO1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the GPIO1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the GPIO1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the GPIO1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the GPIO1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the GPIO1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the GPIO1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR0 Protection Register"] - pub struct TMR0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR0 Protection Register"] - pub mod tmr0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR1 Protection Register"] - pub struct TMR1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR1 Protection Register"] - pub mod tmr1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR2 Protection Register"] - pub struct TMR2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR2 Protection Register"] - pub mod tmr2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR2"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR2"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR2"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR2"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR2"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR2"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR2"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR2"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR2"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR2"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR2"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR2"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR2"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR2"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR2"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR2"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR2"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR2"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR3 Protection Register"] - pub struct TMR3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR3 Protection Register"] - pub mod tmr3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR3"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR3"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR3"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR3"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR3"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR3"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR3"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR3"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR3"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR3"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR3"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR3"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR3"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR3"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR3"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR3"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR3"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR3"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR4 Protection Register"] - pub struct TMR4 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR4 Protection Register"] - pub mod tmr4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR4 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR4"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR4"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR4"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR4"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR4"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR4"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR4"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR4"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR4"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR4"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR4"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR4"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR4"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR4"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR4"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR4"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR4"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR4"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TMR5 Protection Register"] - pub struct TMR5 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TMR5 Protection Register"] - pub mod tmr5 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TMR5 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR5"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR5"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR5"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR5"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR5"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR5"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR5"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR5"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR5"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TMR5"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TMR5"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TMR5"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TMR5"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TMR5"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TMR5"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TMR5"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TMR5"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TMR5"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "HTimer0 Protection Register"] - pub struct HTIMER0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer0 Protection Register"] - pub mod htimer0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HTIMER0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the HTimer0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the HTimer0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the HTimer0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the HTimer0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the HTimer0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the HTimer0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the HTimer0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the HTimer0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the HTimer0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the HTimer0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the HTimer0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the HTimer0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the HTimer0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the HTimer0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the HTimer0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the HTimer0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the HTimer0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the HTimer0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "HTimer1 Protection Register"] - pub struct HTIMER1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "HTimer1 Protection Register"] - pub mod htimer1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::HTIMER1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the HTimer1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the HTimer1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the HTimer1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the HTimer1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the HTimer1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the HTimer1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the HTimer1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the HTimer1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the HTimer1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the HTimer1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the HTimer1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the HTimer1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the HTimer1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the HTimer1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the HTimer1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the HTimer1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the HTimer1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the HTimer1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "I2C0 Protection Register"] - pub struct I2C0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "I2C0 Protection Register"] - pub mod i2c0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::I2C0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "I2C1 Protection Register"] - pub struct I2C1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "I2C1 Protection Register"] - pub mod i2c1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::I2C1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "I2C2 Protection Register"] - pub struct I2C2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "I2C2 Protection Register"] - pub mod i2c2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::I2C2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C2"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C2"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C2"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C2"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C2"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C2"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C2"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C2"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C2"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the I2C2"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the I2C2"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the I2C2"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the I2C2"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the I2C2"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the I2C2"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the I2C2"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the I2C2"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the I2C2"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SPI-XIP Master Protection Register"] - pub struct SPIXIPM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI-XIP Master Protection Register"] - pub mod spixipm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SPIXIPM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI-XIP Master"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI-XIP Master"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI-XIP Master"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI-XIP Master"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI-XIP Master"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI-XIP Master"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI-XIP Master"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI-XIP Master"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPI-XIP Master"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI-XIP Master"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI-XIP Master"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI-XIP Master"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI-XIP Master"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI-XIP Master"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI-XIP Master"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI-XIP Master"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI-XIP Master"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPI-XIP Master"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SPI-XIP Master Controller Protection Register"] - pub struct SPIXIPMC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI-XIP Master Controller Protection Register"] - pub mod spixipmc { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SPIXIPMC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI-XIP Master Controller"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI-XIP Master Controller"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI-XIP Master Controller"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI-XIP Master Controller"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI-XIP Master Controller"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI-XIP Master Controller"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI-XIP Master Controller"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI-XIP Master Controller"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI-XIP Master Controller"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI-XIP Master Controller"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI-XIP Master Controller"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI-XIP Master Controller"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPI-XIP Master Controller"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "DMA0 Protection Register"] - pub struct DMA0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA0 Protection Register"] - pub mod dma0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DMA0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DMA0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DMA0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DMA0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DMA0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DMA0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DMA0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DMA0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DMA0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DMA0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DMA0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DMA0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DMA0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DMA0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DMA0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DMA0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DMA0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DMA0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Flash 0 Protection Register"] - pub struct FLC0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash 0 Protection Register"] - pub mod flc0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FLC0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Flash 0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Flash 0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Flash 0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Flash 0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Flash 0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Flash 0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Flash 0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Flash 0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Flash 0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Flash 0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Flash 0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Flash 0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Flash 0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Flash 0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Flash 0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Flash 0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Flash 0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Flash 0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Flash 1 Protection Register"] - pub struct FLC1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Flash 1 Protection Register"] - pub mod flc1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FLC1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Flash 1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Flash 1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Flash 1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Flash 1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Flash 1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Flash 1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Flash 1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Flash 1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Flash 1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Flash 1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Flash 1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Flash 1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Flash 1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Flash 1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Flash 1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Flash 1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Flash 1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Flash 1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Instruction Cache 0 Protection Register"] - pub struct ICACHE0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Instruction Cache 0 Protection Register"] - pub mod icache0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ICACHE0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache 0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache 0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache 0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache 0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache 0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache 0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache 0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache 0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache 0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache 0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache 0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache 0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache 0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache 0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache 0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache 0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache 0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache 0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Instruction Cache 1 Protection Register"] - pub struct ICACHE1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Instruction Cache 1 Protection Register"] - pub mod icache1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ICACHE1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache 1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache 1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache 1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache 1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache 1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache 1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache 1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache 1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache 1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache 1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache 1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache 1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache 1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache 1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache 1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache 1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache 1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache 1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Instruction Cache XIP Protection Register"] - pub struct ICACHEXIP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Instruction Cache XIP Protection Register"] - pub mod icachexip { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ICACHEXIP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache XIP"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache XIP"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache XIP"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache XIP"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache XIP"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache XIP"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache XIP"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache XIP"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache XIP"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Instruction Cache XIP"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Instruction Cache XIP"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Instruction Cache XIP"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Instruction Cache XIP"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Instruction Cache XIP"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Instruction Cache XIP"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Instruction Cache XIP"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Instruction Cache XIP"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Instruction Cache XIP"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Data Cache Controller Protection Register"] - pub struct DCACHE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Data Cache Controller Protection Register"] - pub mod dcache { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DCACHE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Data Cache Controller"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Data Cache Controller"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Data Cache Controller"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Data Cache Controller"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Data Cache Controller"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Data Cache Controller"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Data Cache Controller"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Data Cache Controller"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Data Cache Controller"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Data Cache Controller"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Data Cache Controller"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Data Cache Controller"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Data Cache Controller"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Data Cache Controller"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Data Cache Controller"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Data Cache Controller"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Data Cache Controller"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Data Cache Controller"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "ADC Protection Register"] - pub struct ADC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADC Protection Register"] - pub mod adc { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ADC { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the ADC"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the ADC"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the ADC"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the ADC"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the ADC"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the ADC"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the ADC"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the ADC"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the ADC"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the ADC"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the ADC"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the ADC"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the ADC"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the ADC"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the ADC"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the ADC"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the ADC"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the ADC"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "DMA1 Protection Register"] - pub struct DMA1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA1 Protection Register"] - pub mod dma1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DMA1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DMA1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DMA1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DMA1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DMA1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DMA1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DMA1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DMA1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DMA1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the DMA1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the DMA1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the DMA1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the DMA1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the DMA1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the DMA1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the DMA1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the DMA1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the DMA1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SDMA Protection Register"] - pub struct SDMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SDMA Protection Register"] - pub mod sdma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SDMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SDMA"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SDMA"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SDMA"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SDMA"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SDMA"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SDMA"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SDMA"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SDMA"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SDMA"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SDMA"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SDMA"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SDMA"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SDMA"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SDMA"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SDMA"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SDMA"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SDMA"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SDMA"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SDHC Controller Protection Register"] - pub struct SDHCCTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SDHC Controller Protection Register"] - pub mod sdhcctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SDHCCTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SDHC Controller"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SDHC Controller"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SDHC Controller"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SDHC Controller"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SDHC Controller"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SDHC Controller"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SDHC Controller"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SDHC Controller"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SDHC Controller"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SDHC Controller"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SDHC Controller"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SDHC Controller"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SDHC Controller"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SDHC Controller"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SDHC Controller"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SDHC Controller"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SDHC Controller"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SDHC Controller"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "SPI Data Controller Protection Register"] - pub struct SPID { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI Data Controller Protection Register"] - pub mod spid { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SPID { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI Data Controller"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI Data Controller"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI Data Controller"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI Data Controller"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI Data Controller"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI Data Controller"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI Data Controller"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI Data Controller"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPID"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the SPI Data Controller"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the SPI Data Controller"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the SPI Data Controller"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the SPI Data Controller"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the SPI Data Controller"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the SPI Data Controller"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the SPI Data Controller"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the SPI Data Controller"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the SPID"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Pulse Train Protection Register"] - pub struct PT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Pulse Train Protection Register"] - pub mod pt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Pulse Train"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Pulse Train"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Pulse Train"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Pulse Train"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Pulse Train"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Pulse Train"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Pulse Train"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Pulse Train"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Pulse Train"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Pulse Train"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Pulse Train"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Pulse Train"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Pulse Train"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Pulse Train"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Pulse Train"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Pulse Train"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Pulse Train"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Pulse Train"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "One Wire Master Protection Register"] - pub struct OWM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "One Wire Master Protection Register"] - pub mod owm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::OWM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the One Wire Master"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the One Wire Master"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the One Wire Master"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the One Wire Master"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the One Wire Master"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the One Wire Master"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the One Wire Master"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the One Wire Master"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the One Wire Master"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the One Wire Master"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the One Wire Master"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the One Wire Master"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the One Wire Master"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the One Wire Master"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the One Wire Master"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the One Wire Master"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the One Wire Master"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the One Wire Master"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Semaphores Protection Register"] - pub struct SEMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Semaphores Protection Register"] - pub mod sema { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SEMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Semaphores"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Semaphores"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Semaphores"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Semaphores"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Semaphores"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Semaphores"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Semaphores"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Semaphores"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Semaphores"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Semaphores"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Semaphores"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Semaphores"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Semaphores"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Semaphores"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Semaphores"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Semaphores"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Semaphores"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Semaphores"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "UART0 Protection Register"] - pub struct UART0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "UART0 Protection Register"] - pub mod uart0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::UART0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART0"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART0"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART0"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART0"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART0"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART0"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART0"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART0"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART0"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART0"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART0"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART0"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART0"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART0"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART0"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART0"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART0"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART0"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "UART1 Protection Register"] - pub struct UART1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "UART1 Protection Register"] - pub mod uart1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::UART1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "UART2 Protection Register"] - pub struct UART2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "UART2 Protection Register"] - pub mod uart2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::UART2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART2"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART2"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART2"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART2"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART2"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART2"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART2"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART2"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART2"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the UART2"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the UART2"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the UART2"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the UART2"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the UART2"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the UART2"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the UART2"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the UART2"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the UART2"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "QSPI1 Protection Register"] - pub struct QSPI1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "QSPI1 Protection Register"] - pub mod qspi1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::QSPI1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the QSPI1"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the QSPI1"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the QSPI1"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the QSPI1"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the QSPI1"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the QSPI1"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the QSPI1"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the QSPI1"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the QSPI1"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the QSPI1"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the QSPI1"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the QSPI1"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the QSPI1"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the QSPI1"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the QSPI1"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the QSPI1"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the QSPI1"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the QSPI1"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "QSPI2 Protection Register"] - pub struct QSPI2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "QSPI2 Protection Register"] - pub mod qspi2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::QSPI2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the QSPI2"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the QSPI2"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the QSPI2"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the QSPI2"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the QSPI2"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the QSPI2"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the QSPI2"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the QSPI2"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the QSPI2"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the QSPI2"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the QSPI2"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the QSPI2"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the QSPI2"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the QSPI2"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the QSPI2"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the QSPI2"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the QSPI2"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the QSPI2"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "Audio Subsystem Protection Register"] - pub struct AUDIO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Audio Subsystem Protection Register"] - pub mod audio { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::AUDIO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Audio Subsystem"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Audio Subsystem"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Audio Subsystem"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Audio Subsystem"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Audio Subsystem"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Audio Subsystem"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Audio Subsystem"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Audio Subsystem"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Audio Subsystem"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the Audio Subsystem"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the Audio Subsystem"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the Audio Subsystem"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the Audio Subsystem"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the Audio Subsystem"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the Audio Subsystem"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the Audio Subsystem"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the Audio Subsystem"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the Audio Subsystem"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "TRNG Protection Register"] - pub struct TRNG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TRNG Protection Register"] - pub mod trng { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TRNG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TRNG"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TRNG"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TRNG"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TRNG"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TRNG"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TRNG"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TRNG"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TRNG"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TRNG"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the TRNG"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the TRNG"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the TRNG"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the TRNG"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the TRNG"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the TRNG"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the TRNG"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the TRNG"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the TRNG"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "BTLE Registers Protection Register"] - pub struct BTLE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "BTLE Registers Protection Register"] - pub mod btle { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BTLE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNR::DIS => true, - DMA0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNR { - match value { - true => DMA0ACNR::DIS, - false => DMA0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNR::DIS => true, - DMA1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNR { - match value { - true => DMA1ACNR::DIS, - false => DMA1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNR::DIS => true, - USBACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNR { - match value { - true => USBACNR::DIS, - false => USBACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNR::DIS => true, - SYS0ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNR { - match value { - true => SYS0ACNR::DIS, - false => SYS0ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNR::DIS => true, - SYS1ACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNR { - match value { - true => SYS1ACNR::DIS, - false => SYS1ACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNR::DIS => true, - SDMADACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNR { - match value { - true => SDMADACNR::DIS, - false => SDMADACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNR::DIS => true, - SDMAIACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNR { - match value { - true => SDMAIACNR::DIS, - false => SDMAIACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNR::DIS => true, - CRYPTOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNR { - match value { - true => CRYPTOACNR::DIS, - false => CRYPTOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNR::DIS => true, - SDIOACNR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNR { - match value { - true => SDIOACNR::DIS, - false => SDIOACNR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNW::DIS => true, - DMA0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNW::DIS => true, - DMA1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNW::DIS => true, - USBACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNW::DIS => true, - SYS0ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNW::DIS => true, - SYS1ACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNW::DIS => true, - SDMADACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNW::DIS => true, - SDMAIACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNW::DIS => true, - CRYPTOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNW::DIS => true, - SDIOACNW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BTLE Registers"] - #[inline] - pub fn dma0acn(&self) -> DMA0ACNR { - DMA0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BTLE Registers"] - #[inline] - pub fn dma1acn(&self) -> DMA1ACNR { - DMA1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BTLE Registers"] - #[inline] - pub fn usbacn(&self) -> USBACNR { - USBACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BTLE Registers"] - #[inline] - pub fn sys0acn(&self) -> SYS0ACNR { - SYS0ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BTLE Registers"] - #[inline] - pub fn sys1acn(&self) -> SYS1ACNR { - SYS1ACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BTLE Registers"] - #[inline] - pub fn sdmadacn(&self) -> SDMADACNR { - SDMADACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BTLE Registers"] - #[inline] - pub fn sdmaiacn(&self) -> SDMAIACNR { - SDMAIACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BTLE Registers"] - #[inline] - pub fn cryptoacn(&self) -> CRYPTOACNR { - CRYPTOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BTLE Registers"] - #[inline] - pub fn sdioacn(&self) -> SDIOACNR { - SDIOACNR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 access to the BTLE Registers"] - #[inline] - pub fn dma0acn(&mut self) -> _DMA0ACNW { - _DMA0ACNW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA1 access to the BTLE Registers"] - #[inline] - pub fn dma1acn(&mut self) -> _DMA1ACNW { - _DMA1ACNW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow USB access to the BTLE Registers"] - #[inline] - pub fn usbacn(&mut self) -> _USBACNW { - _USBACNW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow SYS0 access to the BTLE Registers"] - #[inline] - pub fn sys0acn(&mut self) -> _SYS0ACNW { - _SYS0ACNW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow SYS1 access to the BTLE Registers"] - #[inline] - pub fn sys1acn(&mut self) -> _SYS1ACNW { - _SYS1ACNW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow SDMA Data access to the BTLE Registers"] - #[inline] - pub fn sdmadacn(&mut self) -> _SDMADACNW { - _SDMADACNW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SDMA Instruction access to the BTLE Registers"] - #[inline] - pub fn sdmaiacn(&mut self) -> _SDMAIACNW { - _SDMAIACNW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow CRYPTO access to the BTLE Registers"] - #[inline] - pub fn cryptoacn(&mut self) -> _CRYPTOACNW { - _CRYPTOACNW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SDIO access to the BTLE Registers"] - #[inline] - pub fn sdioacn(&mut self) -> _SDIOACNW { - _SDIOACNW { w: self } - } - } - } - #[doc = "USBHS Protection Register"] - pub struct USBHS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "USBHS Protection Register"] - pub mod usbhs { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::USBHS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the USBHS"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the USBHS"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the USBHS"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the USBHS"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the USBHS"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the USBHS"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the USBHS"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the USBHS"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the USBHS"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the USBHS"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the USBHS"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the USBHS"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the USBHS"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the USBHS"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the USBHS"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the USBHS"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the USBHS"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the USBHS"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the USBHS"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the USBHS"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the USBHS"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the USBHS"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the USBHS"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the USBHS"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the USBHS"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the USBHS"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the USBHS"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the USBHS"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the USBHS"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the USBHS"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the USBHS"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the USBHS"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the USBHS"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the USBHS"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the USBHS"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the USBHS"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SDIO Protection Register"] - pub struct SDIO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SDIO Protection Register"] - pub mod sdio { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SDIO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SDIO"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SDIO"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SDIO"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SDIO"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SDIO"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SDIO"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SDIO"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SDIO"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SDIO"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SDIO"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SDIO"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SDIO"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SDIO"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SDIO"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SDIO"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SDIO"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SDIO"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SDIO"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SDIO"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SDIO"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SDIO"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SDIO"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SDIO"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SDIO"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SDIO"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SDIO"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SDIO"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SDIO"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SDIO"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SDIO"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SDIO"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SDIO"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SDIO"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SDIO"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SDIO"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SDIO"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SPI XIP Master FIFO Protection Register"] - pub struct SPIXIPMFIFO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI XIP Master FIFO Protection Register"] - pub mod spixipmfifo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SPIXIPMFIFO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SPI XIP Master FIFO"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "QSPI0 Protection Register"] - pub struct QSPI0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "QSPI0 Protection Register"] - pub mod qspi0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::QSPI0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the QSPI0"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the QSPI0"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the QSPI0"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the QSPI0"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the QSPI0"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the QSPI0"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the QSPI0"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the QSPI0"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the QSPI0"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the QSPI0"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the QSPI0"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the QSPI0"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the QSPI0"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the QSPI0"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the QSPI0"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the QSPI0"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the QSPI0"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the QSPI0"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the QSPI0"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the QSPI0"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the QSPI0"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the QSPI0"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the QSPI0"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the QSPI0"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the QSPI0"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the QSPI0"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the QSPI0"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the QSPI0"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the QSPI0"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the QSPI0"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the QSPI0"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the QSPI0"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the QSPI0"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the QSPI0"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the QSPI0"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the QSPI0"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM0 Protection Register"] - pub struct SRAM0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM0 Protection Register"] - pub mod sram0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM0"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM0"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM0"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM0"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM0"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM0"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM0"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM0"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM0"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM0"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM0"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM0"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM0"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM0"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM0"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM0"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM0"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM0"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM0"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM0"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM0"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM0"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM0"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM0"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM0"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM0"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM0"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM0"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM0"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM0"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM0"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM0"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM0"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM0"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM0"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM0"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM1 Protection Register"] - pub struct SRAM1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM1 Protection Register"] - pub mod sram1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM1"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM1"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM1"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM1"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM1"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM1"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM1"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM1"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM1"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM1"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM1"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM1"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM1"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM1"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM1"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM1"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM1"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM1"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM1"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM1"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM1"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM1"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM1"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM1"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM1"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM1"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM1"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM1"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM1"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM1"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM1"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM1"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM1"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM1"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM1"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM1"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM2 Protection Register"] - pub struct SRAM2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM2 Protection Register"] - pub mod sram2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM2"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM2"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM2"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM2"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM2"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM2"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM2"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM2"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM2"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM2"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM2"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM2"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM2"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM2"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM2"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM2"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM2"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM2"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM2"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM2"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM2"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM2"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM2"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM2"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM2"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM2"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM2"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM2"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM2"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM2"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM2"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM2"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM2"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM2"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM2"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM2"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM3 Protection Register"] - pub struct SRAM3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM3 Protection Register"] - pub mod sram3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM3"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM3"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM3"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM3"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM3"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM3"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM3"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM3"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM3"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM3"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM3"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM3"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM3"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM3"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM3"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM3"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM3"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM3"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM3"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM3"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM3"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM3"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM3"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM3"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM3"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM3"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM3"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM3"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM3"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM3"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM3"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM3"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM3"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM3"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM3"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM3"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM4 Protection Register"] - pub struct SRAM4 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM4 Protection Register"] - pub mod sram4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM4 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM4"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM4"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM4"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM4"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM4"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM4"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM4"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM4"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM4"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM4"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM4"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM4"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM4"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM4"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM4"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM4"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM4"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM4"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM4"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM4"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM4"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM4"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM4"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM4"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM4"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM4"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM4"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM4"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM4"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM4"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM4"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM4"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM4"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM4"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM4"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM4"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM5 Protection Register"] - pub struct SRAM5 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM5 Protection Register"] - pub mod sram5 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM5 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM5"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM5"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM5"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM5"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM5"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM5"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM5"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM5"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM5"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM5"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM5"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM5"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM5"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM5"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM5"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM5"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM5"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM5"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM5"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM5"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM5"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM5"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM5"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM5"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM5"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM5"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM5"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM5"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM5"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM5"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM5"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM5"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM5"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM5"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM5"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM5"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } - #[doc = "SRAM6 Protection Register"] - pub struct SRAM6 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SRAM6 Protection Register"] - pub mod sram6 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SRAM6 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNRR::DIS => true, - DMA0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNRR { - match value { - true => DMA0ACNRR::DIS, - false => DMA0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA0ACNWR::DIS => true, - DMA0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA0ACNWR { - match value { - true => DMA0ACNWR::DIS, - false => DMA0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNRR::DIS => true, - DMA1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNRR { - match value { - true => DMA1ACNRR::DIS, - false => DMA1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA1ACNWR::DIS => true, - DMA1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA1ACNWR { - match value { - true => DMA1ACNWR::DIS, - false => DMA1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMA1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == DMA1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNRR::DIS => true, - USBACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNRR { - match value { - true => USBACNRR::DIS, - false => USBACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNRR::ALLOW - } - } - #[doc = "Possible values of the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBACNWR::DIS => true, - USBACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBACNWR { - match value { - true => USBACNWR::DIS, - false => USBACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == USBACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == USBACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNRR::DIS => true, - SYS0ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNRR { - match value { - true => SYS0ACNRR::DIS, - false => SYS0ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS0ACNWR::DIS => true, - SYS0ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS0ACNWR { - match value { - true => SYS0ACNWR::DIS, - false => SYS0ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS0ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS0ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNRR::DIS => true, - SYS1ACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNRR { - match value { - true => SYS1ACNRR::DIS, - false => SYS1ACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SYS1ACNWR::DIS => true, - SYS1ACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SYS1ACNWR { - match value { - true => SYS1ACNWR::DIS, - false => SYS1ACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SYS1ACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SYS1ACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNRR::DIS => true, - SDMADACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNRR { - match value { - true => SDMADACNRR::DIS, - false => SDMADACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMADACNWR::DIS => true, - SDMADACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMADACNWR { - match value { - true => SDMADACNWR::DIS, - false => SDMADACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMADACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMADACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNRR::DIS => true, - SDMAIACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNRR { - match value { - true => SDMAIACNRR::DIS, - false => SDMAIACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDMAIACNWR::DIS => true, - SDMAIACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDMAIACNWR { - match value { - true => SDMAIACNWR::DIS, - false => SDMAIACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDMAIACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDMAIACNWR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNRR::DIS => true, - CRYPTOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNRR { - match value { - true => CRYPTOACNRR::DIS, - false => CRYPTOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRYPTOACNWR::DIS => true, - CRYPTOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRYPTOACNWR { - match value { - true => CRYPTOACNWR::DIS, - false => CRYPTOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == CRYPTOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == CRYPTOACNWR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNRR::DIS => true, - SDIOACNRR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNRR { - match value { - true => SDIOACNRR::DIS, - false => SDIOACNRR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNRR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNRR::ALLOW - } - } - #[doc = "Possible values of the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWR { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIOACNWR::DIS => true, - SDIOACNWR::ALLOW => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIOACNWR { - match value { - true => SDIOACNWR::DIS, - false => SDIOACNWR::ALLOW, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SDIOACNWR::DIS - } - #[doc = "Checks if the value of the field is `ALLOW`"] - #[inline] - pub fn is_allow(&self) -> bool { - *self == SDIOACNWR::ALLOW - } - } - #[doc = "Values that can be written to the field `DMA0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNRW::DIS => true, - DMA0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA0ACNWW::DIS => true, - DMA0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNRW::DIS => true, - DMA1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMA1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl DMA1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA1ACNWW::DIS => true, - DMA1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _DMA1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMA1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(DMA1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNRW::DIS => true, - USBACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNRW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `USBACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl USBACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - USBACNWW::DIS => true, - USBACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _USBACNWW<'a> { - w: &'a mut W, - } - impl<'a> _USBACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: USBACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(USBACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(USBACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNRW::DIS => true, - SYS0ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS0ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS0ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS0ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS0ACNWW::DIS => true, - SYS0ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS0ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS0ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS0ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS0ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS0ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNRW::DIS => true, - SYS1ACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SYS1ACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SYS1ACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SYS1ACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SYS1ACNWW::DIS => true, - SYS1ACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SYS1ACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SYS1ACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SYS1ACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SYS1ACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SYS1ACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNRW::DIS => true, - SDMADACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMADACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMADACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMADACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMADACNWW::DIS => true, - SDMADACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMADACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMADACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMADACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMADACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMADACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNRW::DIS => true, - SDMAIACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDMAIACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDMAIACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDMAIACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDMAIACNWW::DIS => true, - SDMAIACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDMAIACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDMAIACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDMAIACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDMAIACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDMAIACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNRW::DIS => true, - CRYPTOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CRYPTOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRYPTOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl CRYPTOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CRYPTOACNWW::DIS => true, - CRYPTOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _CRYPTOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _CRYPTOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CRYPTOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(CRYPTOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(CRYPTOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNRW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNRW::DIS => true, - SDIOACNRW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNRW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNRW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNRW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIOACNW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIOACNWW { - #[doc = "Disallow"] - DIS, - #[doc = "Allow"] - ALLOW, - } - impl SDIOACNWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIOACNWW::DIS => true, - SDIOACNWW::ALLOW => false, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIOACNWW<'a> { - w: &'a mut W, - } - impl<'a> _SDIOACNWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIOACNWW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disallow"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SDIOACNWW::DIS) - } - #[doc = "Allow"] - #[inline] - pub fn allow(self) -> &'a mut W { - self.variant(SDIOACNWW::ALLOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM6"] - #[inline] - pub fn dma0acnr(&self) -> DMA0ACNRR { - DMA0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM6"] - #[inline] - pub fn dma0acnw(&self) -> DMA0ACNWR { - DMA0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM6"] - #[inline] - pub fn dma1acnr(&self) -> DMA1ACNRR { - DMA1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM6"] - #[inline] - pub fn dma1acnw(&self) -> DMA1ACNWR { - DMA1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM6"] - #[inline] - pub fn usbacnr(&self) -> USBACNRR { - USBACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM6"] - #[inline] - pub fn usbacnw(&self) -> USBACNWR { - USBACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM6"] - #[inline] - pub fn sys0acnr(&self) -> SYS0ACNRR { - SYS0ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM6"] - #[inline] - pub fn sys0acnw(&self) -> SYS0ACNWR { - SYS0ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM6"] - #[inline] - pub fn sys1acnr(&self) -> SYS1ACNRR { - SYS1ACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM6"] - #[inline] - pub fn sys1acnw(&self) -> SYS1ACNWR { - SYS1ACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM6"] - #[inline] - pub fn sdmadacnr(&self) -> SDMADACNRR { - SDMADACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM6"] - #[inline] - pub fn sdmadacnw(&self) -> SDMADACNWR { - SDMADACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM6"] - #[inline] - pub fn sdmaiacnr(&self) -> SDMAIACNRR { - SDMAIACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM6"] - #[inline] - pub fn sdmaiacnw(&self) -> SDMAIACNWR { - SDMAIACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM6"] - #[inline] - pub fn cryptoacnr(&self) -> CRYPTOACNRR { - CRYPTOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM6"] - #[inline] - pub fn cryptoacnw(&self) -> CRYPTOACNWR { - CRYPTOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM6"] - #[inline] - pub fn sdioacnr(&self) -> SDIOACNRR { - SDIOACNRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM6"] - #[inline] - pub fn sdioacnw(&self) -> SDIOACNWR { - SDIOACNWR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Allow/Disallow DMA0 Read access to the SRAM6"] - #[inline] - pub fn dma0acnr(&mut self) -> _DMA0ACNRW { - _DMA0ACNRW { w: self } - } - #[doc = "Bit 1 - Allow/Disallow DMA0 Write access to the SRAM6"] - #[inline] - pub fn dma0acnw(&mut self) -> _DMA0ACNWW { - _DMA0ACNWW { w: self } - } - #[doc = "Bit 2 - Allow/Disallow DMA1 Read access to the SRAM6"] - #[inline] - pub fn dma1acnr(&mut self) -> _DMA1ACNRW { - _DMA1ACNRW { w: self } - } - #[doc = "Bit 3 - Allow/Disallow DMA1 Write access to the SRAM6"] - #[inline] - pub fn dma1acnw(&mut self) -> _DMA1ACNWW { - _DMA1ACNWW { w: self } - } - #[doc = "Bit 4 - Allow/Disallow USB Read access to the SRAM6"] - #[inline] - pub fn usbacnr(&mut self) -> _USBACNRW { - _USBACNRW { w: self } - } - #[doc = "Bit 5 - Allow/Disallow USB Write access to the SRAM6"] - #[inline] - pub fn usbacnw(&mut self) -> _USBACNWW { - _USBACNWW { w: self } - } - #[doc = "Bit 6 - Allow/Disallow SYS0 Read access to the SRAM6"] - #[inline] - pub fn sys0acnr(&mut self) -> _SYS0ACNRW { - _SYS0ACNRW { w: self } - } - #[doc = "Bit 7 - Allow/Disallow SYS0 Write access to the SRAM6"] - #[inline] - pub fn sys0acnw(&mut self) -> _SYS0ACNWW { - _SYS0ACNWW { w: self } - } - #[doc = "Bit 8 - Allow/Disallow SYS1 Read access to the SRAM6"] - #[inline] - pub fn sys1acnr(&mut self) -> _SYS1ACNRW { - _SYS1ACNRW { w: self } - } - #[doc = "Bit 9 - Allow/Disallow SYS1 Write access to the SRAM6"] - #[inline] - pub fn sys1acnw(&mut self) -> _SYS1ACNWW { - _SYS1ACNWW { w: self } - } - #[doc = "Bit 10 - Allow/Disallow SDMA Data Read access to the SRAM6"] - #[inline] - pub fn sdmadacnr(&mut self) -> _SDMADACNRW { - _SDMADACNRW { w: self } - } - #[doc = "Bit 11 - Allow/Disallow SDMA Data Write access to the SRAM6"] - #[inline] - pub fn sdmadacnw(&mut self) -> _SDMADACNWW { - _SDMADACNWW { w: self } - } - #[doc = "Bit 12 - Allow/Disallow SDMA Instruction Read access to the SRAM6"] - #[inline] - pub fn sdmaiacnr(&mut self) -> _SDMAIACNRW { - _SDMAIACNRW { w: self } - } - #[doc = "Bit 13 - Allow/Disallow SDMA Instruction Write access to the SRAM6"] - #[inline] - pub fn sdmaiacnw(&mut self) -> _SDMAIACNWW { - _SDMAIACNWW { w: self } - } - #[doc = "Bit 14 - Allow/Disallow CRYPTO Read access to the SRAM6"] - #[inline] - pub fn cryptoacnr(&mut self) -> _CRYPTOACNRW { - _CRYPTOACNRW { w: self } - } - #[doc = "Bit 15 - Allow/Disallow CRYPTO Write access to the SRAM6"] - #[inline] - pub fn cryptoacnw(&mut self) -> _CRYPTOACNWW { - _CRYPTOACNWW { w: self } - } - #[doc = "Bit 16 - Allow/Disallow SDIO Read access to the SRAM6"] - #[inline] - pub fn sdioacnr(&mut self) -> _SDIOACNRW { - _SDIOACNRW { w: self } - } - #[doc = "Bit 17 - Allow/Disallow SDIO Write access to the SRAM6"] - #[inline] - pub fn sdioacnw(&mut self) -> _SDIOACNWW { - _SDIOACNWW { w: self } - } - } - } -} -#[doc = "SDHC/SDIO Controller"] -pub struct SDHC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SDHC {} -impl SDHC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const sdhc::RegisterBlock { - 0x4003_7000 as *const _ - } -} -impl Deref for SDHC { - type Target = sdhc::RegisterBlock; - fn deref(&self) -> &sdhc::RegisterBlock { - unsafe { &*SDHC::ptr() } - } -} -#[doc = "SDHC/SDIO Controller"] -pub mod sdhc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - SDMA System Address / Argument 2."] - pub sdma: SDMA, - #[doc = "0x04 - Block Size."] - pub blk_size: BLK_SIZE, - #[doc = "0x06 - Block Count."] - pub blk_cnt: BLK_CNT, - #[doc = "0x08 - Argument 1."] - pub arg_1: ARG_1, - #[doc = "0x0c - Transfer Mode."] - pub trans: TRANS, - #[doc = "0x0e - Command."] - pub cmd: CMD, - #[doc = "0x10 - Response 0 Register 0-15."] - pub resp: [RESP; 4], - #[doc = "0x20 - Buffer Data Port."] - pub buffer: BUFFER, - #[doc = "0x24 - Present State."] - pub present: PRESENT, - #[doc = "0x28 - Host Control 1."] - pub host_cn_1: HOST_CN_1, - #[doc = "0x29 - Power Control."] - pub pwr: PWR, - #[doc = "0x2a - Block Gap Control."] - pub blk_gap: BLK_GAP, - #[doc = "0x2b - Wakeup Control."] - pub wakeup: WAKEUP, - #[doc = "0x2c - Clock Control."] - pub clk_cn: CLK_CN, - #[doc = "0x2e - Timeout Control."] - pub to: TO, - #[doc = "0x2f - Software Reset."] - pub sw_reset: SW_RESET, - #[doc = "0x30 - Normal Interrupt Status."] - pub int_stat: INT_STAT, - #[doc = "0x32 - Error Interrupt Status."] - pub er_int_stat: ER_INT_STAT, - #[doc = "0x34 - Normal Interrupt Status Enable."] - pub int_en: INT_EN, - #[doc = "0x36 - Error Interrupt Status Enable."] - pub er_int_en: ER_INT_EN, - #[doc = "0x38 - Normal Interrupt Signal Enable."] - pub int_signal: INT_SIGNAL, - #[doc = "0x3a - Error Interrupt Signal Enable."] - pub er_int_signal: ER_INT_SIGNAL, - #[doc = "0x3c - Auto CMD Error Status."] - pub auto_cmd_er: AUTO_CMD_ER, - #[doc = "0x3e - Host Control 2."] - pub host_cn_2: HOST_CN_2, - #[doc = "0x40 - Capabilities 0-31."] - pub cfg_0: CFG_0, - #[doc = "0x44 - Capabilities 32-63."] - pub cfg_1: CFG_1, - #[doc = "0x48 - Maximum Current Capabilities."] - pub max_curr_cfg: MAX_CURR_CFG, - _reserved0: [u8; 4usize], - #[doc = "0x50 - Force Event for Auto CMD Error Status."] - pub force_cmd: FORCE_CMD, - #[doc = "0x52 - Force Event for Error Interrupt Status."] - pub force_event_int_stat: FORCE_EVENT_INT_STAT, - #[doc = "0x54 - ADMA Error Status."] - pub adma_er: ADMA_ER, - _reserved1: [u8; 3usize], - #[doc = "0x58 - ADMA System Address 0-31."] - pub adma_addr_0: ADMA_ADDR_0, - #[doc = "0x5c - ADMA System Address 32-63."] - pub adma_addr_1: ADMA_ADDR_1, - #[doc = "0x60 - Preset Value for Initialization."] - pub preset_0: PRESET_0, - #[doc = "0x62 - Preset Value for Default Speed."] - pub preset_1: PRESET_1, - #[doc = "0x64 - Preset Value for High Speed."] - pub preset_2: PRESET_2, - #[doc = "0x66 - Preset Value for SDR12."] - pub preset_3: PRESET_3, - #[doc = "0x68 - Preset Value for SDR25."] - pub preset_4: PRESET_4, - #[doc = "0x6a - Preset Value for SDR50."] - pub preset_5: PRESET_5, - #[doc = "0x6c - Preset Value for SDR104."] - pub preset_6: PRESET_6, - #[doc = "0x6e - Preset Value for DDR50."] - pub preset_7: PRESET_7, - _reserved2: [u8; 112usize], - #[doc = "0xe0 - Shared Bus Control."] - pub shared_bus: SHARED_BUS, - _reserved3: [u8; 24usize], - #[doc = "0xfc - Slot Interrupt Status."] - pub slot_int: SLOT_INT, - #[doc = "0xfe - Host Controller Version."] - pub host_cn_ver: HOST_CN_VER, - } - #[doc = "SDMA System Address / Argument 2."] - pub struct SDMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SDMA System Address / Argument 2."] - pub mod sdma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SDMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - SDMA System Address / Argument 2 of Auto CMD23."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - SDMA System Address / Argument 2 of Auto CMD23."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Block Size."] - pub struct BLK_SIZE { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Block Size."] - pub mod blk_size { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::BLK_SIZE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TRANSR { - bits: u16, - } - impl TRANSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct HOST_BUFFR { - bits: u8, - } - impl HOST_BUFFR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TRANSW<'a> { - w: &'a mut W, - } - impl<'a> _TRANSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HOST_BUFFW<'a> { - w: &'a mut W, - } - impl<'a> _HOST_BUFFW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:11 - Transfer Block Size."] - #[inline] - pub fn trans(&self) -> TRANSR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - TRANSR { bits } - } - #[doc = "Bits 12:14 - Host SDMA Buffer Boundary."] - #[inline] - pub fn host_buff(&self) -> HOST_BUFFR { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - HOST_BUFFR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:11 - Transfer Block Size."] - #[inline] - pub fn trans(&mut self) -> _TRANSW { - _TRANSW { w: self } - } - #[doc = "Bits 12:14 - Host SDMA Buffer Boundary."] - #[inline] - pub fn host_buff(&mut self) -> _HOST_BUFFW { - _HOST_BUFFW { w: self } - } - } - } - #[doc = "Block Count."] - pub struct BLK_CNT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Block Count."] - pub mod blk_cnt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::BLK_CNT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct COUNTR { - bits: u16, - } - impl COUNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _COUNTW<'a> { - w: &'a mut W, - } - impl<'a> _COUNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - Blocks Count For Current Transfer."] - #[inline] - pub fn count(&self) -> COUNTR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - COUNTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Blocks Count For Current Transfer."] - #[inline] - pub fn count(&mut self) -> _COUNTW { - _COUNTW { w: self } - } - } - } - #[doc = "Argument 1."] - pub struct ARG_1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Argument 1."] - pub mod arg_1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ARG_1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMDR { - bits: u32, - } - impl CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CMDW<'a> { - w: &'a mut W, - } - impl<'a> _CMDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Command Argument 1."] - #[inline] - pub fn cmd(&self) -> CMDR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - CMDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Command Argument 1."] - #[inline] - pub fn cmd(&mut self) -> _CMDW { - _CMDW { w: self } - } - } - } - #[doc = "Transfer Mode."] - pub struct TRANS { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Transfer Mode."] - pub mod trans { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::TRANS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA_ENR { - #[doc = "undocumented"] - DMA_TRANSFER, - #[doc = "undocumented"] - NON_DMA_TRANSFER, - } - impl DMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMA_ENR::DMA_TRANSFER => true, - DMA_ENR::NON_DMA_TRANSFER => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMA_ENR { - match value { - true => DMA_ENR::DMA_TRANSFER, - false => DMA_ENR::NON_DMA_TRANSFER, - } - } - #[doc = "Checks if the value of the field is `DMA_TRANSFER`"] - #[inline] - pub fn is_dma_transfer(&self) -> bool { - *self == DMA_ENR::DMA_TRANSFER - } - #[doc = "Checks if the value of the field is `NON_DMA_TRANSFER`"] - #[inline] - pub fn is_non_dma_transfer(&self) -> bool { - *self == DMA_ENR::NON_DMA_TRANSFER - } - } - #[doc = "Possible values of the field `BLK_CNT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BLK_CNT_ENR { - #[doc = "undocumented"] - ENABLE, - #[doc = "undocumented"] - DISABLE, - } - impl BLK_CNT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BLK_CNT_ENR::ENABLE => true, - BLK_CNT_ENR::DISABLE => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BLK_CNT_ENR { - match value { - true => BLK_CNT_ENR::ENABLE, - false => BLK_CNT_ENR::DISABLE, - } - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == BLK_CNT_ENR::ENABLE - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == BLK_CNT_ENR::DISABLE - } - } - #[doc = "Possible values of the field `AUTO_CMD_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AUTO_CMD_ENR { - #[doc = "undocumented"] - DISABLE, - #[doc = "undocumented"] - CMD12, - #[doc = "undocumented"] - CMD23, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl AUTO_CMD_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - AUTO_CMD_ENR::DISABLE => 0, - AUTO_CMD_ENR::CMD12 => 0x01, - AUTO_CMD_ENR::CMD23 => 0x02, - AUTO_CMD_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> AUTO_CMD_ENR { - match value { - 0 => AUTO_CMD_ENR::DISABLE, - 1 => AUTO_CMD_ENR::CMD12, - 2 => AUTO_CMD_ENR::CMD23, - i => AUTO_CMD_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == AUTO_CMD_ENR::DISABLE - } - #[doc = "Checks if the value of the field is `CMD12`"] - #[inline] - pub fn is_cmd12(&self) -> bool { - *self == AUTO_CMD_ENR::CMD12 - } - #[doc = "Checks if the value of the field is `CMD23`"] - #[inline] - pub fn is_cmd23(&self) -> bool { - *self == AUTO_CMD_ENR::CMD23 - } - } - #[doc = "Possible values of the field `READ_WRITE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum READ_WRITER { - #[doc = "undocumented"] - READ, - #[doc = "undocumented"] - WRITE, - } - impl READ_WRITER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - READ_WRITER::READ => true, - READ_WRITER::WRITE => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> READ_WRITER { - match value { - true => READ_WRITER::READ, - false => READ_WRITER::WRITE, - } - } - #[doc = "Checks if the value of the field is `READ`"] - #[inline] - pub fn is_read(&self) -> bool { - *self == READ_WRITER::READ - } - #[doc = "Checks if the value of the field is `WRITE`"] - #[inline] - pub fn is_write(&self) -> bool { - *self == READ_WRITER::WRITE - } - } - #[doc = "Possible values of the field `MULTI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MULTIR { - #[doc = "undocumented"] - ENABLE, - #[doc = "undocumented"] - DISABLE, - } - impl MULTIR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MULTIR::ENABLE => true, - MULTIR::DISABLE => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MULTIR { - match value { - true => MULTIR::ENABLE, - false => MULTIR::DISABLE, - } - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == MULTIR::ENABLE - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == MULTIR::DISABLE - } - } - #[doc = "Values that can be written to the field `DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMA_ENW { - #[doc = "`1`"] - DMA_TRANSFER, - #[doc = "`0`"] - NON_DMA_TRANSFER, - } - impl DMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMA_ENW::DMA_TRANSFER => true, - DMA_ENW::NON_DMA_TRANSFER => false, - } - } - } - #[doc = r" Proxy"] - pub struct _DMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _DMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`1`"] - #[inline] - pub fn dma_transfer(self) -> &'a mut W { - self.variant(DMA_ENW::DMA_TRANSFER) - } - #[doc = "`0`"] - #[inline] - pub fn non_dma_transfer(self) -> &'a mut W { - self.variant(DMA_ENW::NON_DMA_TRANSFER) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BLK_CNT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BLK_CNT_ENW { - #[doc = "`1`"] - ENABLE, - #[doc = "`0`"] - DISABLE, - } - impl BLK_CNT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BLK_CNT_ENW::ENABLE => true, - BLK_CNT_ENW::DISABLE => false, - } - } - } - #[doc = r" Proxy"] - pub struct _BLK_CNT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _BLK_CNT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BLK_CNT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`1`"] - #[inline] - pub fn enable(self) -> &'a mut W { - self.variant(BLK_CNT_ENW::ENABLE) - } - #[doc = "`0`"] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(BLK_CNT_ENW::DISABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `AUTO_CMD_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AUTO_CMD_ENW { - #[doc = "`0`"] - DISABLE, - #[doc = "`1`"] - CMD12, - #[doc = "`10`"] - CMD23, - } - impl AUTO_CMD_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - AUTO_CMD_ENW::DISABLE => 0, - AUTO_CMD_ENW::CMD12 => 1, - AUTO_CMD_ENW::CMD23 => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _AUTO_CMD_ENW<'a> { - w: &'a mut W, - } - impl<'a> _AUTO_CMD_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AUTO_CMD_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "`0`"] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(AUTO_CMD_ENW::DISABLE) - } - #[doc = "`1`"] - #[inline] - pub fn cmd12(self) -> &'a mut W { - self.variant(AUTO_CMD_ENW::CMD12) - } - #[doc = "`10`"] - #[inline] - pub fn cmd23(self) -> &'a mut W { - self.variant(AUTO_CMD_ENW::CMD23) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `READ_WRITE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum READ_WRITEW { - #[doc = "`1`"] - READ, - #[doc = "`0`"] - WRITE, - } - impl READ_WRITEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - READ_WRITEW::READ => true, - READ_WRITEW::WRITE => false, - } - } - } - #[doc = r" Proxy"] - pub struct _READ_WRITEW<'a> { - w: &'a mut W, - } - impl<'a> _READ_WRITEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: READ_WRITEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`1`"] - #[inline] - pub fn read(self) -> &'a mut W { - self.variant(READ_WRITEW::READ) - } - #[doc = "`0`"] - #[inline] - pub fn write(self) -> &'a mut W { - self.variant(READ_WRITEW::WRITE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MULTI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MULTIW { - #[doc = "`1`"] - ENABLE, - #[doc = "`0`"] - DISABLE, - } - impl MULTIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MULTIW::ENABLE => true, - MULTIW::DISABLE => false, - } - } - } - #[doc = r" Proxy"] - pub struct _MULTIW<'a> { - w: &'a mut W, - } - impl<'a> _MULTIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MULTIW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`1`"] - #[inline] - pub fn enable(self) -> &'a mut W { - self.variant(MULTIW::ENABLE) - } - #[doc = "`0`"] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(MULTIW::DISABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - DMA Enable."] - #[inline] - pub fn dma_en(&self) -> DMA_ENR { - DMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }) - } - #[doc = "Bit 1 - Block Count Enable."] - #[inline] - pub fn blk_cnt_en(&self) -> BLK_CNT_ENR { - BLK_CNT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }) - } - #[doc = "Bits 2:3 - Auto CMD Enable."] - #[inline] - pub fn auto_cmd_en(&self) -> AUTO_CMD_ENR { - AUTO_CMD_ENR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }) - } - #[doc = "Bit 4 - Data Transfer Direction Select."] - #[inline] - pub fn read_write(&self) -> READ_WRITER { - READ_WRITER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }) - } - #[doc = "Bit 5 - Multi / Single Block Select."] - #[inline] - pub fn multi(&self) -> MULTIR { - MULTIR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - DMA Enable."] - #[inline] - pub fn dma_en(&mut self) -> _DMA_ENW { - _DMA_ENW { w: self } - } - #[doc = "Bit 1 - Block Count Enable."] - #[inline] - pub fn blk_cnt_en(&mut self) -> _BLK_CNT_ENW { - _BLK_CNT_ENW { w: self } - } - #[doc = "Bits 2:3 - Auto CMD Enable."] - #[inline] - pub fn auto_cmd_en(&mut self) -> _AUTO_CMD_ENW { - _AUTO_CMD_ENW { w: self } - } - #[doc = "Bit 4 - Data Transfer Direction Select."] - #[inline] - pub fn read_write(&mut self) -> _READ_WRITEW { - _READ_WRITEW { w: self } - } - #[doc = "Bit 5 - Multi / Single Block Select."] - #[inline] - pub fn multi(&mut self) -> _MULTIW { - _MULTIW { w: self } - } - } - } - #[doc = "Command."] - pub struct CMD { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Command."] - pub mod cmd { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::CMD { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RESP_TYPER { - bits: u8, - } - impl RESP_TYPER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CRC_CHK_ENR { - bits: bool, - } - impl CRC_CHK_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct IDX_CHK_ENR { - bits: bool, - } - impl IDX_CHK_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_PRES_SELR { - bits: bool, - } - impl DATA_PRES_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TYPER { - bits: u8, - } - impl TYPER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct IDXR { - bits: u8, - } - impl IDXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RESP_TYPEW<'a> { - w: &'a mut W, - } - impl<'a> _RESP_TYPEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRC_CHK_ENW<'a> { - w: &'a mut W, - } - impl<'a> _CRC_CHK_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IDX_CHK_ENW<'a> { - w: &'a mut W, - } - impl<'a> _IDX_CHK_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_PRES_SELW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_PRES_SELW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TYPEW<'a> { - w: &'a mut W, - } - impl<'a> _TYPEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IDXW<'a> { - w: &'a mut W, - } - impl<'a> _IDXW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:1 - Response Type Select."] - #[inline] - pub fn resp_type(&self) -> RESP_TYPER { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - RESP_TYPER { bits } - } - #[doc = "Bit 3 - Command CRC Check Enable."] - #[inline] - pub fn crc_chk_en(&self) -> CRC_CHK_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CRC_CHK_ENR { bits } - } - #[doc = "Bit 4 - Command Index Check Enable."] - #[inline] - pub fn idx_chk_en(&self) -> IDX_CHK_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - IDX_CHK_ENR { bits } - } - #[doc = "Bit 5 - Data Present Select."] - #[inline] - pub fn data_pres_sel(&self) -> DATA_PRES_SELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_PRES_SELR { bits } - } - #[doc = "Bits 6:7 - Command Type."] - #[inline] - pub fn type_(&self) -> TYPER { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - TYPER { bits } - } - #[doc = "Bits 8:13 - Command Index."] - #[inline] - pub fn idx(&self) -> IDXR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - IDXR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - Response Type Select."] - #[inline] - pub fn resp_type(&mut self) -> _RESP_TYPEW { - _RESP_TYPEW { w: self } - } - #[doc = "Bit 3 - Command CRC Check Enable."] - #[inline] - pub fn crc_chk_en(&mut self) -> _CRC_CHK_ENW { - _CRC_CHK_ENW { w: self } - } - #[doc = "Bit 4 - Command Index Check Enable."] - #[inline] - pub fn idx_chk_en(&mut self) -> _IDX_CHK_ENW { - _IDX_CHK_ENW { w: self } - } - #[doc = "Bit 5 - Data Present Select."] - #[inline] - pub fn data_pres_sel(&mut self) -> _DATA_PRES_SELW { - _DATA_PRES_SELW { w: self } - } - #[doc = "Bits 6:7 - Command Type."] - #[inline] - pub fn type_(&mut self) -> _TYPEW { - _TYPEW { w: self } - } - #[doc = "Bits 8:13 - Command Index."] - #[inline] - pub fn idx(&mut self) -> _IDXW { - _IDXW { w: self } - } - } - } - #[doc = "Response 0 Register 0-15."] - pub struct RESP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Response 0 Register 0-15."] - pub mod resp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RESP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_RESPR { - bits: u32, - } - impl CMD_RESPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _CMD_RESPW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_RESPW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Command Response."] - #[inline] - pub fn cmd_resp(&self) -> CMD_RESPR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - CMD_RESPR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Command Response."] - #[inline] - pub fn cmd_resp(&mut self) -> _CMD_RESPW { - _CMD_RESPW { w: self } - } - } - } - #[doc = "Buffer Data Port."] - pub struct BUFFER { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buffer Data Port."] - pub mod buffer { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BUFFER { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Buffer Data."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Buffer Data."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Present State."] - pub struct PRESENT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Present State."] - pub mod present { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::PRESENT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct CMDR { - bits: bool, - } - impl CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATR { - bits: bool, - } - impl DATR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DAT_LINE_ACTIVER { - bits: bool, - } - impl DAT_LINE_ACTIVER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RETUNINGR { - bits: bool, - } - impl RETUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WRITE_TRANSFERR { - bits: bool, - } - impl WRITE_TRANSFERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct READ_TRANSFERR { - bits: bool, - } - impl READ_TRANSFERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_WRITER { - bits: bool, - } - impl BUFFER_WRITER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_READR { - bits: bool, - } - impl BUFFER_READR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INSERTEDR { - bits: bool, - } - impl CARD_INSERTEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_STATER { - bits: bool, - } - impl CARD_STATER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_DETECTR { - bits: bool, - } - impl CARD_DETECTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct WPR { - bits: bool, - } - impl WPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DAT_SIGNAL_LEVELR { - bits: u8, - } - impl DAT_SIGNAL_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CMD_SIGNAL_LEVELR { - bits: bool, - } - impl CMD_SIGNAL_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Command Inhibit (CMD)."] - #[inline] - pub fn cmd(&self) -> CMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CMDR { bits } - } - #[doc = "Bit 1 - Command Inhibit (DAT)."] - #[inline] - pub fn dat(&self) -> DATR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DATR { bits } - } - #[doc = "Bit 2 - DAT Line Active."] - #[inline] - pub fn dat_line_active(&self) -> DAT_LINE_ACTIVER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DAT_LINE_ACTIVER { bits } - } - #[doc = "Bit 3 - Re-Tuning Request."] - #[inline] - pub fn retuning(&self) -> RETUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RETUNINGR { bits } - } - #[doc = "Bit 8 - Write Transfer Active."] - #[inline] - pub fn write_transfer(&self) -> WRITE_TRANSFERR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WRITE_TRANSFERR { bits } - } - #[doc = "Bit 9 - Read Transfer Active."] - #[inline] - pub fn read_transfer(&self) -> READ_TRANSFERR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - READ_TRANSFERR { bits } - } - #[doc = "Bit 10 - Buffer Write Enable."] - #[inline] - pub fn buffer_write(&self) -> BUFFER_WRITER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BUFFER_WRITER { bits } - } - #[doc = "Bit 11 - Buffer Read Enable."] - #[inline] - pub fn buffer_read(&self) -> BUFFER_READR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BUFFER_READR { bits } - } - #[doc = "Bit 16 - Card Inserted."] - #[inline] - pub fn card_inserted(&self) -> CARD_INSERTEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CARD_INSERTEDR { bits } - } - #[doc = "Bit 17 - Card State Stable."] - #[inline] - pub fn card_state(&self) -> CARD_STATER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CARD_STATER { bits } - } - #[doc = "Bit 18 - Card Detect Pin Level."] - #[inline] - pub fn card_detect(&self) -> CARD_DETECTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CARD_DETECTR { bits } - } - #[doc = "Bit 19 - Write Protect Switch Pin Level."] - #[inline] - pub fn wp(&self) -> WPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - WPR { bits } - } - #[doc = "Bits 20:23 - DAT\\[3:0\\] Line Signal Level."] - #[inline] - pub fn dat_signal_level(&self) -> DAT_SIGNAL_LEVELR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DAT_SIGNAL_LEVELR { bits } - } - #[doc = "Bit 24 - CMD Line Signal Level."] - #[inline] - pub fn cmd_signal_level(&self) -> CMD_SIGNAL_LEVELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CMD_SIGNAL_LEVELR { bits } - } - } - } - #[doc = "Host Control 1."] - pub struct HOST_CN_1 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Host Control 1."] - pub mod host_cn_1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::HOST_CN_1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct LED_CNR { - bits: bool, - } - impl LED_CNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_TRANSFER_WIDTHR { - bits: bool, - } - impl DATA_TRANSFER_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HS_ENR { - bits: bool, - } - impl HS_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMA_SELECTR { - bits: u8, - } - impl DMA_SELECTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct EXT_DATA_TRANSFER_WIDTHR { - bits: bool, - } - impl EXT_DATA_TRANSFER_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_DETECT_TESTR { - bits: bool, - } - impl CARD_DETECT_TESTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_DETECT_SIGNALR { - bits: bool, - } - impl CARD_DETECT_SIGNALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _LED_CNW<'a> { - w: &'a mut W, - } - impl<'a> _LED_CNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_TRANSFER_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_TRANSFER_WIDTHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HS_ENW<'a> { - w: &'a mut W, - } - impl<'a> _HS_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMA_SELECTW<'a> { - w: &'a mut W, - } - impl<'a> _DMA_SELECTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EXT_DATA_TRANSFER_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _EXT_DATA_TRANSFER_WIDTHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_DETECT_TESTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_DETECT_TESTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_DETECT_SIGNALW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_DETECT_SIGNALW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - LED Control."] - #[inline] - pub fn led_cn(&self) -> LED_CNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - LED_CNR { bits } - } - #[doc = "Bit 1 - Data Transfer Width."] - #[inline] - pub fn data_transfer_width(&self) -> DATA_TRANSFER_WIDTHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DATA_TRANSFER_WIDTHR { bits } - } - #[doc = "Bit 2 - High Speed Enable."] - #[inline] - pub fn hs_en(&self) -> HS_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - HS_ENR { bits } - } - #[doc = "Bits 3:4 - DMA Select."] - #[inline] - pub fn dma_select(&self) -> DMA_SELECTR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - DMA_SELECTR { bits } - } - #[doc = "Bit 5 - Extended Data Transfer Width."] - #[inline] - pub fn ext_data_transfer_width(&self) -> EXT_DATA_TRANSFER_WIDTHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - EXT_DATA_TRANSFER_WIDTHR { bits } - } - #[doc = "Bit 6 - Card Detect Test Level."] - #[inline] - pub fn card_detect_test(&self) -> CARD_DETECT_TESTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CARD_DETECT_TESTR { bits } - } - #[doc = "Bit 7 - Card Detect Signal Selection."] - #[inline] - pub fn card_detect_signal(&self) -> CARD_DETECT_SIGNALR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CARD_DETECT_SIGNALR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - LED Control."] - #[inline] - pub fn led_cn(&mut self) -> _LED_CNW { - _LED_CNW { w: self } - } - #[doc = "Bit 1 - Data Transfer Width."] - #[inline] - pub fn data_transfer_width(&mut self) -> _DATA_TRANSFER_WIDTHW { - _DATA_TRANSFER_WIDTHW { w: self } - } - #[doc = "Bit 2 - High Speed Enable."] - #[inline] - pub fn hs_en(&mut self) -> _HS_ENW { - _HS_ENW { w: self } - } - #[doc = "Bits 3:4 - DMA Select."] - #[inline] - pub fn dma_select(&mut self) -> _DMA_SELECTW { - _DMA_SELECTW { w: self } - } - #[doc = "Bit 5 - Extended Data Transfer Width."] - #[inline] - pub fn ext_data_transfer_width(&mut self) -> _EXT_DATA_TRANSFER_WIDTHW { - _EXT_DATA_TRANSFER_WIDTHW { w: self } - } - #[doc = "Bit 6 - Card Detect Test Level."] - #[inline] - pub fn card_detect_test(&mut self) -> _CARD_DETECT_TESTW { - _CARD_DETECT_TESTW { w: self } - } - #[doc = "Bit 7 - Card Detect Signal Selection."] - #[inline] - pub fn card_detect_signal(&mut self) -> _CARD_DETECT_SIGNALW { - _CARD_DETECT_SIGNALW { w: self } - } - } - } - #[doc = "Power Control."] - pub struct PWR { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Power Control."] - pub mod pwr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::PWR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BUS_POWERR { - bits: bool, - } - impl BUS_POWERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUS_VOLT_SELR { - bits: u8, - } - impl BUS_VOLT_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BUS_POWERW<'a> { - w: &'a mut W, - } - impl<'a> _BUS_POWERW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUS_VOLT_SELW<'a> { - w: &'a mut W, - } - impl<'a> _BUS_VOLT_SELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - SD Bus Power."] - #[inline] - pub fn bus_power(&self) -> BUS_POWERR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - BUS_POWERR { bits } - } - #[doc = "Bits 1:3 - SD Bus Voltage Select."] - #[inline] - pub fn bus_volt_sel(&self) -> BUS_VOLT_SELR { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - BUS_VOLT_SELR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - SD Bus Power."] - #[inline] - pub fn bus_power(&mut self) -> _BUS_POWERW { - _BUS_POWERW { w: self } - } - #[doc = "Bits 1:3 - SD Bus Voltage Select."] - #[inline] - pub fn bus_volt_sel(&mut self) -> _BUS_VOLT_SELW { - _BUS_VOLT_SELW { w: self } - } - } - } - #[doc = "Block Gap Control."] - pub struct BLK_GAP { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Block Gap Control."] - pub mod blk_gap { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::BLK_GAP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct STOPR { - bits: bool, - } - impl STOPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CONTR { - bits: bool, - } - impl CONTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct READ_WAITR { - bits: bool, - } - impl READ_WAITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INTRR { - bits: bool, - } - impl INTRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _STOPW<'a> { - w: &'a mut W, - } - impl<'a> _STOPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CONTW<'a> { - w: &'a mut W, - } - impl<'a> _CONTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _READ_WAITW<'a> { - w: &'a mut W, - } - impl<'a> _READ_WAITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTRW<'a> { - w: &'a mut W, - } - impl<'a> _INTRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - Stop At Block Gap Request."] - #[inline] - pub fn stop(&self) -> STOPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - STOPR { bits } - } - #[doc = "Bit 1 - Continue Request."] - #[inline] - pub fn cont(&self) -> CONTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CONTR { bits } - } - #[doc = "Bit 2 - Read Wait Control."] - #[inline] - pub fn read_wait(&self) -> READ_WAITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - READ_WAITR { bits } - } - #[doc = "Bit 3 - Interrupt At Block Gap."] - #[inline] - pub fn intr(&self) -> INTRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - INTRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Stop At Block Gap Request."] - #[inline] - pub fn stop(&mut self) -> _STOPW { - _STOPW { w: self } - } - #[doc = "Bit 1 - Continue Request."] - #[inline] - pub fn cont(&mut self) -> _CONTW { - _CONTW { w: self } - } - #[doc = "Bit 2 - Read Wait Control."] - #[inline] - pub fn read_wait(&mut self) -> _READ_WAITW { - _READ_WAITW { w: self } - } - #[doc = "Bit 3 - Interrupt At Block Gap."] - #[inline] - pub fn intr(&mut self) -> _INTRW { - _INTRW { w: self } - } - } - } - #[doc = "Wakeup Control."] - pub struct WAKEUP { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Wakeup Control."] - pub mod wakeup { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::WAKEUP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CARD_INTR { - bits: bool, - } - impl CARD_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INSR { - bits: bool, - } - impl CARD_INSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_REMR { - bits: bool, - } - impl CARD_REMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CARD_INTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INSW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_REMW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_REMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - Wakeup Event Enable On Card Interrupt."] - #[inline] - pub fn card_int(&self) -> CARD_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CARD_INTR { bits } - } - #[doc = "Bit 1 - Wakeup Event Enable On SD Card Insertion."] - #[inline] - pub fn card_ins(&self) -> CARD_INSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CARD_INSR { bits } - } - #[doc = "Bit 2 - Wakeup Event Enable On SD Card Removal."] - #[inline] - pub fn card_rem(&self) -> CARD_REMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CARD_REMR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wakeup Event Enable On Card Interrupt."] - #[inline] - pub fn card_int(&mut self) -> _CARD_INTW { - _CARD_INTW { w: self } - } - #[doc = "Bit 1 - Wakeup Event Enable On SD Card Insertion."] - #[inline] - pub fn card_ins(&mut self) -> _CARD_INSW { - _CARD_INSW { w: self } - } - #[doc = "Bit 2 - Wakeup Event Enable On SD Card Removal."] - #[inline] - pub fn card_rem(&mut self) -> _CARD_REMW { - _CARD_REMW { w: self } - } - } - } - #[doc = "Clock Control."] - pub struct CLK_CN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Clock Control."] - pub mod clk_cn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::CLK_CN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INTERNAL_CLK_ENR { - bits: bool, - } - impl INTERNAL_CLK_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INTERNAL_CLK_STABLER { - bits: bool, - } - impl INTERNAL_CLK_STABLER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SD_CLK_ENR { - bits: bool, - } - impl SD_CLK_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CLK_GEN_SELR { - bits: bool, - } - impl CLK_GEN_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UPPER_SDCLK_FREQ_SELR { - bits: u8, - } - impl UPPER_SDCLK_FREQ_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQ_SELR { - bits: u8, - } - impl SDCLK_FREQ_SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INTERNAL_CLK_ENW<'a> { - w: &'a mut W, - } - impl<'a> _INTERNAL_CLK_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SD_CLK_ENW<'a> { - w: &'a mut W, - } - impl<'a> _SD_CLK_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UPPER_SDCLK_FREQ_SELW<'a> { - w: &'a mut W, - } - impl<'a> _UPPER_SDCLK_FREQ_SELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SDCLK_FREQ_SELW<'a> { - w: &'a mut W, - } - impl<'a> _SDCLK_FREQ_SELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Internal Clock Enable."] - #[inline] - pub fn internal_clk_en(&self) -> INTERNAL_CLK_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - INTERNAL_CLK_ENR { bits } - } - #[doc = "Bit 1 - Internal Clock Stable."] - #[inline] - pub fn internal_clk_stable(&self) -> INTERNAL_CLK_STABLER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - INTERNAL_CLK_STABLER { bits } - } - #[doc = "Bit 2 - SD Clock Enable."] - #[inline] - pub fn sd_clk_en(&self) -> SD_CLK_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - SD_CLK_ENR { bits } - } - #[doc = "Bit 5 - Clock Generator Select."] - #[inline] - pub fn clk_gen_sel(&self) -> CLK_GEN_SELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GEN_SELR { bits } - } - #[doc = "Bits 6:7 - Upper Bits of SDCLK Frequency Select."] - #[inline] - pub fn upper_sdclk_freq_sel(&self) -> UPPER_SDCLK_FREQ_SELR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - UPPER_SDCLK_FREQ_SELR { bits } - } - #[doc = "Bits 8:15 - SDCLK Frequency Select."] - #[inline] - pub fn sdclk_freq_sel(&self) -> SDCLK_FREQ_SELR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - SDCLK_FREQ_SELR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Internal Clock Enable."] - #[inline] - pub fn internal_clk_en(&mut self) -> _INTERNAL_CLK_ENW { - _INTERNAL_CLK_ENW { w: self } - } - #[doc = "Bit 2 - SD Clock Enable."] - #[inline] - pub fn sd_clk_en(&mut self) -> _SD_CLK_ENW { - _SD_CLK_ENW { w: self } - } - #[doc = "Bits 6:7 - Upper Bits of SDCLK Frequency Select."] - #[inline] - pub fn upper_sdclk_freq_sel(&mut self) -> _UPPER_SDCLK_FREQ_SELW { - _UPPER_SDCLK_FREQ_SELW { w: self } - } - #[doc = "Bits 8:15 - SDCLK Frequency Select."] - #[inline] - pub fn sdclk_freq_sel(&mut self) -> _SDCLK_FREQ_SELW { - _SDCLK_FREQ_SELW { w: self } - } - } - } - #[doc = "Timeout Control."] - pub struct TO { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Timeout Control."] - pub mod to { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::TO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATA_COUNT_VALUER { - bits: u8, - } - impl DATA_COUNT_VALUER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATA_COUNT_VALUEW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_COUNT_VALUEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:2 - Data Timeout Counter Value."] - #[inline] - pub fn data_count_value(&self) -> DATA_COUNT_VALUER { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - DATA_COUNT_VALUER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - Data Timeout Counter Value."] - #[inline] - pub fn data_count_value(&mut self) -> _DATA_COUNT_VALUEW { - _DATA_COUNT_VALUEW { w: self } - } - } - } - #[doc = "Software Reset."] - pub struct SW_RESET { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Software Reset."] - pub mod sw_reset { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::SW_RESET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RESET_ALLR { - bits: bool, - } - impl RESET_ALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESET_CMDR { - bits: bool, - } - impl RESET_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESET_DATR { - bits: bool, - } - impl RESET_DATR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _RESET_ALLW<'a> { - w: &'a mut W, - } - impl<'a> _RESET_ALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESET_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _RESET_CMDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESET_DATW<'a> { - w: &'a mut W, - } - impl<'a> _RESET_DATW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - Software Reset For All."] - #[inline] - pub fn reset_all(&self) -> RESET_ALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESET_ALLR { bits } - } - #[doc = "Bit 1 - Software Reset For CMD Line."] - #[inline] - pub fn reset_cmd(&self) -> RESET_CMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESET_CMDR { bits } - } - #[doc = "Bit 2 - Software Reset For DAT Line."] - #[inline] - pub fn reset_dat(&self) -> RESET_DATR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESET_DATR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Software Reset For All."] - #[inline] - pub fn reset_all(&mut self) -> _RESET_ALLW { - _RESET_ALLW { w: self } - } - #[doc = "Bit 1 - Software Reset For CMD Line."] - #[inline] - pub fn reset_cmd(&mut self) -> _RESET_CMDW { - _RESET_CMDW { w: self } - } - #[doc = "Bit 2 - Software Reset For DAT Line."] - #[inline] - pub fn reset_dat(&mut self) -> _RESET_DATW { - _RESET_DATW { w: self } - } - } - } - #[doc = "Normal Interrupt Status."] - pub struct INT_STAT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Normal Interrupt Status."] - pub mod int_stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INT_STAT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_COMPR { - bits: bool, - } - impl CMD_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TRANS_COMPR { - bits: bool, - } - impl TRANS_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BLK_GAP_EVENTR { - bits: bool, - } - impl BLK_GAP_EVENTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAR { - bits: bool, - } - impl DMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFF_WR_READYR { - bits: bool, - } - impl BUFF_WR_READYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFF_RD_READYR { - bits: bool, - } - impl BUFF_RD_READYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INSERTIONR { - bits: bool, - } - impl CARD_INSERTIONR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_REMOVALR { - bits: bool, - } - impl CARD_REMOVALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INTRR { - bits: bool, - } - impl CARD_INTRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RETUNINGR { - bits: bool, - } - impl RETUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ERR_INTRR { - bits: bool, - } - impl ERR_INTRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TRANS_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _TRANS_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BLK_GAP_EVENTW<'a> { - w: &'a mut W, - } - impl<'a> _BLK_GAP_EVENTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAW<'a> { - w: &'a mut W, - } - impl<'a> _DMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFF_WR_READYW<'a> { - w: &'a mut W, - } - impl<'a> _BUFF_WR_READYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFF_RD_READYW<'a> { - w: &'a mut W, - } - impl<'a> _BUFF_RD_READYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INSERTIONW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INSERTIONW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_REMOVALW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_REMOVALW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INTRW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INTRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RETUNINGW<'a> { - w: &'a mut W, - } - impl<'a> _RETUNINGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ERR_INTRW<'a> { - w: &'a mut W, - } - impl<'a> _ERR_INTRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Complete."] - #[inline] - pub fn cmd_comp(&self) -> CMD_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_COMPR { bits } - } - #[doc = "Bit 1 - Transfer Complete."] - #[inline] - pub fn trans_comp(&self) -> TRANS_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TRANS_COMPR { bits } - } - #[doc = "Bit 2 - Block Gap Event."] - #[inline] - pub fn blk_gap_event(&self) -> BLK_GAP_EVENTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BLK_GAP_EVENTR { bits } - } - #[doc = "Bit 3 - DMA Interrupt."] - #[inline] - pub fn dma(&self) -> DMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DMAR { bits } - } - #[doc = "Bit 4 - Buffer Write Ready."] - #[inline] - pub fn buff_wr_ready(&self) -> BUFF_WR_READYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFF_WR_READYR { bits } - } - #[doc = "Bit 5 - Buffer Read Ready."] - #[inline] - pub fn buff_rd_ready(&self) -> BUFF_RD_READYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFF_RD_READYR { bits } - } - #[doc = "Bit 6 - Card Insertion."] - #[inline] - pub fn card_insertion(&self) -> CARD_INSERTIONR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INSERTIONR { bits } - } - #[doc = "Bit 7 - Card Removal."] - #[inline] - pub fn card_removal(&self) -> CARD_REMOVALR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_REMOVALR { bits } - } - #[doc = "Bit 8 - Card Interrupt."] - #[inline] - pub fn card_intr(&self) -> CARD_INTRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INTRR { bits } - } - #[doc = "Bit 12 - Re-Tuning Event."] - #[inline] - pub fn retuning(&self) -> RETUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - RETUNINGR { bits } - } - #[doc = "Bit 15 - Error Interrupt."] - #[inline] - pub fn err_intr(&self) -> ERR_INTRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ERR_INTRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Complete."] - #[inline] - pub fn cmd_comp(&mut self) -> _CMD_COMPW { - _CMD_COMPW { w: self } - } - #[doc = "Bit 1 - Transfer Complete."] - #[inline] - pub fn trans_comp(&mut self) -> _TRANS_COMPW { - _TRANS_COMPW { w: self } - } - #[doc = "Bit 2 - Block Gap Event."] - #[inline] - pub fn blk_gap_event(&mut self) -> _BLK_GAP_EVENTW { - _BLK_GAP_EVENTW { w: self } - } - #[doc = "Bit 3 - DMA Interrupt."] - #[inline] - pub fn dma(&mut self) -> _DMAW { - _DMAW { w: self } - } - #[doc = "Bit 4 - Buffer Write Ready."] - #[inline] - pub fn buff_wr_ready(&mut self) -> _BUFF_WR_READYW { - _BUFF_WR_READYW { w: self } - } - #[doc = "Bit 5 - Buffer Read Ready."] - #[inline] - pub fn buff_rd_ready(&mut self) -> _BUFF_RD_READYW { - _BUFF_RD_READYW { w: self } - } - #[doc = "Bit 6 - Card Insertion."] - #[inline] - pub fn card_insertion(&mut self) -> _CARD_INSERTIONW { - _CARD_INSERTIONW { w: self } - } - #[doc = "Bit 7 - Card Removal."] - #[inline] - pub fn card_removal(&mut self) -> _CARD_REMOVALW { - _CARD_REMOVALW { w: self } - } - #[doc = "Bit 8 - Card Interrupt."] - #[inline] - pub fn card_intr(&mut self) -> _CARD_INTRW { - _CARD_INTRW { w: self } - } - #[doc = "Bit 12 - Re-Tuning Event."] - #[inline] - pub fn retuning(&mut self) -> _RETUNINGW { - _RETUNINGW { w: self } - } - #[doc = "Bit 15 - Error Interrupt."] - #[inline] - pub fn err_intr(&mut self) -> _ERR_INTRW { - _ERR_INTRW { w: self } - } - } - } - #[doc = "Error Interrupt Status."] - pub struct ER_INT_STAT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Error Interrupt Status."] - pub mod er_int_stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::ER_INT_STAT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_TOR { - bits: bool, - } - impl CMD_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_CRCR { - bits: bool, - } - impl CMD_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_END_BITR { - bits: bool, - } - impl CMD_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_IDXR { - bits: bool, - } - impl CMD_IDXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_TOR { - bits: bool, - } - impl DATA_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_CRCR { - bits: bool, - } - impl DATA_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_END_BITR { - bits: bool, - } - impl DATA_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CURRENT_LIMITR { - bits: bool, - } - impl CURRENT_LIMITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUTO_CMD_12R { - bits: bool, - } - impl AUTO_CMD_12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADMAR { - bits: bool, - } - impl ADMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAR { - bits: bool, - } - impl DMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_TOW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_IDXW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_IDXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_TOW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CURRENT_LIMITW<'a> { - w: &'a mut W, - } - impl<'a> _CURRENT_LIMITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AUTO_CMD_12W<'a> { - w: &'a mut W, - } - impl<'a> _AUTO_CMD_12W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADMAW<'a> { - w: &'a mut W, - } - impl<'a> _ADMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAW<'a> { - w: &'a mut W, - } - impl<'a> _DMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Timeout Error."] - #[inline] - pub fn cmd_to(&self) -> CMD_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_TOR { bits } - } - #[doc = "Bit 1 - Command CRC Error."] - #[inline] - pub fn cmd_crc(&self) -> CMD_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_CRCR { bits } - } - #[doc = "Bit 2 - Command End Bit Error."] - #[inline] - pub fn cmd_end_bit(&self) -> CMD_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_END_BITR { bits } - } - #[doc = "Bit 3 - Command Index Error."] - #[inline] - pub fn cmd_idx(&self) -> CMD_IDXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_IDXR { bits } - } - #[doc = "Bit 4 - Data Timeout Error."] - #[inline] - pub fn data_to(&self) -> DATA_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_TOR { bits } - } - #[doc = "Bit 5 - Data CRC Error."] - #[inline] - pub fn data_crc(&self) -> DATA_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_CRCR { bits } - } - #[doc = "Bit 6 - Data End Bit Error."] - #[inline] - pub fn data_end_bit(&self) -> DATA_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_END_BITR { bits } - } - #[doc = "Bit 7 - Current Limit Error."] - #[inline] - pub fn current_limit(&self) -> CURRENT_LIMITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CURRENT_LIMITR { bits } - } - #[doc = "Bit 8 - Auto CMD Error."] - #[inline] - pub fn auto_cmd_12(&self) -> AUTO_CMD_12R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - AUTO_CMD_12R { bits } - } - #[doc = "Bit 9 - ADMA Error."] - #[inline] - pub fn adma(&self) -> ADMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ADMAR { bits } - } - #[doc = "Bit 12 - DMA Error."] - #[inline] - pub fn dma(&self) -> DMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DMAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Timeout Error."] - #[inline] - pub fn cmd_to(&mut self) -> _CMD_TOW { - _CMD_TOW { w: self } - } - #[doc = "Bit 1 - Command CRC Error."] - #[inline] - pub fn cmd_crc(&mut self) -> _CMD_CRCW { - _CMD_CRCW { w: self } - } - #[doc = "Bit 2 - Command End Bit Error."] - #[inline] - pub fn cmd_end_bit(&mut self) -> _CMD_END_BITW { - _CMD_END_BITW { w: self } - } - #[doc = "Bit 3 - Command Index Error."] - #[inline] - pub fn cmd_idx(&mut self) -> _CMD_IDXW { - _CMD_IDXW { w: self } - } - #[doc = "Bit 4 - Data Timeout Error."] - #[inline] - pub fn data_to(&mut self) -> _DATA_TOW { - _DATA_TOW { w: self } - } - #[doc = "Bit 5 - Data CRC Error."] - #[inline] - pub fn data_crc(&mut self) -> _DATA_CRCW { - _DATA_CRCW { w: self } - } - #[doc = "Bit 6 - Data End Bit Error."] - #[inline] - pub fn data_end_bit(&mut self) -> _DATA_END_BITW { - _DATA_END_BITW { w: self } - } - #[doc = "Bit 7 - Current Limit Error."] - #[inline] - pub fn current_limit(&mut self) -> _CURRENT_LIMITW { - _CURRENT_LIMITW { w: self } - } - #[doc = "Bit 8 - Auto CMD Error."] - #[inline] - pub fn auto_cmd_12(&mut self) -> _AUTO_CMD_12W { - _AUTO_CMD_12W { w: self } - } - #[doc = "Bit 9 - ADMA Error."] - #[inline] - pub fn adma(&mut self) -> _ADMAW { - _ADMAW { w: self } - } - #[doc = "Bit 12 - DMA Error."] - #[inline] - pub fn dma(&mut self) -> _DMAW { - _DMAW { w: self } - } - } - } - #[doc = "Normal Interrupt Status Enable."] - pub struct INT_EN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Normal Interrupt Status Enable."] - pub mod int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_COMPR { - bits: bool, - } - impl CMD_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TRANS_COMPR { - bits: bool, - } - impl TRANS_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BLK_GAPR { - bits: bool, - } - impl BLK_GAPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAR { - bits: bool, - } - impl DMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_WRR { - bits: bool, - } - impl BUFFER_WRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_RDR { - bits: bool, - } - impl BUFFER_RDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INSERTR { - bits: bool, - } - impl CARD_INSERTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_REMOVALR { - bits: bool, - } - impl CARD_REMOVALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INTR { - bits: bool, - } - impl CARD_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RETUNINGR { - bits: bool, - } - impl RETUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TRANS_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _TRANS_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BLK_GAPW<'a> { - w: &'a mut W, - } - impl<'a> _BLK_GAPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAW<'a> { - w: &'a mut W, - } - impl<'a> _DMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFFER_WRW<'a> { - w: &'a mut W, - } - impl<'a> _BUFFER_WRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFFER_RDW<'a> { - w: &'a mut W, - } - impl<'a> _BUFFER_RDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INSERTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INSERTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_REMOVALW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_REMOVALW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RETUNINGW<'a> { - w: &'a mut W, - } - impl<'a> _RETUNINGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Complete Status Enable."] - #[inline] - pub fn cmd_comp(&self) -> CMD_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_COMPR { bits } - } - #[doc = "Bit 1 - Transfer Complete Status Enable."] - #[inline] - pub fn trans_comp(&self) -> TRANS_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TRANS_COMPR { bits } - } - #[doc = "Bit 2 - Block Gap Event Status Enable."] - #[inline] - pub fn blk_gap(&self) -> BLK_GAPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BLK_GAPR { bits } - } - #[doc = "Bit 3 - DMA Interrupt Status Enable."] - #[inline] - pub fn dma(&self) -> DMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DMAR { bits } - } - #[doc = "Bit 4 - Buffer Write Ready Status Enable."] - #[inline] - pub fn buffer_wr(&self) -> BUFFER_WRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFFER_WRR { bits } - } - #[doc = "Bit 5 - Buffer Read Ready Status Enable."] - #[inline] - pub fn buffer_rd(&self) -> BUFFER_RDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFFER_RDR { bits } - } - #[doc = "Bit 6 - Card Insertion Status Enable."] - #[inline] - pub fn card_insert(&self) -> CARD_INSERTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INSERTR { bits } - } - #[doc = "Bit 7 - Card Removal Status Enable."] - #[inline] - pub fn card_removal(&self) -> CARD_REMOVALR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_REMOVALR { bits } - } - #[doc = "Bit 8 - Card Interrupt Status Enable."] - #[inline] - pub fn card_int(&self) -> CARD_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INTR { bits } - } - #[doc = "Bit 12 - Re-Tuning Event Status Enable."] - #[inline] - pub fn retuning(&self) -> RETUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - RETUNINGR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Complete Status Enable."] - #[inline] - pub fn cmd_comp(&mut self) -> _CMD_COMPW { - _CMD_COMPW { w: self } - } - #[doc = "Bit 1 - Transfer Complete Status Enable."] - #[inline] - pub fn trans_comp(&mut self) -> _TRANS_COMPW { - _TRANS_COMPW { w: self } - } - #[doc = "Bit 2 - Block Gap Event Status Enable."] - #[inline] - pub fn blk_gap(&mut self) -> _BLK_GAPW { - _BLK_GAPW { w: self } - } - #[doc = "Bit 3 - DMA Interrupt Status Enable."] - #[inline] - pub fn dma(&mut self) -> _DMAW { - _DMAW { w: self } - } - #[doc = "Bit 4 - Buffer Write Ready Status Enable."] - #[inline] - pub fn buffer_wr(&mut self) -> _BUFFER_WRW { - _BUFFER_WRW { w: self } - } - #[doc = "Bit 5 - Buffer Read Ready Status Enable."] - #[inline] - pub fn buffer_rd(&mut self) -> _BUFFER_RDW { - _BUFFER_RDW { w: self } - } - #[doc = "Bit 6 - Card Insertion Status Enable."] - #[inline] - pub fn card_insert(&mut self) -> _CARD_INSERTW { - _CARD_INSERTW { w: self } - } - #[doc = "Bit 7 - Card Removal Status Enable."] - #[inline] - pub fn card_removal(&mut self) -> _CARD_REMOVALW { - _CARD_REMOVALW { w: self } - } - #[doc = "Bit 8 - Card Interrupt Status Enable."] - #[inline] - pub fn card_int(&mut self) -> _CARD_INTW { - _CARD_INTW { w: self } - } - #[doc = "Bit 12 - Re-Tuning Event Status Enable."] - #[inline] - pub fn retuning(&mut self) -> _RETUNINGW { - _RETUNINGW { w: self } - } - } - } - #[doc = "Error Interrupt Status Enable."] - pub struct ER_INT_EN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Error Interrupt Status Enable."] - pub mod er_int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::ER_INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_TOR { - bits: bool, - } - impl CMD_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_CRCR { - bits: bool, - } - impl CMD_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_END_BITR { - bits: bool, - } - impl CMD_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_IDXR { - bits: bool, - } - impl CMD_IDXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_TOR { - bits: bool, - } - impl DATA_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_CRCR { - bits: bool, - } - impl DATA_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_END_BITR { - bits: bool, - } - impl DATA_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUTO_CMDR { - bits: bool, - } - impl AUTO_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADMAR { - bits: bool, - } - impl ADMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TUNINGR { - bits: bool, - } - impl TUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct VENDORR { - bits: bool, - } - impl VENDORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_TOW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_IDXW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_IDXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_TOW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AUTO_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _AUTO_CMDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADMAW<'a> { - w: &'a mut W, - } - impl<'a> _ADMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TUNINGW<'a> { - w: &'a mut W, - } - impl<'a> _TUNINGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VENDORW<'a> { - w: &'a mut W, - } - impl<'a> _VENDORW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Timeout Error Status Enable."] - #[inline] - pub fn cmd_to(&self) -> CMD_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_TOR { bits } - } - #[doc = "Bit 1 - Command CRC Error Status Enable."] - #[inline] - pub fn cmd_crc(&self) -> CMD_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_CRCR { bits } - } - #[doc = "Bit 2 - Command End Bit Error Status Enable."] - #[inline] - pub fn cmd_end_bit(&self) -> CMD_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_END_BITR { bits } - } - #[doc = "Bit 3 - Command Index Error Status Enable."] - #[inline] - pub fn cmd_idx(&self) -> CMD_IDXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_IDXR { bits } - } - #[doc = "Bit 4 - Data Timeout Error Status Enable."] - #[inline] - pub fn data_to(&self) -> DATA_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_TOR { bits } - } - #[doc = "Bit 5 - Data CRC Error Status Enable."] - #[inline] - pub fn data_crc(&self) -> DATA_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_CRCR { bits } - } - #[doc = "Bit 6 - Data End Bit Error Status Enable."] - #[inline] - pub fn data_end_bit(&self) -> DATA_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_END_BITR { bits } - } - #[doc = "Bit 8 - Auto CMD Error Status Enable."] - #[inline] - pub fn auto_cmd(&self) -> AUTO_CMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - AUTO_CMDR { bits } - } - #[doc = "Bit 9 - ADMA Error Status Enable."] - #[inline] - pub fn adma(&self) -> ADMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ADMAR { bits } - } - #[doc = "Bit 10 - Tuning Error Status Enable."] - #[inline] - pub fn tuning(&self) -> TUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TUNINGR { bits } - } - #[doc = "Bit 12 - Vendor Specific Error Status Enable."] - #[inline] - pub fn vendor(&self) -> VENDORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - VENDORR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Timeout Error Status Enable."] - #[inline] - pub fn cmd_to(&mut self) -> _CMD_TOW { - _CMD_TOW { w: self } - } - #[doc = "Bit 1 - Command CRC Error Status Enable."] - #[inline] - pub fn cmd_crc(&mut self) -> _CMD_CRCW { - _CMD_CRCW { w: self } - } - #[doc = "Bit 2 - Command End Bit Error Status Enable."] - #[inline] - pub fn cmd_end_bit(&mut self) -> _CMD_END_BITW { - _CMD_END_BITW { w: self } - } - #[doc = "Bit 3 - Command Index Error Status Enable."] - #[inline] - pub fn cmd_idx(&mut self) -> _CMD_IDXW { - _CMD_IDXW { w: self } - } - #[doc = "Bit 4 - Data Timeout Error Status Enable."] - #[inline] - pub fn data_to(&mut self) -> _DATA_TOW { - _DATA_TOW { w: self } - } - #[doc = "Bit 5 - Data CRC Error Status Enable."] - #[inline] - pub fn data_crc(&mut self) -> _DATA_CRCW { - _DATA_CRCW { w: self } - } - #[doc = "Bit 6 - Data End Bit Error Status Enable."] - #[inline] - pub fn data_end_bit(&mut self) -> _DATA_END_BITW { - _DATA_END_BITW { w: self } - } - #[doc = "Bit 8 - Auto CMD Error Status Enable."] - #[inline] - pub fn auto_cmd(&mut self) -> _AUTO_CMDW { - _AUTO_CMDW { w: self } - } - #[doc = "Bit 9 - ADMA Error Status Enable."] - #[inline] - pub fn adma(&mut self) -> _ADMAW { - _ADMAW { w: self } - } - #[doc = "Bit 10 - Tuning Error Status Enable."] - #[inline] - pub fn tuning(&mut self) -> _TUNINGW { - _TUNINGW { w: self } - } - #[doc = "Bit 12 - Vendor Specific Error Status Enable."] - #[inline] - pub fn vendor(&mut self) -> _VENDORW { - _VENDORW { w: self } - } - } - } - #[doc = "Normal Interrupt Signal Enable."] - pub struct INT_SIGNAL { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Normal Interrupt Signal Enable."] - pub mod int_signal { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INT_SIGNAL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_COMPR { - bits: bool, - } - impl CMD_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TRANS_COMPR { - bits: bool, - } - impl TRANS_COMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BLK_GAPR { - bits: bool, - } - impl BLK_GAPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAR { - bits: bool, - } - impl DMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_WRR { - bits: bool, - } - impl BUFFER_WRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUFFER_RDR { - bits: bool, - } - impl BUFFER_RDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INSERTR { - bits: bool, - } - impl CARD_INSERTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_REMOVALR { - bits: bool, - } - impl CARD_REMOVALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CARD_INTR { - bits: bool, - } - impl CARD_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RETUNINGR { - bits: bool, - } - impl RETUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TRANS_COMPW<'a> { - w: &'a mut W, - } - impl<'a> _TRANS_COMPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BLK_GAPW<'a> { - w: &'a mut W, - } - impl<'a> _BLK_GAPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAW<'a> { - w: &'a mut W, - } - impl<'a> _DMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFFER_WRW<'a> { - w: &'a mut W, - } - impl<'a> _BUFFER_WRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BUFFER_RDW<'a> { - w: &'a mut W, - } - impl<'a> _BUFFER_RDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INSERTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INSERTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_REMOVALW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_REMOVALW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CARD_INTW<'a> { - w: &'a mut W, - } - impl<'a> _CARD_INTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RETUNINGW<'a> { - w: &'a mut W, - } - impl<'a> _RETUNINGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Complete Signal Enable."] - #[inline] - pub fn cmd_comp(&self) -> CMD_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_COMPR { bits } - } - #[doc = "Bit 1 - Transfer Complete Signal Enable."] - #[inline] - pub fn trans_comp(&self) -> TRANS_COMPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TRANS_COMPR { bits } - } - #[doc = "Bit 2 - Block Gap Event Signal Enable."] - #[inline] - pub fn blk_gap(&self) -> BLK_GAPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BLK_GAPR { bits } - } - #[doc = "Bit 3 - DMA Interrupt Signal Enable."] - #[inline] - pub fn dma(&self) -> DMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DMAR { bits } - } - #[doc = "Bit 4 - Buffer Write Ready Signal Enable."] - #[inline] - pub fn buffer_wr(&self) -> BUFFER_WRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFFER_WRR { bits } - } - #[doc = "Bit 5 - Buffer Read Ready Signal Enable."] - #[inline] - pub fn buffer_rd(&self) -> BUFFER_RDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - BUFFER_RDR { bits } - } - #[doc = "Bit 6 - Card Insertion Signal Enable."] - #[inline] - pub fn card_insert(&self) -> CARD_INSERTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INSERTR { bits } - } - #[doc = "Bit 7 - Card Removal Signal Enable."] - #[inline] - pub fn card_removal(&self) -> CARD_REMOVALR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_REMOVALR { bits } - } - #[doc = "Bit 8 - Card Interrupt Signal Enable."] - #[inline] - pub fn card_int(&self) -> CARD_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CARD_INTR { bits } - } - #[doc = "Bit 12 - Re-Tuning Event Signal Enable."] - #[inline] - pub fn retuning(&self) -> RETUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - RETUNINGR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Complete Signal Enable."] - #[inline] - pub fn cmd_comp(&mut self) -> _CMD_COMPW { - _CMD_COMPW { w: self } - } - #[doc = "Bit 1 - Transfer Complete Signal Enable."] - #[inline] - pub fn trans_comp(&mut self) -> _TRANS_COMPW { - _TRANS_COMPW { w: self } - } - #[doc = "Bit 2 - Block Gap Event Signal Enable."] - #[inline] - pub fn blk_gap(&mut self) -> _BLK_GAPW { - _BLK_GAPW { w: self } - } - #[doc = "Bit 3 - DMA Interrupt Signal Enable."] - #[inline] - pub fn dma(&mut self) -> _DMAW { - _DMAW { w: self } - } - #[doc = "Bit 4 - Buffer Write Ready Signal Enable."] - #[inline] - pub fn buffer_wr(&mut self) -> _BUFFER_WRW { - _BUFFER_WRW { w: self } - } - #[doc = "Bit 5 - Buffer Read Ready Signal Enable."] - #[inline] - pub fn buffer_rd(&mut self) -> _BUFFER_RDW { - _BUFFER_RDW { w: self } - } - #[doc = "Bit 6 - Card Insertion Signal Enable."] - #[inline] - pub fn card_insert(&mut self) -> _CARD_INSERTW { - _CARD_INSERTW { w: self } - } - #[doc = "Bit 7 - Card Removal Signal Enable."] - #[inline] - pub fn card_removal(&mut self) -> _CARD_REMOVALW { - _CARD_REMOVALW { w: self } - } - #[doc = "Bit 8 - Card Interrupt Signal Enable."] - #[inline] - pub fn card_int(&mut self) -> _CARD_INTW { - _CARD_INTW { w: self } - } - #[doc = "Bit 12 - Re-Tuning Event Signal Enable."] - #[inline] - pub fn retuning(&mut self) -> _RETUNINGW { - _RETUNINGW { w: self } - } - } - } - #[doc = "Error Interrupt Signal Enable."] - pub struct ER_INT_SIGNAL { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Error Interrupt Signal Enable."] - pub mod er_int_signal { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::ER_INT_SIGNAL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_TOR { - bits: bool, - } - impl CMD_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_CRCR { - bits: bool, - } - impl CMD_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_END_BITR { - bits: bool, - } - impl CMD_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_IDXR { - bits: bool, - } - impl CMD_IDXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_TOR { - bits: bool, - } - impl DATA_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_CRCR { - bits: bool, - } - impl DATA_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_END_BITR { - bits: bool, - } - impl DATA_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CURR_LIMR { - bits: bool, - } - impl CURR_LIMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUTO_CMDR { - bits: bool, - } - impl AUTO_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADMAR { - bits: bool, - } - impl ADMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TUNINGR { - bits: bool, - } - impl TUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TAR_RESPR { - bits: bool, - } - impl TAR_RESPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CMD_TOW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CMD_IDXW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_IDXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_TOW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_CRCW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CURR_LIMW<'a> { - w: &'a mut W, - } - impl<'a> _CURR_LIMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AUTO_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _AUTO_CMDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ADMAW<'a> { - w: &'a mut W, - } - impl<'a> _ADMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TUNINGW<'a> { - w: &'a mut W, - } - impl<'a> _TUNINGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TAR_RESPW<'a> { - w: &'a mut W, - } - impl<'a> _TAR_RESPW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Command Timeout Error Signal Enable."] - #[inline] - pub fn cmd_to(&self) -> CMD_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_TOR { bits } - } - #[doc = "Bit 1 - Command CRC Error Signal Enable."] - #[inline] - pub fn cmd_crc(&self) -> CMD_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_CRCR { bits } - } - #[doc = "Bit 2 - Command End Bit Error Signal Enable."] - #[inline] - pub fn cmd_end_bit(&self) -> CMD_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_END_BITR { bits } - } - #[doc = "Bit 3 - Command Index Error Signal Enable."] - #[inline] - pub fn cmd_idx(&self) -> CMD_IDXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_IDXR { bits } - } - #[doc = "Bit 4 - Data Timeout Error Signal Enable."] - #[inline] - pub fn data_to(&self) -> DATA_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_TOR { bits } - } - #[doc = "Bit 5 - Data CRC Error Signal Enable."] - #[inline] - pub fn data_crc(&self) -> DATA_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_CRCR { bits } - } - #[doc = "Bit 6 - Data End Bit Error Signal Enable."] - #[inline] - pub fn data_end_bit(&self) -> DATA_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_END_BITR { bits } - } - #[doc = "Bit 7 - Current Limit Error Signal Enable."] - #[inline] - pub fn curr_lim(&self) -> CURR_LIMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CURR_LIMR { bits } - } - #[doc = "Bit 8 - Auto CMD Error Signal Enable."] - #[inline] - pub fn auto_cmd(&self) -> AUTO_CMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - AUTO_CMDR { bits } - } - #[doc = "Bit 9 - ADMA Error Signal Enable."] - #[inline] - pub fn adma(&self) -> ADMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ADMAR { bits } - } - #[doc = "Bit 10 - Tuning Error Signal Enable."] - #[inline] - pub fn tuning(&self) -> TUNINGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TUNINGR { bits } - } - #[doc = "Bit 12 - Target Response Error Signal Enable."] - #[inline] - pub fn tar_resp(&self) -> TAR_RESPR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TAR_RESPR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Command Timeout Error Signal Enable."] - #[inline] - pub fn cmd_to(&mut self) -> _CMD_TOW { - _CMD_TOW { w: self } - } - #[doc = "Bit 1 - Command CRC Error Signal Enable."] - #[inline] - pub fn cmd_crc(&mut self) -> _CMD_CRCW { - _CMD_CRCW { w: self } - } - #[doc = "Bit 2 - Command End Bit Error Signal Enable."] - #[inline] - pub fn cmd_end_bit(&mut self) -> _CMD_END_BITW { - _CMD_END_BITW { w: self } - } - #[doc = "Bit 3 - Command Index Error Signal Enable."] - #[inline] - pub fn cmd_idx(&mut self) -> _CMD_IDXW { - _CMD_IDXW { w: self } - } - #[doc = "Bit 4 - Data Timeout Error Signal Enable."] - #[inline] - pub fn data_to(&mut self) -> _DATA_TOW { - _DATA_TOW { w: self } - } - #[doc = "Bit 5 - Data CRC Error Signal Enable."] - #[inline] - pub fn data_crc(&mut self) -> _DATA_CRCW { - _DATA_CRCW { w: self } - } - #[doc = "Bit 6 - Data End Bit Error Signal Enable."] - #[inline] - pub fn data_end_bit(&mut self) -> _DATA_END_BITW { - _DATA_END_BITW { w: self } - } - #[doc = "Bit 7 - Current Limit Error Signal Enable."] - #[inline] - pub fn curr_lim(&mut self) -> _CURR_LIMW { - _CURR_LIMW { w: self } - } - #[doc = "Bit 8 - Auto CMD Error Signal Enable."] - #[inline] - pub fn auto_cmd(&mut self) -> _AUTO_CMDW { - _AUTO_CMDW { w: self } - } - #[doc = "Bit 9 - ADMA Error Signal Enable."] - #[inline] - pub fn adma(&mut self) -> _ADMAW { - _ADMAW { w: self } - } - #[doc = "Bit 10 - Tuning Error Signal Enable."] - #[inline] - pub fn tuning(&mut self) -> _TUNINGW { - _TUNINGW { w: self } - } - #[doc = "Bit 12 - Target Response Error Signal Enable."] - #[inline] - pub fn tar_resp(&mut self) -> _TAR_RESPW { - _TAR_RESPW { w: self } - } - } - } - #[doc = "Auto CMD Error Status."] - pub struct AUTO_CMD_ER { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Auto CMD Error Status."] - pub mod auto_cmd_er { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::AUTO_CMD_ER { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct NOT_EXCUTEDR { - bits: bool, - } - impl NOT_EXCUTEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TOR { - bits: bool, - } - impl TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CRCR { - bits: bool, - } - impl CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct END_BITR { - bits: bool, - } - impl END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INDEXR { - bits: bool, - } - impl INDEXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct NOT_ISSUEDR { - bits: bool, - } - impl NOT_ISSUEDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _NOT_EXCUTEDW<'a> { - w: &'a mut W, - } - impl<'a> _NOT_EXCUTEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TOW<'a> { - w: &'a mut W, - } - impl<'a> _TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INDEXW<'a> { - w: &'a mut W, - } - impl<'a> _INDEXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NOT_ISSUEDW<'a> { - w: &'a mut W, - } - impl<'a> _NOT_ISSUEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Auto CMD12 Not Executed."] - #[inline] - pub fn not_excuted(&self) -> NOT_EXCUTEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - NOT_EXCUTEDR { bits } - } - #[doc = "Bit 1 - Auto CMD Timeout Error."] - #[inline] - pub fn to(&self) -> TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - TOR { bits } - } - #[doc = "Bit 2 - Auto CMD CRC Error."] - #[inline] - pub fn crc(&self) -> CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CRCR { bits } - } - #[doc = "Bit 3 - Auto CMD End Bit Error."] - #[inline] - pub fn end_bit(&self) -> END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - END_BITR { bits } - } - #[doc = "Bit 4 - Auto CMD Index Error."] - #[inline] - pub fn index(&self) -> INDEXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - INDEXR { bits } - } - #[doc = "Bit 7 - Command Not Issued By Auto CMD12 Error."] - #[inline] - pub fn not_issued(&self) -> NOT_ISSUEDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - NOT_ISSUEDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Auto CMD12 Not Executed."] - #[inline] - pub fn not_excuted(&mut self) -> _NOT_EXCUTEDW { - _NOT_EXCUTEDW { w: self } - } - #[doc = "Bit 1 - Auto CMD Timeout Error."] - #[inline] - pub fn to(&mut self) -> _TOW { - _TOW { w: self } - } - #[doc = "Bit 2 - Auto CMD CRC Error."] - #[inline] - pub fn crc(&mut self) -> _CRCW { - _CRCW { w: self } - } - #[doc = "Bit 3 - Auto CMD End Bit Error."] - #[inline] - pub fn end_bit(&mut self) -> _END_BITW { - _END_BITW { w: self } - } - #[doc = "Bit 4 - Auto CMD Index Error."] - #[inline] - pub fn index(&mut self) -> _INDEXW { - _INDEXW { w: self } - } - #[doc = "Bit 7 - Command Not Issued By Auto CMD12 Error."] - #[inline] - pub fn not_issued(&mut self) -> _NOT_ISSUEDW { - _NOT_ISSUEDW { w: self } - } - } - } - #[doc = "Host Control 2."] - pub struct HOST_CN_2 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Host Control 2."] - pub mod host_cn_2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::HOST_CN_2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct UHSR { - bits: u8, - } - impl UHSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct SIGNAL_V1_8R { - bits: bool, - } - impl SIGNAL_V1_8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct EXCUTER { - bits: bool, - } - impl EXCUTER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SAMPLING_CLKR { - bits: bool, - } - impl SAMPLING_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ASYNCH_INTR { - bits: bool, - } - impl ASYNCH_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PRESET_VAL_ENR { - bits: bool, - } - impl PRESET_VAL_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _UHSW<'a> { - w: &'a mut W, - } - impl<'a> _UHSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SIGNAL_V1_8W<'a> { - w: &'a mut W, - } - impl<'a> _SIGNAL_V1_8W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DRIVER_STRENGTHW<'a> { - w: &'a mut W, - } - impl<'a> _DRIVER_STRENGTHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EXCUTEW<'a> { - w: &'a mut W, - } - impl<'a> _EXCUTEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SAMPLING_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _SAMPLING_CLKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ASYNCH_INTW<'a> { - w: &'a mut W, - } - impl<'a> _ASYNCH_INTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PRESET_VAL_ENW<'a> { - w: &'a mut W, - } - impl<'a> _PRESET_VAL_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:1 - UHS Mode Select."] - #[inline] - pub fn uhs(&self) -> UHSR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - UHSR { bits } - } - #[doc = "Bit 3 - 1.8V Signaling Enable."] - #[inline] - pub fn signal_v1_8(&self) -> SIGNAL_V1_8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - SIGNAL_V1_8R { bits } - } - #[doc = "Bits 4:5 - Driver Strength Select."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - #[doc = "Bit 6 - Execute Tuning."] - #[inline] - pub fn excute(&self) -> EXCUTER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EXCUTER { bits } - } - #[doc = "Bit 7 - Sampling Clock Select."] - #[inline] - pub fn sampling_clk(&self) -> SAMPLING_CLKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - SAMPLING_CLKR { bits } - } - #[doc = "Bit 14 - Asynchronous Interrupt Enable."] - #[inline] - pub fn asynch_int(&self) -> ASYNCH_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ASYNCH_INTR { bits } - } - #[doc = "Bit 15 - Preset Value Enable."] - #[inline] - pub fn preset_val_en(&self) -> PRESET_VAL_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - PRESET_VAL_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - UHS Mode Select."] - #[inline] - pub fn uhs(&mut self) -> _UHSW { - _UHSW { w: self } - } - #[doc = "Bit 3 - 1.8V Signaling Enable."] - #[inline] - pub fn signal_v1_8(&mut self) -> _SIGNAL_V1_8W { - _SIGNAL_V1_8W { w: self } - } - #[doc = "Bits 4:5 - Driver Strength Select."] - #[inline] - pub fn driver_strength(&mut self) -> _DRIVER_STRENGTHW { - _DRIVER_STRENGTHW { w: self } - } - #[doc = "Bit 6 - Execute Tuning."] - #[inline] - pub fn excute(&mut self) -> _EXCUTEW { - _EXCUTEW { w: self } - } - #[doc = "Bit 7 - Sampling Clock Select."] - #[inline] - pub fn sampling_clk(&mut self) -> _SAMPLING_CLKW { - _SAMPLING_CLKW { w: self } - } - #[doc = "Bit 14 - Asynchronous Interrupt Enable."] - #[inline] - pub fn asynch_int(&mut self) -> _ASYNCH_INTW { - _ASYNCH_INTW { w: self } - } - #[doc = "Bit 15 - Preset Value Enable."] - #[inline] - pub fn preset_val_en(&mut self) -> _PRESET_VAL_ENW { - _PRESET_VAL_ENW { w: self } - } - } - } - #[doc = "Capabilities 0-31."] - pub struct CFG_0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Capabilities 0-31."] - pub mod cfg_0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CFG_0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct TO_CLK_FREQR { - bits: u8, - } - impl TO_CLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TO_CLK_UNITR { - bits: bool, - } - impl TO_CLK_UNITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CLK_FREQR { - bits: u8, - } - impl CLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MAX_BLK_LENR { - bits: u8, - } - impl MAX_BLK_LENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct BIT_8R { - bits: bool, - } - impl BIT_8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADMA2R { - bits: bool, - } - impl ADMA2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HSR { - bits: bool, - } - impl HSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDMAR { - bits: bool, - } - impl SDMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SUSPENDR { - bits: bool, - } - impl SUSPENDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct V3_3R { - bits: bool, - } - impl V3_3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct V3_0R { - bits: bool, - } - impl V3_0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct V1_8R { - bits: bool, - } - impl V1_8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BIT_64_SYS_BUSR { - bits: bool, - } - impl BIT_64_SYS_BUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ASYNC_INTR { - bits: bool, - } - impl ASYNC_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SLOT_TYPER { - bits: u8, - } - impl SLOT_TYPER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:5 - Timeout Clock Frequency."] - #[inline] - pub fn to_clk_freq(&self) -> TO_CLK_FREQR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TO_CLK_FREQR { bits } - } - #[doc = "Bit 7 - Timeout Clock Unit."] - #[inline] - pub fn to_clk_unit(&self) -> TO_CLK_UNITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TO_CLK_UNITR { bits } - } - #[doc = "Bits 8:15 - Base Clock Frequency For SD Clock."] - #[inline] - pub fn clk_freq(&self) -> CLK_FREQR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CLK_FREQR { bits } - } - #[doc = "Bits 16:17 - Max Block Length."] - #[inline] - pub fn max_blk_len(&self) -> MAX_BLK_LENR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - MAX_BLK_LENR { bits } - } - #[doc = "Bit 18 - 8-bit Support for Embedded Device."] - #[inline] - pub fn bit_8(&self) -> BIT_8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BIT_8R { bits } - } - #[doc = "Bit 19 - ADMA2 Support."] - #[inline] - pub fn adma2(&self) -> ADMA2R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ADMA2R { bits } - } - #[doc = "Bit 21 - High Speed Support."] - #[inline] - pub fn hs(&self) -> HSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - HSR { bits } - } - #[doc = "Bit 22 - SDMA Support."] - #[inline] - pub fn sdma(&self) -> SDMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDMAR { bits } - } - #[doc = "Bit 23 - Suspend/Resume Support."] - #[inline] - pub fn suspend(&self) -> SUSPENDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SUSPENDR { bits } - } - #[doc = "Bit 24 - Voltage Support 3.3V."] - #[inline] - pub fn v3_3(&self) -> V3_3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - V3_3R { bits } - } - #[doc = "Bit 25 - Voltage Support 3.0V."] - #[inline] - pub fn v3_0(&self) -> V3_0R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - V3_0R { bits } - } - #[doc = "Bit 26 - Voltage Support 1.8V."] - #[inline] - pub fn v1_8(&self) -> V1_8R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - V1_8R { bits } - } - #[doc = "Bit 28 - 64-bit System Bus Support."] - #[inline] - pub fn bit_64_sys_bus(&self) -> BIT_64_SYS_BUSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BIT_64_SYS_BUSR { bits } - } - #[doc = "Bit 29 - Asynchronous Interrupt Support."] - #[inline] - pub fn async_int(&self) -> ASYNC_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ASYNC_INTR { bits } - } - #[doc = "Bits 30:31 - Slot Type."] - #[inline] - pub fn slot_type(&self) -> SLOT_TYPER { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - SLOT_TYPER { bits } - } - } - } - #[doc = "Capabilities 32-63."] - pub struct CFG_1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Capabilities 32-63."] - pub mod cfg_1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CFG_1 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDR50R { - bits: bool, - } - impl SDR50R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SDR104R { - bits: (), - } - impl SDR104R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> () { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct DDR50R { - bits: bool, - } - impl DDR50R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_AR { - bits: bool, - } - impl DRIVER_AR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_CR { - bits: bool, - } - impl DRIVER_CR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_DR { - bits: bool, - } - impl DRIVER_DR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TIMER_CNT_TUNINGR { - bits: u8, - } - impl TIMER_CNT_TUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TUNING_SDR50R { - bits: bool, - } - impl TUNING_SDR50R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RETUNINGR { - bits: u8, - } - impl RETUNINGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_MULTIR { - bits: u8, - } - impl CLK_MULTIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SDR50 Support."] - #[inline] - pub fn sdr50(&self) -> SDR50R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SDR50R { bits } - } - #[doc = "Bits 1:0 - SDR104 Support."] - #[inline] - pub fn sdr104(&self) -> SDR104R { - let bits = (); - SDR104R { bits } - } - #[doc = "Bit 2 - DDR50 Support."] - #[inline] - pub fn ddr50(&self) -> DDR50R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DDR50R { bits } - } - #[doc = "Bit 4 - Driver Type A Support."] - #[inline] - pub fn driver_a(&self) -> DRIVER_AR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DRIVER_AR { bits } - } - #[doc = "Bit 5 - Driver Type C Support."] - #[inline] - pub fn driver_c(&self) -> DRIVER_CR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DRIVER_CR { bits } - } - #[doc = "Bit 6 - Driver Type D Support."] - #[inline] - pub fn driver_d(&self) -> DRIVER_DR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DRIVER_DR { bits } - } - #[doc = "Bits 8:11 - Timer Count for Re-Tuning."] - #[inline] - pub fn timer_cnt_tuning(&self) -> TIMER_CNT_TUNINGR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TIMER_CNT_TUNINGR { bits } - } - #[doc = "Bit 13 - Use Tuning for SDR50."] - #[inline] - pub fn tuning_sdr50(&self) -> TUNING_SDR50R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TUNING_SDR50R { bits } - } - #[doc = "Bits 14:15 - Re-Tuning Modes."] - #[inline] - pub fn retuning(&self) -> RETUNINGR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RETUNINGR { bits } - } - #[doc = "Bits 16:23 - Clock Multiplier."] - #[inline] - pub fn clk_multi(&self) -> CLK_MULTIR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CLK_MULTIR { bits } - } - } - } - #[doc = "Maximum Current Capabilities."] - pub struct MAX_CURR_CFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Maximum Current Capabilities."] - pub mod max_curr_cfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::MAX_CURR_CFG { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct V3_3R { - bits: u8, - } - impl V3_3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct V3_0R { - bits: u8, - } - impl V3_0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct V1_8R { - bits: u8, - } - impl V1_8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Maximum Current for 3.3V."] - #[inline] - pub fn v3_3(&self) -> V3_3R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - V3_3R { bits } - } - #[doc = "Bits 8:15 - Maximum Current for 3.0V."] - #[inline] - pub fn v3_0(&self) -> V3_0R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - V3_0R { bits } - } - #[doc = "Bits 16:23 - Maximum Current for 1.8V."] - #[inline] - pub fn v1_8(&self) -> V1_8R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - V1_8R { bits } - } - } - } - #[doc = "Force Event for Auto CMD Error Status."] - pub struct FORCE_CMD { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Force Event for Auto CMD Error Status."] - pub mod force_cmd { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::FORCE_CMD { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = r" Proxy"] - pub struct _NOT_EXCUW<'a> { - w: &'a mut W, - } - impl<'a> _NOT_EXCUW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TOW<'a> { - w: &'a mut W, - } - impl<'a> _TOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CRCW<'a> { - w: &'a mut W, - } - impl<'a> _CRCW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _END_BITW<'a> { - w: &'a mut W, - } - impl<'a> _END_BITW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INDEXW<'a> { - w: &'a mut W, - } - impl<'a> _INDEXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NOT_ISSUEDW<'a> { - w: &'a mut W, - } - impl<'a> _NOT_ISSUEDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Force Event for Auto CMD12 Not Executed."] - #[inline] - pub fn not_excu(&mut self) -> _NOT_EXCUW { - _NOT_EXCUW { w: self } - } - #[doc = "Bit 1 - Force Event for Auto CMD Timeout Error."] - #[inline] - pub fn to(&mut self) -> _TOW { - _TOW { w: self } - } - #[doc = "Bit 2 - Force Event for Auto CMD CRC Error."] - #[inline] - pub fn crc(&mut self) -> _CRCW { - _CRCW { w: self } - } - #[doc = "Bit 3 - Force Event for Auto CMD End Bit Error."] - #[inline] - pub fn end_bit(&mut self) -> _END_BITW { - _END_BITW { w: self } - } - #[doc = "Bit 4 - Force Event for Auto CMD Index Error."] - #[inline] - pub fn index(&mut self) -> _INDEXW { - _INDEXW { w: self } - } - #[doc = "Bit 7 - Force Event for Command Not Issued By Auto CMD12 Error."] - #[inline] - pub fn not_issued(&mut self) -> _NOT_ISSUEDW { - _NOT_ISSUEDW { w: self } - } - } - } - #[doc = "Force Event for Error Interrupt Status."] - pub struct FORCE_EVENT_INT_STAT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Force Event for Error Interrupt Status."] - pub mod force_event_int_stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::FORCE_EVENT_INT_STAT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMD_TOR { - bits: bool, - } - impl CMD_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_CRCR { - bits: bool, - } - impl CMD_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_END_BITR { - bits: bool, - } - impl CMD_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CMD_INDEXR { - bits: bool, - } - impl CMD_INDEXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_TOR { - bits: bool, - } - impl DATA_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_CRCR { - bits: bool, - } - impl DATA_CRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_END_BITR { - bits: bool, - } - impl DATA_END_BITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CURR_LIMITR { - bits: bool, - } - impl CURR_LIMITR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AUTO_CMDR { - bits: bool, - } - impl AUTO_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ADMAR { - bits: bool, - } - impl ADMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _ADMAW<'a> { - w: &'a mut W, - } - impl<'a> _ADMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VENDORW<'a> { - w: &'a mut W, - } - impl<'a> _VENDORW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Force Event for Command Timeout Error."] - #[inline] - pub fn cmd_to(&self) -> CMD_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_TOR { bits } - } - #[doc = "Bit 1 - Force Event for Command CRC Error."] - #[inline] - pub fn cmd_crc(&self) -> CMD_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_CRCR { bits } - } - #[doc = "Bit 2 - Force Event for Command End Bit Error."] - #[inline] - pub fn cmd_end_bit(&self) -> CMD_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_END_BITR { bits } - } - #[doc = "Bit 3 - Force Event for Command Index Error."] - #[inline] - pub fn cmd_index(&self) -> CMD_INDEXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CMD_INDEXR { bits } - } - #[doc = "Bit 4 - Force Event for Data Timeout Error."] - #[inline] - pub fn data_to(&self) -> DATA_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_TOR { bits } - } - #[doc = "Bit 5 - Force Event for Data CRC Error."] - #[inline] - pub fn data_crc(&self) -> DATA_CRCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_CRCR { bits } - } - #[doc = "Bit 6 - Force Event for Data End Bit Error."] - #[inline] - pub fn data_end_bit(&self) -> DATA_END_BITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - DATA_END_BITR { bits } - } - #[doc = "Bit 7 - Force Event for Current Limit Error."] - #[inline] - pub fn curr_limit(&self) -> CURR_LIMITR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CURR_LIMITR { bits } - } - #[doc = "Bit 8 - Force Event for Auto CMD Error."] - #[inline] - pub fn auto_cmd(&self) -> AUTO_CMDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - AUTO_CMDR { bits } - } - #[doc = "Bit 9 - Force Event for ADMA Error."] - #[inline] - pub fn adma(&self) -> ADMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - ADMAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 9 - Force Event for ADMA Error."] - #[inline] - pub fn adma(&mut self) -> _ADMAW { - _ADMAW { w: self } - } - #[doc = "Bits 12:14 - Force Event for Vendor Specific Error Status."] - #[inline] - pub fn vendor(&mut self) -> _VENDORW { - _VENDORW { w: self } - } - } - } - #[doc = "ADMA Error Status."] - pub struct ADMA_ER { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "ADMA Error Status."] - pub mod adma_er { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::ADMA_ER { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct STATER { - bits: u8, - } - impl STATER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct LEN_MISMATCHR { - bits: bool, - } - impl LEN_MISMATCHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _STATEW<'a> { - w: &'a mut W, - } - impl<'a> _STATEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LEN_MISMATCHW<'a> { - w: &'a mut W, - } - impl<'a> _LEN_MISMATCHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:1 - ADMA Error State."] - #[inline] - pub fn state(&self) -> STATER { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - STATER { bits } - } - #[doc = "Bit 2 - ADMA Length Mismatch Error."] - #[inline] - pub fn len_mismatch(&self) -> LEN_MISMATCHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - LEN_MISMATCHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - ADMA Error State."] - #[inline] - pub fn state(&mut self) -> _STATEW { - _STATEW { w: self } - } - #[doc = "Bit 2 - ADMA Length Mismatch Error."] - #[inline] - pub fn len_mismatch(&mut self) -> _LEN_MISMATCHW { - _LEN_MISMATCHW { w: self } - } - } - } - #[doc = "ADMA System Address 0-31."] - pub struct ADMA_ADDR_0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADMA System Address 0-31."] - pub mod adma_addr_0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ADMA_ADDR_0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - ADMA System Address Part 1 (part 2 is ADMA_ADDR_1)."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - ADMA System Address Part 1 (part 2 is ADMA_ADDR_1)."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "ADMA System Address 32-63."] - pub struct ADMA_ADDR_1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "ADMA System Address 32-63."] - pub mod adma_addr_1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::ADMA_ADDR_1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u32, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - ADMA System Address Part 1 (part 2 is ADMA_ADDR_1)."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - ADMA System Address Part 1 (part 2 is ADMA_ADDR_1)."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Preset Value for Initialization."] - pub struct PRESET_0 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for Initialization."] - pub mod preset_0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for Default Speed."] - pub struct PRESET_1 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for Default Speed."] - pub mod preset_1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_1 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for High Speed."] - pub struct PRESET_2 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for High Speed."] - pub mod preset_2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_2 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for SDR12."] - pub struct PRESET_3 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for SDR12."] - pub mod preset_3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_3 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for SDR25."] - pub struct PRESET_4 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for SDR25."] - pub mod preset_4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_4 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for SDR50."] - pub struct PRESET_5 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for SDR50."] - pub mod preset_5 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_5 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for SDR104."] - pub struct PRESET_6 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for SDR104."] - pub mod preset_6 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_6 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Preset Value for DDR50."] - pub struct PRESET_7 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Preset Value for DDR50."] - pub mod preset_7 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::PRESET_7 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SDCLK_FREQR { - bits: u16, - } - impl SDCLK_FREQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct CLK_GENR { - bits: bool, - } - impl CLK_GENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DRIVER_STRENGTHR { - bits: u8, - } - impl DRIVER_STRENGTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:9 - SDCLK Frequency Select Value."] - #[inline] - pub fn sdclk_freq(&self) -> SDCLK_FREQR { - let bits = { - const MASK: u16 = 0x03ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - SDCLK_FREQR { bits } - } - #[doc = "Bit 10 - Clock Generator Select Value."] - #[inline] - pub fn clk_gen(&self) -> CLK_GENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - CLK_GENR { bits } - } - #[doc = "Bits 14:15 - Driver Strength Select Value."] - #[inline] - pub fn driver_strength(&self) -> DRIVER_STRENGTHR { - let bits = { - const MASK: u8 = 0x03; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - DRIVER_STRENGTHR { bits } - } - } - } - #[doc = "Shared Bus Control."] - pub struct SHARED_BUS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Shared Bus Control."] - pub mod shared_bus { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SHARED_BUS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Slot Interrupt Status."] - pub struct SLOT_INT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Slot Interrupt Status."] - pub mod slot_int { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::SLOT_INT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct INT_SIGNALSR { - bits: bool, - } - impl INT_SIGNALSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 0 - Interrupt Signal For Each Slot."] - #[inline] - pub fn int_signals(&self) -> INT_SIGNALSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - INT_SIGNALSR { bits } - } - } - } - #[doc = "Host Controller Version."] - pub struct HOST_CN_VER { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Host Controller Version."] - pub mod host_cn_ver { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::HOST_CN_VER { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SPEC_VERR { - bits: u8, - } - impl SPEC_VERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct VEND_VERR { - bits: u8, - } - impl VEND_VERR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _SPEC_VERW<'a> { - w: &'a mut W, - } - impl<'a> _SPEC_VERW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _VEND_VERW<'a> { - w: &'a mut W, - } - impl<'a> _VEND_VERW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:7 - Specification Version Number."] - #[inline] - pub fn spec_ver(&self) -> SPEC_VERR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - SPEC_VERR { bits } - } - #[doc = "Bits 8:15 - Vendor Version Number."] - #[inline] - pub fn vend_ver(&self) -> VEND_VERR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - VEND_VERR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Specification Version Number."] - #[inline] - pub fn spec_ver(&mut self) -> _SPEC_VERW { - _SPEC_VERW { w: self } - } - #[doc = "Bits 8:15 - Vendor Version Number."] - #[inline] - pub fn vend_ver(&mut self) -> _VEND_VERW { - _VEND_VERW { w: self } - } - } - } -} -#[doc = "Smart DMA"] -pub struct SDMA { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SDMA {} -impl SDMA { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const sdma::RegisterBlock { - 0x4003_6000 as *const _ - } -} -impl Deref for SDMA { - type Target = sdma::RegisterBlock; - fn deref(&self) -> &sdma::RegisterBlock { - unsafe { &*SDMA::ptr() } - } -} -#[doc = "Smart DMA"] -pub mod sdma { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Q30E Instruction Pointer."] - pub ip: IP, - #[doc = "0x04 - Q30E Stack Pointer."] - pub sp: SP, - #[doc = "0x08 - Q30E Data Pointer 0."] - pub dp0: DP0, - #[doc = "0x0c - Q30E Data Pointer 1."] - pub dp1: DP1, - #[doc = "0x10 - Q30E Frame Pointer Base."] - pub bp: BP, - #[doc = "0x14 - Q30E Frame Pointer Offset."] - pub offs: OFFS, - #[doc = "0x18 - Q30E Loop Counter 0."] - pub lc0: LC0, - #[doc = "0x1c - Q30E Loop Counter 1."] - pub lc1: LC1, - #[doc = "0x20 - Q30E Accumulator 0."] - pub a0: A0, - #[doc = "0x24 - Q30E Accumulator 1."] - pub a1: A1, - #[doc = "0x28 - Q30E Accumulator 2."] - pub a2: A2, - #[doc = "0x2c - Q30E Accumulator 3."] - pub a3: A3, - #[doc = "0x30 - Q30E Watchdog Control."] - pub wdcn: WDCN, - _reserved0: [u8; 76usize], - #[doc = "0x80 - Interrupt Mux Control 0."] - pub int_mux_ctrl0: INT_MUX_CTRL0, - #[doc = "0x84 - Interrupt Mux Control 1."] - pub int_mux_ctrl1: INT_MUX_CTRL1, - #[doc = "0x88 - Interrupt Mux Control 2."] - pub int_mux_ctrl2: INT_MUX_CTRL2, - #[doc = "0x8c - Interrupt Mux Control 3."] - pub int_mux_ctrl3: INT_MUX_CTRL3, - #[doc = "0x90 - Configurable starting IP address for Q30E."] - pub ip_addr: IP_ADDR, - #[doc = "0x94 - Control Register."] - pub ctrl: CTRL, - _reserved1: [u8; 8usize], - #[doc = "0xa0 - Interrupt Input From CPU Control Register."] - pub int_in_ctrl: INT_IN_CTRL, - #[doc = "0xa4 - Interrupt Input From CPU Flag."] - pub int_in_flag: INT_IN_FLAG, - #[doc = "0xa8 - Interrupt Input From CPU Enable."] - pub int_in_ie: INT_IN_IE, - _reserved2: [u8; 4usize], - #[doc = "0xb0 - Interrupt Output To CPU Flag."] - pub irq_flag: IRQ_FLAG, - #[doc = "0xb4 - Interrupt Output To CPU Control Register."] - pub irq_ie: IRQ_IE, - } - #[doc = "Q30E Instruction Pointer."] - pub struct IP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Instruction Pointer."] - pub mod ip { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::IP { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Stack Pointer."] - pub struct SP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Stack Pointer."] - pub mod sp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SP { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Data Pointer 0."] - pub struct DP0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Data Pointer 0."] - pub mod dp0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::DP0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Data Pointer 1."] - pub struct DP1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Data Pointer 1."] - pub mod dp1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::DP1 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Frame Pointer Base."] - pub struct BP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Frame Pointer Base."] - pub mod bp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::BP { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Frame Pointer Offset."] - pub struct OFFS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Frame Pointer Offset."] - pub mod offs { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::OFFS { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Loop Counter 0."] - pub struct LC0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Loop Counter 0."] - pub mod lc0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::LC0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Loop Counter 1."] - pub struct LC1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Loop Counter 1."] - pub mod lc1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::LC1 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Accumulator 0."] - pub struct A0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Accumulator 0."] - pub mod a0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::A0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Accumulator 1."] - pub struct A1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Accumulator 1."] - pub mod a1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::A1 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Accumulator 2."] - pub struct A2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Accumulator 2."] - pub mod a2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::A2 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Accumulator 3."] - pub struct A3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Accumulator 3."] - pub mod a3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::A3 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Q30E Watchdog Control."] - pub struct WDCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Q30E Watchdog Control."] - pub mod wdcn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::WDCN { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Interrupt Mux Control 0."] - pub struct INT_MUX_CTRL0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Mux Control 0."] - pub mod int_mux_ctrl0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_MUX_CTRL0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INTSEL16R { - bits: u8, - } - impl INTSEL16R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL17R { - bits: u8, - } - impl INTSEL17R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL18R { - bits: u8, - } - impl INTSEL18R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL19R { - bits: u8, - } - impl INTSEL19R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INTSEL16W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL16W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL17W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL17W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL18W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL18W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL19W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL19W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Interrupt Selection For 16th Interrupt."] - #[inline] - pub fn intsel16(&self) -> INTSEL16R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL16R { bits } - } - #[doc = "Bits 8:15 - Interrupt Selection For 17th Interrupt."] - #[inline] - pub fn intsel17(&self) -> INTSEL17R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL17R { bits } - } - #[doc = "Bits 16:23 - Interrupt Selection For 18th Interrupt."] - #[inline] - pub fn intsel18(&self) -> INTSEL18R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL18R { bits } - } - #[doc = "Bits 24:31 - Interrupt Selection For 19th Interrupt."] - #[inline] - pub fn intsel19(&self) -> INTSEL19R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL19R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Interrupt Selection For 16th Interrupt."] - #[inline] - pub fn intsel16(&mut self) -> _INTSEL16W { - _INTSEL16W { w: self } - } - #[doc = "Bits 8:15 - Interrupt Selection For 17th Interrupt."] - #[inline] - pub fn intsel17(&mut self) -> _INTSEL17W { - _INTSEL17W { w: self } - } - #[doc = "Bits 16:23 - Interrupt Selection For 18th Interrupt."] - #[inline] - pub fn intsel18(&mut self) -> _INTSEL18W { - _INTSEL18W { w: self } - } - #[doc = "Bits 24:31 - Interrupt Selection For 19th Interrupt."] - #[inline] - pub fn intsel19(&mut self) -> _INTSEL19W { - _INTSEL19W { w: self } - } - } - } - #[doc = "Interrupt Mux Control 1."] - pub struct INT_MUX_CTRL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Mux Control 1."] - pub mod int_mux_ctrl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_MUX_CTRL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INTSEL20R { - bits: u8, - } - impl INTSEL20R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL21R { - bits: u8, - } - impl INTSEL21R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL22R { - bits: u8, - } - impl INTSEL22R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL23R { - bits: u8, - } - impl INTSEL23R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INTSEL20W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL20W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL21W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL21W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL22W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL22W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL23W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL23W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Interrupt Selection For 20th Interrupt."] - #[inline] - pub fn intsel20(&self) -> INTSEL20R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL20R { bits } - } - #[doc = "Bits 8:15 - Interrupt Selection For 21st Interrupt."] - #[inline] - pub fn intsel21(&self) -> INTSEL21R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL21R { bits } - } - #[doc = "Bits 16:23 - Interrupt Selection For 22nd Interrupt."] - #[inline] - pub fn intsel22(&self) -> INTSEL22R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL22R { bits } - } - #[doc = "Bits 24:31 - Interrupt Selection For 23rd Interrupt."] - #[inline] - pub fn intsel23(&self) -> INTSEL23R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL23R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Interrupt Selection For 20th Interrupt."] - #[inline] - pub fn intsel20(&mut self) -> _INTSEL20W { - _INTSEL20W { w: self } - } - #[doc = "Bits 8:15 - Interrupt Selection For 21st Interrupt."] - #[inline] - pub fn intsel21(&mut self) -> _INTSEL21W { - _INTSEL21W { w: self } - } - #[doc = "Bits 16:23 - Interrupt Selection For 22nd Interrupt."] - #[inline] - pub fn intsel22(&mut self) -> _INTSEL22W { - _INTSEL22W { w: self } - } - #[doc = "Bits 24:31 - Interrupt Selection For 23rd Interrupt."] - #[inline] - pub fn intsel23(&mut self) -> _INTSEL23W { - _INTSEL23W { w: self } - } - } - } - #[doc = "Interrupt Mux Control 2."] - pub struct INT_MUX_CTRL2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Mux Control 2."] - pub mod int_mux_ctrl2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_MUX_CTRL2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INTSEL24R { - bits: u8, - } - impl INTSEL24R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL25R { - bits: u8, - } - impl INTSEL25R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL26R { - bits: u8, - } - impl INTSEL26R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL27R { - bits: u8, - } - impl INTSEL27R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INTSEL24W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL24W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL25W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL25W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL26W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL26W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL27W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL27W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Interrupt Selection For 24th Interrupt."] - #[inline] - pub fn intsel24(&self) -> INTSEL24R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL24R { bits } - } - #[doc = "Bits 8:15 - Interrupt Selection For 25th Interrupt."] - #[inline] - pub fn intsel25(&self) -> INTSEL25R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL25R { bits } - } - #[doc = "Bits 16:23 - Interrupt Selection For 26th Interrupt."] - #[inline] - pub fn intsel26(&self) -> INTSEL26R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL26R { bits } - } - #[doc = "Bits 24:31 - Interrupt Selection For 27th Interrupt."] - #[inline] - pub fn intsel27(&self) -> INTSEL27R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL27R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Interrupt Selection For 24th Interrupt."] - #[inline] - pub fn intsel24(&mut self) -> _INTSEL24W { - _INTSEL24W { w: self } - } - #[doc = "Bits 8:15 - Interrupt Selection For 25th Interrupt."] - #[inline] - pub fn intsel25(&mut self) -> _INTSEL25W { - _INTSEL25W { w: self } - } - #[doc = "Bits 16:23 - Interrupt Selection For 26th Interrupt."] - #[inline] - pub fn intsel26(&mut self) -> _INTSEL26W { - _INTSEL26W { w: self } - } - #[doc = "Bits 24:31 - Interrupt Selection For 27th Interrupt."] - #[inline] - pub fn intsel27(&mut self) -> _INTSEL27W { - _INTSEL27W { w: self } - } - } - } - #[doc = "Interrupt Mux Control 3."] - pub struct INT_MUX_CTRL3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Mux Control 3."] - pub mod int_mux_ctrl3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_MUX_CTRL3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INTSEL28R { - bits: u8, - } - impl INTSEL28R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL29R { - bits: u8, - } - impl INTSEL29R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL30R { - bits: u8, - } - impl INTSEL30R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTSEL31R { - bits: u8, - } - impl INTSEL31R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INTSEL28W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL28W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL29W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL29W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL30W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL30W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INTSEL31W<'a> { - w: &'a mut W, - } - impl<'a> _INTSEL31W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Interrupt Selection For 28th Interrupt."] - #[inline] - pub fn intsel28(&self) -> INTSEL28R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL28R { bits } - } - #[doc = "Bits 8:15 - Interrupt Selection For 29th Interrupt."] - #[inline] - pub fn intsel29(&self) -> INTSEL29R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL29R { bits } - } - #[doc = "Bits 16:23 - Interrupt Selection For 30th Interrupt."] - #[inline] - pub fn intsel30(&self) -> INTSEL30R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL30R { bits } - } - #[doc = "Bits 24:31 - Interrupt Selection For 31st Interrupt."] - #[inline] - pub fn intsel31(&self) -> INTSEL31R { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - INTSEL31R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Interrupt Selection For 28th Interrupt."] - #[inline] - pub fn intsel28(&mut self) -> _INTSEL28W { - _INTSEL28W { w: self } - } - #[doc = "Bits 8:15 - Interrupt Selection For 29th Interrupt."] - #[inline] - pub fn intsel29(&mut self) -> _INTSEL29W { - _INTSEL29W { w: self } - } - #[doc = "Bits 16:23 - Interrupt Selection For 30th Interrupt."] - #[inline] - pub fn intsel30(&mut self) -> _INTSEL30W { - _INTSEL30W { w: self } - } - #[doc = "Bits 24:31 - Interrupt Selection For 31st Interrupt."] - #[inline] - pub fn intsel31(&mut self) -> _INTSEL31W { - _INTSEL31W { w: self } - } - } - } - #[doc = "Configurable starting IP address for Q30E."] - pub struct IP_ADDR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Configurable starting IP address for Q30E."] - pub mod ip_addr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IP_ADDR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct START_IP_ADDRR { - bits: u32, - } - impl START_IP_ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _START_IP_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _START_IP_ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Starting IP address for Q30E"] - #[inline] - pub fn start_ip_addr(&self) -> START_IP_ADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - START_IP_ADDRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Starting IP address for Q30E"] - #[inline] - pub fn start_ip_addr(&mut self) -> _START_IP_ADDRW { - _START_IP_ADDRW { w: self } - } - } - } - #[doc = "Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENR { - #[doc = "Disable SDMA."] - DIS, - #[doc = "Enable SDMA."] - EN, - } - impl ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ENR::DIS => false, - ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ENR { - match value { - false => ENR::DIS, - true => ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ENR::EN - } - } - #[doc = "Values that can be written to the field `EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENW { - #[doc = "Disable SDMA."] - DIS, - #[doc = "Enable SDMA."] - EN, - } - impl ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ENW::DIS => false, - ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ENW<'a> { - w: &'a mut W, - } - impl<'a> _ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable SDMA."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ENW::DIS) - } - #[doc = "Enable SDMA."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Enable SDMA."] - #[inline] - pub fn en(&self) -> ENR { - ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable SDMA."] - #[inline] - pub fn en(&mut self) -> _ENW { - _ENW { w: self } - } - } - } - #[doc = "Interrupt Input From CPU Control Register."] - pub struct INT_IN_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Input From CPU Control Register."] - pub mod int_in_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_IN_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `INTSET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTSETR { - #[doc = "Set interrupt Flag to 0."] - DIS, - #[doc = "Set Interrupt Flag to 1."] - SET, - } - impl INTSETR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INTSETR::DIS => false, - INTSETR::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INTSETR { - match value { - false => INTSETR::DIS, - true => INTSETR::SET, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == INTSETR::DIS - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == INTSETR::SET - } - } - #[doc = "Values that can be written to the field `INTSET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTSETW { - #[doc = "Set interrupt Flag to 0."] - DIS, - #[doc = "Set Interrupt Flag to 1."] - SET, - } - impl INTSETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INTSETW::DIS => false, - INTSETW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INTSETW<'a> { - w: &'a mut W, - } - impl<'a> _INTSETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INTSETW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Set interrupt Flag to 0."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(INTSETW::DIS) - } - #[doc = "Set Interrupt Flag to 1."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(INTSETW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Set Interrupt Flag."] - #[inline] - pub fn intset(&self) -> INTSETR { - INTSETR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Set Interrupt Flag."] - #[inline] - pub fn intset(&mut self) -> _INTSETW { - _INTSETW { w: self } - } - } - } - #[doc = "Interrupt Input From CPU Flag."] - pub struct INT_IN_FLAG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Input From CPU Flag."] - pub mod int_in_flag { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_IN_FLAG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `INTFLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTFLAGR { - #[doc = "No Effect."] - NO_EFF, - #[doc = "INT_IN_FLAG =0"] - CLEAR, - } - impl INTFLAGR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INTFLAGR::NO_EFF => false, - INTFLAGR::CLEAR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INTFLAGR { - match value { - false => INTFLAGR::NO_EFF, - true => INTFLAGR::CLEAR, - } - } - #[doc = "Checks if the value of the field is `NO_EFF`"] - #[inline] - pub fn is_no_eff(&self) -> bool { - *self == INTFLAGR::NO_EFF - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == INTFLAGR::CLEAR - } - } - #[doc = "Values that can be written to the field `INTFLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTFLAGW { - #[doc = "No Effect."] - NO_EFF, - #[doc = "INT_IN_FLAG =0"] - CLEAR, - } - impl INTFLAGW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INTFLAGW::NO_EFF => false, - INTFLAGW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INTFLAGW<'a> { - w: &'a mut W, - } - impl<'a> _INTFLAGW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INTFLAGW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Effect."] - #[inline] - pub fn no_eff(self) -> &'a mut W { - self.variant(INTFLAGW::NO_EFF) - } - #[doc = "INT_IN_FLAG =0"] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(INTFLAGW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Interrupt Flag."] - #[inline] - pub fn intflag(&self) -> INTFLAGR { - INTFLAGR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Interrupt Flag."] - #[inline] - pub fn intflag(&mut self) -> _INTFLAGW { - _INTFLAGW { w: self } - } - } - } - #[doc = "Interrupt Input From CPU Enable."] - pub struct INT_IN_IE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Input From CPU Enable."] - pub mod int_in_ie { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_IN_IE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INT_IN_ENR { - bits: bool, - } - impl INT_IN_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _INT_IN_ENW<'a> { - w: &'a mut W, - } - impl<'a> _INT_IN_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Interrupt Enable."] - #[inline] - pub fn int_in_en(&self) -> INT_IN_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - INT_IN_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Interrupt Enable."] - #[inline] - pub fn int_in_en(&mut self) -> _INT_IN_ENW { - _INT_IN_ENW { w: self } - } - } - } - #[doc = "Interrupt Output To CPU Flag."] - pub struct IRQ_FLAG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Output To CPU Flag."] - pub mod irq_flag { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IRQ_FLAG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IRQ_FLAGR { - bits: bool, - } - impl IRQ_FLAGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _IRQ_FLAGW<'a> { - w: &'a mut W, - } - impl<'a> _IRQ_FLAGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Interrupt Flag."] - #[inline] - pub fn irq_flag(&self) -> IRQ_FLAGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IRQ_FLAGR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Interrupt Flag."] - #[inline] - pub fn irq_flag(&mut self) -> _IRQ_FLAGW { - _IRQ_FLAGW { w: self } - } - } - } - #[doc = "Interrupt Output To CPU Control Register."] - pub struct IRQ_IE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Output To CPU Control Register."] - pub mod irq_ie { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IRQ_IE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IRQ_ENR { - bits: bool, - } - impl IRQ_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _IRQ_ENW<'a> { - w: &'a mut W, - } - impl<'a> _IRQ_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Interrupt Enable."] - #[inline] - pub fn irq_en(&self) -> IRQ_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IRQ_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Interrupt Enable."] - #[inline] - pub fn irq_en(&mut self) -> _IRQ_ENW { - _IRQ_ENW { w: self } - } - } - } -} -#[doc = "The Semaphore peripheral allows multiple cores in a system to cooperate when accessing shred resources. The peripheral contains eight semaphores that can be atomically set and cleared. It is left to the discretion of the software architect to decide how and when the semaphores are used and how they are allocated. Existing hardware does not have to be modified for this type of cooperative sharing, and the use of semaphores is exclusively within the software domain."] -pub struct SEMA { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SEMA {} -impl SEMA { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const sema::RegisterBlock { - 0x4003_e000 as *const _ - } -} -impl Deref for SEMA { - type Target = sema::RegisterBlock; - fn deref(&self) -> &sema::RegisterBlock { - unsafe { &*SEMA::ptr() } - } -} -#[doc = "The Semaphore peripheral allows multiple cores in a system to cooperate when accessing shred resources. The peripheral contains eight semaphores that can be atomically set and cleared. It is left to the discretion of the software architect to decide how and when the semaphores are used and how they are allocated. Existing hardware does not have to be modified for this type of cooperative sharing, and the use of semaphores is exclusively within the software domain."] -pub mod sema { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Read to test and set, returns prior value. Write 0 to clear semaphore."] - pub semaphores: [SEMAPHORES; 8], - _reserved0: [u8; 224usize], - #[doc = "0x100 - Semaphore status bits. 0 indicates the semaphore is free, 1 indicates taken."] - pub status: STATUS, - } - #[doc = "Read to test and set, returns prior value. Write 0 to clear semaphore."] - pub struct SEMAPHORES { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read to test and set, returns prior value. Write 0 to clear semaphore."] - pub mod semaphores { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SEMAPHORES { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SEMAR { - bits: bool, - } - impl SEMAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SEMAW<'a> { - w: &'a mut W, - } - impl<'a> _SEMAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0"] - #[inline] - pub fn sema(&self) -> SEMAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SEMAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0"] - #[inline] - pub fn sema(&mut self) -> _SEMAW { - _SEMAW { w: self } - } - } - } - #[doc = "Semaphore status bits. 0 indicates the semaphore is free, 1 indicates taken."] - pub struct STATUS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Semaphore status bits. 0 indicates the semaphore is free, 1 indicates taken."] - pub mod status { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::STATUS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct STATUSR { - bits: u8, - } - impl STATUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _STATUSW<'a> { - w: &'a mut W, - } - impl<'a> _STATUSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7"] - #[inline] - pub fn status(&self) -> STATUSR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - STATUSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7"] - #[inline] - pub fn status(&mut self) -> _STATUSW { - _STATUSW { w: self } - } - } - } -} -#[doc = "Single Inductor Multiple Output Switching Converter"] -pub struct SIMO { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SIMO {} -impl SIMO { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const simo::RegisterBlock { - 0x4000_4400 as *const _ - } -} -impl Deref for SIMO { - type Target = simo::RegisterBlock; - fn deref(&self) -> &simo::RegisterBlock { - unsafe { &*SIMO::ptr() } - } -} -#[doc = "Single Inductor Multiple Output Switching Converter"] -pub mod simo { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - _reserved0: [u8; 4usize], - #[doc = "0x04 - Buck Voltage Regulator A Control Register"] - pub vrego_a: VREGO_A, - #[doc = "0x08 - Buck Voltage Regulator B Control Register"] - pub vrego_b: VREGO_B, - #[doc = "0x0c - Buck Voltage Regulator C Control Register"] - pub vrego_c: VREGO_C, - #[doc = "0x10 - Buck Voltage Regulator D Control Register"] - pub vrego_d: VREGO_D, - #[doc = "0x14 - High Side FET Peak Current VREGO_A/VREGO_B Register"] - pub ipka: IPKA, - #[doc = "0x18 - High Side FET Peak Current VREGO_C/VREGO_D Register"] - pub ipkb: IPKB, - #[doc = "0x1c - Maximum High Side FET Time On Register"] - pub maxton: MAXTON, - #[doc = "0x20 - Buck Cycle Count VREGO_A Register"] - pub iload_a: ILOAD_A, - #[doc = "0x24 - Buck Cycle Count VREGO_B Register"] - pub iload_b: ILOAD_B, - #[doc = "0x28 - Buck Cycle Count VREGO_C Register"] - pub iload_c: ILOAD_C, - #[doc = "0x2c - Buck Cycle Count VREGO_D Register"] - pub iload_d: ILOAD_D, - #[doc = "0x30 - Buck Cycle Count Alert VERGO_A Register"] - pub buck_alert_thr_a: BUCK_ALERT_THR_A, - #[doc = "0x34 - Buck Cycle Count Alert VERGO_B Register"] - pub buck_alert_thr_b: BUCK_ALERT_THR_B, - #[doc = "0x38 - Buck Cycle Count Alert VERGO_C Register"] - pub buck_alert_thr_c: BUCK_ALERT_THR_C, - #[doc = "0x3c - Buck Cycle Count Alert VERGO_D Register"] - pub buck_alert_thr_d: BUCK_ALERT_THR_D, - #[doc = "0x40 - Buck Regulator Output Ready Register"] - pub buck_out_ready: BUCK_OUT_READY, - #[doc = "0x44 - Zero Cross Calibration VERGO_A Register"] - pub zero_cross_cal_a: ZERO_CROSS_CAL_A, - #[doc = "0x48 - Zero Cross Calibration VERGO_B Register"] - pub zero_cross_cal_b: ZERO_CROSS_CAL_B, - #[doc = "0x4c - Zero Cross Calibration VERGO_C Register"] - pub zero_cross_cal_c: ZERO_CROSS_CAL_C, - #[doc = "0x50 - Zero Cross Calibration VERGO_D Register"] - pub zero_cross_cal_d: ZERO_CROSS_CAL_D, - } - #[doc = "Buck Voltage Regulator A Control Register"] - pub struct VREGO_A { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Voltage Regulator A Control Register"] - pub mod vrego_a { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::VREGO_A { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VSETAR { - bits: u8, - } - impl VSETAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RANGEA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEAR { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RANGEAR::LOW => false, - RANGEAR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RANGEAR { - match value { - false => RANGEAR::LOW, - true => RANGEAR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == RANGEAR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == RANGEAR::HIGH - } - } - #[doc = r" Proxy"] - pub struct _VSETAW<'a> { - w: &'a mut W, - } - impl<'a> _VSETAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RANGEA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEAW { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RANGEAW::LOW => false, - RANGEAW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RANGEAW<'a> { - w: &'a mut W, - } - impl<'a> _RANGEAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RANGEAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low output voltage range"] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(RANGEAW::LOW) - } - #[doc = "High output voltage range"] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(RANGEAW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vseta(&self) -> VSETAR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - VSETAR { bits } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangea(&self) -> RANGEAR { - RANGEAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vseta(&mut self) -> _VSETAW { - _VSETAW { w: self } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangea(&mut self) -> _RANGEAW { - _RANGEAW { w: self } - } - } - } - #[doc = "Buck Voltage Regulator B Control Register"] - pub struct VREGO_B { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Voltage Regulator B Control Register"] - pub mod vrego_b { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::VREGO_B { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VSETBR { - bits: u8, - } - impl VSETBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RANGEB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEBR { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEBR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RANGEBR::LOW => false, - RANGEBR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RANGEBR { - match value { - false => RANGEBR::LOW, - true => RANGEBR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == RANGEBR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == RANGEBR::HIGH - } - } - #[doc = r" Proxy"] - pub struct _VSETBW<'a> { - w: &'a mut W, - } - impl<'a> _VSETBW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RANGEB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEBW { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEBW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RANGEBW::LOW => false, - RANGEBW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RANGEBW<'a> { - w: &'a mut W, - } - impl<'a> _RANGEBW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RANGEBW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low output voltage range"] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(RANGEBW::LOW) - } - #[doc = "High output voltage range"] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(RANGEBW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetb(&self) -> VSETBR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - VSETBR { bits } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangeb(&self) -> RANGEBR { - RANGEBR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetb(&mut self) -> _VSETBW { - _VSETBW { w: self } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangeb(&mut self) -> _RANGEBW { - _RANGEBW { w: self } - } - } - } - #[doc = "Buck Voltage Regulator C Control Register"] - pub struct VREGO_C { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Voltage Regulator C Control Register"] - pub mod vrego_c { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::VREGO_C { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VSETCR { - bits: u8, - } - impl VSETCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RANGEC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGECR { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGECR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RANGECR::LOW => false, - RANGECR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RANGECR { - match value { - false => RANGECR::LOW, - true => RANGECR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == RANGECR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == RANGECR::HIGH - } - } - #[doc = r" Proxy"] - pub struct _VSETCW<'a> { - w: &'a mut W, - } - impl<'a> _VSETCW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RANGEC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGECW { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGECW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RANGECW::LOW => false, - RANGECW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RANGECW<'a> { - w: &'a mut W, - } - impl<'a> _RANGECW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RANGECW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low output voltage range"] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(RANGECW::LOW) - } - #[doc = "High output voltage range"] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(RANGECW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetc(&self) -> VSETCR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - VSETCR { bits } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangec(&self) -> RANGECR { - RANGECR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetc(&mut self) -> _VSETCW { - _VSETCW { w: self } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn rangec(&mut self) -> _RANGECW { - _RANGECW { w: self } - } - } - } - #[doc = "Buck Voltage Regulator D Control Register"] - pub struct VREGO_D { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Voltage Regulator D Control Register"] - pub mod vrego_d { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::VREGO_D { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VSETDR { - bits: u8, - } - impl VSETDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RANGED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEDR { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RANGEDR::LOW => false, - RANGEDR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RANGEDR { - match value { - false => RANGEDR::LOW, - true => RANGEDR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == RANGEDR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == RANGEDR::HIGH - } - } - #[doc = r" Proxy"] - pub struct _VSETDW<'a> { - w: &'a mut W, - } - impl<'a> _VSETDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RANGED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RANGEDW { - #[doc = "Low output voltage range"] - LOW, - #[doc = "High output voltage range"] - HIGH, - } - impl RANGEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RANGEDW::LOW => false, - RANGEDW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RANGEDW<'a> { - w: &'a mut W, - } - impl<'a> _RANGEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RANGEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low output voltage range"] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(RANGEDW::LOW) - } - #[doc = "High output voltage range"] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(RANGEDW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetd(&self) -> VSETDR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - VSETDR { bits } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn ranged(&self) -> RANGEDR { - RANGEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Regulator Output Voltage Setting"] - #[inline] - pub fn vsetd(&mut self) -> _VSETDW { - _VSETDW { w: self } - } - #[doc = "Bit 7 - Regulator Output Range Set"] - #[inline] - pub fn ranged(&mut self) -> _RANGEDW { - _RANGEDW { w: self } - } - } - } - #[doc = "High Side FET Peak Current VREGO_A/VREGO_B Register"] - pub struct IPKA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "High Side FET Peak Current VREGO_A/VREGO_B Register"] - pub mod ipka { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IPKA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IPKSETAR { - bits: u8, - } - impl IPKSETAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct IPKSETBR { - bits: u8, - } - impl IPKSETBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _IPKSETAW<'a> { - w: &'a mut W, - } - impl<'a> _IPKSETAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IPKSETBW<'a> { - w: &'a mut W, - } - impl<'a> _IPKSETBW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipkseta(&self) -> IPKSETAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IPKSETAR { bits } - } - #[doc = "Bits 4:7 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetb(&self) -> IPKSETBR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IPKSETBR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipkseta(&mut self) -> _IPKSETAW { - _IPKSETAW { w: self } - } - #[doc = "Bits 4:7 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetb(&mut self) -> _IPKSETBW { - _IPKSETBW { w: self } - } - } - } - #[doc = "High Side FET Peak Current VREGO_C/VREGO_D Register"] - pub struct IPKB { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "High Side FET Peak Current VREGO_C/VREGO_D Register"] - pub mod ipkb { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IPKB { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IPKSETCR { - bits: u8, - } - impl IPKSETCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct IPKSETDR { - bits: u8, - } - impl IPKSETDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _IPKSETCW<'a> { - w: &'a mut W, - } - impl<'a> _IPKSETCW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IPKSETDW<'a> { - w: &'a mut W, - } - impl<'a> _IPKSETDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetc(&self) -> IPKSETCR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IPKSETCR { bits } - } - #[doc = "Bits 4:7 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetd(&self) -> IPKSETDR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IPKSETDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetc(&mut self) -> _IPKSETCW { - _IPKSETCW { w: self } - } - #[doc = "Bits 4:7 - Voltage Regulator Peak Current Setting"] - #[inline] - pub fn ipksetd(&mut self) -> _IPKSETDW { - _IPKSETDW { w: self } - } - } - } - #[doc = "Maximum High Side FET Time On Register"] - pub struct MAXTON { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Maximum High Side FET Time On Register"] - pub mod maxton { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MAXTON { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TONSETR { - bits: u8, - } - impl TONSETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TONSETW<'a> { - w: &'a mut W, - } - impl<'a> _TONSETW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Sets the maximum on time for the high side FET, each increment represents 500ns"] - #[inline] - pub fn tonset(&self) -> TONSETR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TONSETR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Sets the maximum on time for the high side FET, each increment represents 500ns"] - #[inline] - pub fn tonset(&mut self) -> _TONSETW { - _TONSETW { w: self } - } - } - } - #[doc = "Buck Cycle Count VREGO_A Register"] - pub struct ILOAD_A { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count VREGO_A Register"] - pub mod iload_a { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ILOAD_A { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ILOADAR { - bits: u8, - } - impl ILOADAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Number of buck cycles that occur within the cycle clock"] - #[inline] - pub fn iloada(&self) -> ILOADAR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ILOADAR { bits } - } - } - } - #[doc = "Buck Cycle Count VREGO_B Register"] - pub struct ILOAD_B { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count VREGO_B Register"] - pub mod iload_b { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ILOAD_B { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ILOADBR { - bits: u8, - } - impl ILOADBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Number of buck cycles that occur within the cycle clock"] - #[inline] - pub fn iloadb(&self) -> ILOADBR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ILOADBR { bits } - } - } - } - #[doc = "Buck Cycle Count VREGO_C Register"] - pub struct ILOAD_C { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count VREGO_C Register"] - pub mod iload_c { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ILOAD_C { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ILOADCR { - bits: u8, - } - impl ILOADCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Number of buck cycles that occur within the cycle clock"] - #[inline] - pub fn iloadc(&self) -> ILOADCR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ILOADCR { bits } - } - } - } - #[doc = "Buck Cycle Count VREGO_D Register"] - pub struct ILOAD_D { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count VREGO_D Register"] - pub mod iload_d { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ILOAD_D { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ILOADDR { - bits: u8, - } - impl ILOADDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Number of buck cycles that occur within the cycle clock"] - #[inline] - pub fn iloadd(&self) -> ILOADDR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ILOADDR { bits } - } - } - } - #[doc = "Buck Cycle Count Alert VERGO_A Register"] - pub struct BUCK_ALERT_THR_A { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count Alert VERGO_A Register"] - pub mod buck_alert_thr_a { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BUCK_ALERT_THR_A { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BUCKTHRAR { - bits: u8, - } - impl BUCKTHRAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BUCKTHRAW<'a> { - w: &'a mut W, - } - impl<'a> _BUCKTHRAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Threshold for ILOADA to generate the BUCK_ALERT"] - #[inline] - pub fn buckthra(&self) -> BUCKTHRAR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BUCKTHRAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Threshold for ILOADA to generate the BUCK_ALERT"] - #[inline] - pub fn buckthra(&mut self) -> _BUCKTHRAW { - _BUCKTHRAW { w: self } - } - } - } - #[doc = "Buck Cycle Count Alert VERGO_B Register"] - pub struct BUCK_ALERT_THR_B { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count Alert VERGO_B Register"] - pub mod buck_alert_thr_b { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BUCK_ALERT_THR_B { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BUCKTHRBR { - bits: u8, - } - impl BUCKTHRBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BUCKTHRBW<'a> { - w: &'a mut W, - } - impl<'a> _BUCKTHRBW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Threshold for ILOADB to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrb(&self) -> BUCKTHRBR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BUCKTHRBR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Threshold for ILOADB to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrb(&mut self) -> _BUCKTHRBW { - _BUCKTHRBW { w: self } - } - } - } - #[doc = "Buck Cycle Count Alert VERGO_C Register"] - pub struct BUCK_ALERT_THR_C { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count Alert VERGO_C Register"] - pub mod buck_alert_thr_c { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BUCK_ALERT_THR_C { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BUCKTHRCR { - bits: u8, - } - impl BUCKTHRCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BUCKTHRCW<'a> { - w: &'a mut W, - } - impl<'a> _BUCKTHRCW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Threshold for ILOADC to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrc(&self) -> BUCKTHRCR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BUCKTHRCR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Threshold for ILOADC to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrc(&mut self) -> _BUCKTHRCW { - _BUCKTHRCW { w: self } - } - } - } - #[doc = "Buck Cycle Count Alert VERGO_D Register"] - pub struct BUCK_ALERT_THR_D { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Cycle Count Alert VERGO_D Register"] - pub mod buck_alert_thr_d { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BUCK_ALERT_THR_D { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct BUCKTHRDR { - bits: u8, - } - impl BUCKTHRDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _BUCKTHRDW<'a> { - w: &'a mut W, - } - impl<'a> _BUCKTHRDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Threshold for ILOADD to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrd(&self) -> BUCKTHRDR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - BUCKTHRDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Threshold for ILOADD to generate the BUCK_ALERT"] - #[inline] - pub fn buckthrd(&mut self) -> _BUCKTHRDW { - _BUCKTHRDW { w: self } - } - } - } - #[doc = "Buck Regulator Output Ready Register"] - pub struct BUCK_OUT_READY { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Buck Regulator Output Ready Register"] - pub mod buck_out_ready { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::BUCK_OUT_READY { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `BUCKOUTRDYA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUCKOUTRDYAR { - #[doc = "Output voltage not in range"] - NOTRDY, - #[doc = "Output voltage in range"] - RDY, - } - impl BUCKOUTRDYAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUCKOUTRDYAR::NOTRDY => false, - BUCKOUTRDYAR::RDY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUCKOUTRDYAR { - match value { - false => BUCKOUTRDYAR::NOTRDY, - true => BUCKOUTRDYAR::RDY, - } - } - #[doc = "Checks if the value of the field is `NOTRDY`"] - #[inline] - pub fn is_notrdy(&self) -> bool { - *self == BUCKOUTRDYAR::NOTRDY - } - #[doc = "Checks if the value of the field is `RDY`"] - #[inline] - pub fn is_rdy(&self) -> bool { - *self == BUCKOUTRDYAR::RDY - } - } - #[doc = r" Value of the field"] - pub struct BUCKOUTRDYBR { - bits: bool, - } - impl BUCKOUTRDYBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUCKOUTRDYCR { - bits: bool, - } - impl BUCKOUTRDYCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BUCKOUTRDYDR { - bits: bool, - } - impl BUCKOUTRDYDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 3 - When set, indicates that the output voltage has reached its regulated value"] - #[inline] - pub fn buckoutrdya(&self) -> BUCKOUTRDYAR { - BUCKOUTRDYAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - When set, indicates that the output voltage has reached its regulated value"] - #[inline] - pub fn buckoutrdyb(&self) -> BUCKOUTRDYBR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BUCKOUTRDYBR { bits } - } - #[doc = "Bit 1 - When set, indicates that the output voltage has reached its regulated value"] - #[inline] - pub fn buckoutrdyc(&self) -> BUCKOUTRDYCR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BUCKOUTRDYCR { bits } - } - #[doc = "Bit 0 - When set, indicates that the output voltage has reached its regulated value"] - #[inline] - pub fn buckoutrdyd(&self) -> BUCKOUTRDYDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BUCKOUTRDYDR { bits } - } - } - } - #[doc = "Zero Cross Calibration VERGO_A Register"] - pub struct ZERO_CROSS_CAL_A { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Zero Cross Calibration VERGO_A Register"] - pub mod zero_cross_cal_a { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ZERO_CROSS_CAL_A { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ZXCLAR { - bits: u8, - } - impl ZXCLAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Zero Cross Calibrartion Value VREGO_A"] - #[inline] - pub fn zxcla(&self) -> ZXCLAR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ZXCLAR { bits } - } - } - } - #[doc = "Zero Cross Calibration VERGO_B Register"] - pub struct ZERO_CROSS_CAL_B { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Zero Cross Calibration VERGO_B Register"] - pub mod zero_cross_cal_b { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ZERO_CROSS_CAL_B { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ZXCLBR { - bits: u8, - } - impl ZXCLBR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Zero Cross Calibrartion Value VREGO_B"] - #[inline] - pub fn zxclb(&self) -> ZXCLBR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ZXCLBR { bits } - } - } - } - #[doc = "Zero Cross Calibration VERGO_C Register"] - pub struct ZERO_CROSS_CAL_C { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Zero Cross Calibration VERGO_C Register"] - pub mod zero_cross_cal_c { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ZERO_CROSS_CAL_C { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ZXCLCR { - bits: u8, - } - impl ZXCLCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Zero Cross Calibrartion Value VREGO_C"] - #[inline] - pub fn zxclc(&self) -> ZXCLCR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ZXCLCR { bits } - } - } - } - #[doc = "Zero Cross Calibration VERGO_D Register"] - pub struct ZERO_CROSS_CAL_D { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Zero Cross Calibration VERGO_D Register"] - pub mod zero_cross_cal_d { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ZERO_CROSS_CAL_D { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ZXCLDR { - bits: u8, - } - impl ZXCLDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Zero Cross Calibrartion Value VREGO_D"] - #[inline] - pub fn zxcld(&self) -> ZXCLDR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - ZXCLDR { bits } - } - } - } -} -#[doc = "System Initialization Registers."] -pub struct SIR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SIR {} -impl SIR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const sir::RegisterBlock { - 0x4000_0400 as *const _ - } -} -impl Deref for SIR { - type Target = sir::RegisterBlock; - fn deref(&self) -> &sir::RegisterBlock { - unsafe { &*SIR::ptr() } - } -} -#[doc = "System Initialization Registers."] -pub mod sir { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - System Initialization Status Register."] - pub sistat: SISTAT, - #[doc = "0x04 - Read-only field set by the SIB block if a CRC error occurs during the read of the OTP memory. Contains the failing address in OTP memory (when CRCERR equals 1)."] - pub erraddr: ERRADDR, - _reserved0: [u8; 248usize], - #[doc = "0x100 - funcstat register."] - pub fstat: FSTAT, - #[doc = "0x104 - secfuncstat register."] - pub sfstat: SFSTAT, - } - #[doc = "System Initialization Status Register."] - pub struct SISTAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "System Initialization Status Register."] - pub mod sistat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SISTAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `MAGIC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MAGICR { - #[doc = "Magic word was not set (OTP has not been initialized properly)."] - MAGICNOTSET, - #[doc = "Magic word was set (OTP contains valid settings)."] - MAGICSET, - } - impl MAGICR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MAGICR::MAGICNOTSET => false, - MAGICR::MAGICSET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MAGICR { - match value { - false => MAGICR::MAGICNOTSET, - true => MAGICR::MAGICSET, - } - } - #[doc = "Checks if the value of the field is `MAGICNOTSET`"] - #[inline] - pub fn is_magic_not_set(&self) -> bool { - *self == MAGICR::MAGICNOTSET - } - #[doc = "Checks if the value of the field is `MAGICSET`"] - #[inline] - pub fn is_magic_set(&self) -> bool { - *self == MAGICR::MAGICSET - } - } - #[doc = "Possible values of the field `CRCERR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CRCERRR { - #[doc = "No CRC errors occurred during the read of the OTP memory block."] - NOERROR, - #[doc = "A CRC error occurred while reading the OTP. The address of the failure location in the OTP memory is stored in the ERRADDR register."] - ERROR, - } - impl CRCERRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CRCERRR::NOERROR => false, - CRCERRR::ERROR => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CRCERRR { - match value { - false => CRCERRR::NOERROR, - true => CRCERRR::ERROR, - } - } - #[doc = "Checks if the value of the field is `NOERROR`"] - #[inline] - pub fn is_no_error(&self) -> bool { - *self == CRCERRR::NOERROR - } - #[doc = "Checks if the value of the field is `ERROR`"] - #[inline] - pub fn is_error(&self) -> bool { - *self == CRCERRR::ERROR - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Magic Word Validation. This bit is set by the system initialization block following power-up."] - #[inline] - pub fn magic(&self) -> MAGICR { - MAGICR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - CRC Error Status. This bit is set by the system initialization block following power-up."] - #[inline] - pub fn crcerr(&self) -> CRCERRR { - CRCERRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } - #[doc = "Read-only field set by the SIB block if a CRC error occurs during the read of the OTP memory. Contains the failing address in OTP memory (when CRCERR equals 1)."] - pub struct ERRADDR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read-only field set by the SIB block if a CRC error occurs during the read of the OTP memory. Contains the failing address in OTP memory (when CRCERR equals 1)."] - pub mod erraddr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ERRADDR { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct ERRADDRR { - bits: u32, - } - impl ERRADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31"] - #[inline] - pub fn erraddr(&self) -> ERRADDRR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - ERRADDRR { bits } - } - } - } - #[doc = "funcstat register."] - pub struct FSTAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "funcstat register."] - pub mod fstat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::FSTAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `FPU`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FPUR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl FPUR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FPUR::NO => false, - FPUR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FPUR { - match value { - false => FPUR::NO, - true => FPUR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == FPUR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == FPUR::YES - } - } - #[doc = "Possible values of the field `USB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum USBR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl USBR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - USBR::NO => false, - USBR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> USBR { - match value { - false => USBR::NO, - true => USBR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == USBR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == USBR::YES - } - } - #[doc = "Possible values of the field `ADC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADCR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl ADCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ADCR::NO => false, - ADCR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ADCR { - match value { - false => ADCR::NO, - true => ADCR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == ADCR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == ADCR::YES - } - } - #[doc = "Possible values of the field `XIP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum XIPR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl XIPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - XIPR::NO => false, - XIPR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> XIPR { - match value { - false => XIPR::NO, - true => XIPR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == XIPR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == XIPR::YES - } - } - #[doc = "Possible values of the field `PBM`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PBMR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl PBMR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PBMR::NO => false, - PBMR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PBMR { - match value { - false => PBMR::NO, - true => PBMR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == PBMR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == PBMR::YES - } - } - #[doc = "Possible values of the field `HBC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HBCR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl HBCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HBCR::NO => false, - HBCR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HBCR { - match value { - false => HBCR::NO, - true => HBCR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == HBCR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == HBCR::YES - } - } - #[doc = "Possible values of the field `SDHC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDHCR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl SDHCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDHCR::NO => false, - SDHCR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDHCR { - match value { - false => SDHCR::NO, - true => SDHCR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == SDHCR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == SDHCR::YES - } - } - #[doc = "Possible values of the field `SMPHR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SMPHRR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl SMPHRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SMPHRR::NO => false, - SMPHRR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SMPHRR { - match value { - false => SMPHRR::NO, - true => SMPHRR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == SMPHRR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == SMPHRR::YES - } - } - #[doc = "Possible values of the field `SCACHE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCACHER { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl SCACHER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCACHER::NO => false, - SCACHER::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCACHER { - match value { - false => SCACHER::NO, - true => SCACHER::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == SCACHER::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == SCACHER::YES - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - FPU Function."] - #[inline] - pub fn fpu(&self) -> FPUR { - FPUR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - USB Device."] - #[inline] - pub fn usb(&self) -> USBR { - USBR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - 10-bit Sigma Delta ADC."] - #[inline] - pub fn adc(&self) -> ADCR { - ADCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - XiP function."] - #[inline] - pub fn xip(&self) -> XIPR { - XIPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - PBM function."] - #[inline] - pub fn pbm(&self) -> PBMR { - PBMR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - HBC function."] - #[inline] - pub fn hbc(&self) -> HBCR { - HBCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - SDHC function."] - #[inline] - pub fn sdhc(&self) -> SDHCR { - SDHCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - SMPHR function."] - #[inline] - pub fn smphr(&self) -> SMPHRR { - SMPHRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - System Cache function."] - #[inline] - pub fn scache(&self) -> SCACHER { - SCACHER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } - #[doc = "secfuncstat register."] - pub struct SFSTAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "secfuncstat register."] - pub mod sfstat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SFSTAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `TRNG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TRNGR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl TRNGR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TRNGR::NO => false, - TRNGR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TRNGR { - match value { - false => TRNGR::NO, - true => TRNGR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == TRNGR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == TRNGR::YES - } - } - #[doc = "Possible values of the field `AES`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AESR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl AESR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AESR::NO => false, - AESR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AESR { - match value { - false => AESR::NO, - true => AESR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == AESR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == AESR::YES - } - } - #[doc = "Possible values of the field `SHA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHAR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl SHAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SHAR::NO => false, - SHAR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SHAR { - match value { - false => SHAR::NO, - true => SHAR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == SHAR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == SHAR::YES - } - } - #[doc = "Possible values of the field `MAA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MAAR { - #[doc = "undocumented"] - NO, - #[doc = "undocumented"] - YES, - } - impl MAAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MAAR::NO => false, - MAAR::YES => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MAAR { - match value { - false => MAAR::NO, - true => MAAR::YES, - } - } - #[doc = "Checks if the value of the field is `NO`"] - #[inline] - pub fn is_no(&self) -> bool { - *self == MAAR::NO - } - #[doc = "Checks if the value of the field is `YES`"] - #[inline] - pub fn is_yes(&self) -> bool { - *self == MAAR::YES - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 2 - TRNG function."] - #[inline] - pub fn trng(&self) -> TRNGR { - TRNGR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - AES function."] - #[inline] - pub fn aes(&self) -> AESR { - AESR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - SHA function."] - #[inline] - pub fn sha(&self) -> SHAR { - SHAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - MAA function."] - #[inline] - pub fn maa(&self) -> MAAR { - MAAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } -} -#[doc = "The Security Monitor block used to monitor system threat conditions."] -pub struct SMON { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SMON {} -impl SMON { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const smon::RegisterBlock { - 0x4000_4000 as *const _ - } -} -impl Deref for SMON { - type Target = smon::RegisterBlock; - fn deref(&self) -> &smon::RegisterBlock { - unsafe { &*SMON::ptr() } - } -} -#[doc = "The Security Monitor block used to monitor system threat conditions."] -pub mod smon { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - External Sensor Control Register."] - pub extscn: EXTSCN, - #[doc = "0x04 - Internal Sensor Control Register."] - pub intscn: INTSCN, - #[doc = "0x08 - Security Alarm Register."] - pub secalm: SECALM, - #[doc = "0x0c - Security Diagnostic Register."] - pub secdiag: SECDIAG, - #[doc = "0x10 - DRS Log RTC Value. This register contains the 32 bit value in the RTC second register when the last DRS event occurred."] - pub dlrtc: DLRTC, - _reserved0: [u8; 32usize], - #[doc = "0x34 - Security Monitor Status Register."] - pub secst: SECST, - } - #[doc = "External Sensor Control Register."] - pub struct EXTSCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "External Sensor Control Register."] - pub mod extscn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::EXTSCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `EXTS_EN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN0R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN0R::DIS => false, - EXTS_EN0R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN0R { - match value { - false => EXTS_EN0R::DIS, - true => EXTS_EN0R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN0R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN0R::EN - } - } - #[doc = "Possible values of the field `EXTS_EN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN1R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN1R::DIS => false, - EXTS_EN1R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN1R { - match value { - false => EXTS_EN1R::DIS, - true => EXTS_EN1R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN1R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN1R::EN - } - } - #[doc = "Possible values of the field `EXTS_EN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN2R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN2R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN2R::DIS => false, - EXTS_EN2R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN2R { - match value { - false => EXTS_EN2R::DIS, - true => EXTS_EN2R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN2R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN2R::EN - } - } - #[doc = "Possible values of the field `EXTS_EN3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN3R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN3R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN3R::DIS => false, - EXTS_EN3R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN3R { - match value { - false => EXTS_EN3R::DIS, - true => EXTS_EN3R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN3R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN3R::EN - } - } - #[doc = "Possible values of the field `EXTS_EN4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN4R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN4R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN4R::DIS => false, - EXTS_EN4R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN4R { - match value { - false => EXTS_EN4R::DIS, - true => EXTS_EN4R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN4R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN4R::EN - } - } - #[doc = "Possible values of the field `EXTS_EN5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN5R { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN5R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTS_EN5R::DIS => false, - EXTS_EN5R::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTS_EN5R { - match value { - false => EXTS_EN5R::DIS, - true => EXTS_EN5R::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == EXTS_EN5R::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == EXTS_EN5R::EN - } - } - #[doc = r" Value of the field"] - pub struct EXTCNTR { - bits: u8, - } - impl EXTCNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `EXTFRQ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTFRQR { - #[doc = "Div 4 (2000Hz)."] - FREQ2000HZ, - #[doc = "Div 8 (1000Hz)."] - FREQ1000HZ, - #[doc = "Div 16 (500Hz)."] - FREQ500HZ, - #[doc = "Div 32 (250Hz)."] - FREQ250HZ, - #[doc = "Div 64 (125Hz)."] - FREQ125HZ, - #[doc = "Div 128 (63Hz)."] - FREQ63HZ, - #[doc = "Div 256 (31Hz)."] - FREQ31HZ, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl EXTFRQR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - EXTFRQR::FREQ2000HZ => 0, - EXTFRQR::FREQ1000HZ => 0x01, - EXTFRQR::FREQ500HZ => 0x02, - EXTFRQR::FREQ250HZ => 0x03, - EXTFRQR::FREQ125HZ => 0x04, - EXTFRQR::FREQ63HZ => 0x05, - EXTFRQR::FREQ31HZ => 0x06, - EXTFRQR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> EXTFRQR { - match value { - 0 => EXTFRQR::FREQ2000HZ, - 1 => EXTFRQR::FREQ1000HZ, - 2 => EXTFRQR::FREQ500HZ, - 3 => EXTFRQR::FREQ250HZ, - 4 => EXTFRQR::FREQ125HZ, - 5 => EXTFRQR::FREQ63HZ, - 6 => EXTFRQR::FREQ31HZ, - i => EXTFRQR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `FREQ2000HZ`"] - #[inline] - pub fn is_freq2000hz(&self) -> bool { - *self == EXTFRQR::FREQ2000HZ - } - #[doc = "Checks if the value of the field is `FREQ1000HZ`"] - #[inline] - pub fn is_freq1000hz(&self) -> bool { - *self == EXTFRQR::FREQ1000HZ - } - #[doc = "Checks if the value of the field is `FREQ500HZ`"] - #[inline] - pub fn is_freq500hz(&self) -> bool { - *self == EXTFRQR::FREQ500HZ - } - #[doc = "Checks if the value of the field is `FREQ250HZ`"] - #[inline] - pub fn is_freq250hz(&self) -> bool { - *self == EXTFRQR::FREQ250HZ - } - #[doc = "Checks if the value of the field is `FREQ125HZ`"] - #[inline] - pub fn is_freq125hz(&self) -> bool { - *self == EXTFRQR::FREQ125HZ - } - #[doc = "Checks if the value of the field is `FREQ63HZ`"] - #[inline] - pub fn is_freq63hz(&self) -> bool { - *self == EXTFRQR::FREQ63HZ - } - #[doc = "Checks if the value of the field is `FREQ31HZ`"] - #[inline] - pub fn is_freq31hz(&self) -> bool { - *self == EXTFRQR::FREQ31HZ - } - } - #[doc = "Possible values of the field `DIVCLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DIVCLKR { - #[doc = "Divide by 1 (8000 Hz)."] - DIV1, - #[doc = "Divide by 2 (4000 Hz)."] - DIV2, - #[doc = "Divide by 4 (2000 Hz)."] - DIV4, - #[doc = "Divide by 8 (1000 Hz)."] - DIV8, - #[doc = "Divide by 16 (500 Hz)."] - DIV16, - #[doc = "Divide by 32 (250 Hz)."] - DIV32, - #[doc = "Divide by 64 (125 Hz)."] - DIV64, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl DIVCLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - DIVCLKR::DIV1 => 0, - DIVCLKR::DIV2 => 0x01, - DIVCLKR::DIV4 => 0x02, - DIVCLKR::DIV8 => 0x03, - DIVCLKR::DIV16 => 0x04, - DIVCLKR::DIV32 => 0x05, - DIVCLKR::DIV64 => 0x06, - DIVCLKR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> DIVCLKR { - match value { - 0 => DIVCLKR::DIV1, - 1 => DIVCLKR::DIV2, - 2 => DIVCLKR::DIV4, - 3 => DIVCLKR::DIV8, - 4 => DIVCLKR::DIV16, - 5 => DIVCLKR::DIV32, - 6 => DIVCLKR::DIV64, - i => DIVCLKR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIV1`"] - #[inline] - pub fn is_div1(&self) -> bool { - *self == DIVCLKR::DIV1 - } - #[doc = "Checks if the value of the field is `DIV2`"] - #[inline] - pub fn is_div2(&self) -> bool { - *self == DIVCLKR::DIV2 - } - #[doc = "Checks if the value of the field is `DIV4`"] - #[inline] - pub fn is_div4(&self) -> bool { - *self == DIVCLKR::DIV4 - } - #[doc = "Checks if the value of the field is `DIV8`"] - #[inline] - pub fn is_div8(&self) -> bool { - *self == DIVCLKR::DIV8 - } - #[doc = "Checks if the value of the field is `DIV16`"] - #[inline] - pub fn is_div16(&self) -> bool { - *self == DIVCLKR::DIV16 - } - #[doc = "Checks if the value of the field is `DIV32`"] - #[inline] - pub fn is_div32(&self) -> bool { - *self == DIVCLKR::DIV32 - } - #[doc = "Checks if the value of the field is `DIV64`"] - #[inline] - pub fn is_div64(&self) -> bool { - *self == DIVCLKR::DIV64 - } - } - #[doc = "Possible values of the field `BUSY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSYR { - #[doc = "Idle."] - IDLE, - #[doc = "Update in Progress."] - BUSY, - } - impl BUSYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSYR::IDLE => false, - BUSYR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSYR { - match value { - false => BUSYR::IDLE, - true => BUSYR::BUSY, - } - } - #[doc = "Checks if the value of the field is `IDLE`"] - #[inline] - pub fn is_idle(&self) -> bool { - *self == BUSYR::IDLE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == BUSYR::BUSY - } - } - #[doc = "Possible values of the field `LOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOCKR { - #[doc = "Unlocked."] - UNLOCKED, - #[doc = "Locked."] - LOCKED, - } - impl LOCKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LOCKR::UNLOCKED => false, - LOCKR::LOCKED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LOCKR { - match value { - false => LOCKR::UNLOCKED, - true => LOCKR::LOCKED, - } - } - #[doc = "Checks if the value of the field is `UNLOCKED`"] - #[inline] - pub fn is_unlocked(&self) -> bool { - *self == LOCKR::UNLOCKED - } - #[doc = "Checks if the value of the field is `LOCKED`"] - #[inline] - pub fn is_locked(&self) -> bool { - *self == LOCKR::LOCKED - } - } - #[doc = "Values that can be written to the field `EXTS_EN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN0W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN0W::DIS => false, - EXTS_EN0W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN0W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN0W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN0W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTS_EN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN1W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN1W::DIS => false, - EXTS_EN1W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN1W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN1W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN1W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTS_EN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN2W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN2W::DIS => false, - EXTS_EN2W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN2W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN2W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN2W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN2W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTS_EN3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN3W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN3W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN3W::DIS => false, - EXTS_EN3W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN3W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN3W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN3W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN3W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN3W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTS_EN4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN4W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN4W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN4W::DIS => false, - EXTS_EN4W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN4W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN4W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN4W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN4W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN4W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTS_EN5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTS_EN5W { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl EXTS_EN5W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTS_EN5W::DIS => false, - EXTS_EN5W::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTS_EN5W<'a> { - w: &'a mut W, - } - impl<'a> _EXTS_EN5W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTS_EN5W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(EXTS_EN5W::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(EXTS_EN5W::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EXTCNTW<'a> { - w: &'a mut W, - } - impl<'a> _EXTCNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTFRQ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTFRQW { - #[doc = "Div 4 (2000Hz)."] - FREQ2000HZ, - #[doc = "Div 8 (1000Hz)."] - FREQ1000HZ, - #[doc = "Div 16 (500Hz)."] - FREQ500HZ, - #[doc = "Div 32 (250Hz)."] - FREQ250HZ, - #[doc = "Div 64 (125Hz)."] - FREQ125HZ, - #[doc = "Div 128 (63Hz)."] - FREQ63HZ, - #[doc = "Div 256 (31Hz)."] - FREQ31HZ, - } - impl EXTFRQW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - EXTFRQW::FREQ2000HZ => 0, - EXTFRQW::FREQ1000HZ => 1, - EXTFRQW::FREQ500HZ => 2, - EXTFRQW::FREQ250HZ => 3, - EXTFRQW::FREQ125HZ => 4, - EXTFRQW::FREQ63HZ => 5, - EXTFRQW::FREQ31HZ => 6, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTFRQW<'a> { - w: &'a mut W, - } - impl<'a> _EXTFRQW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTFRQW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Div 4 (2000Hz)."] - #[inline] - pub fn freq2000hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ2000HZ) - } - #[doc = "Div 8 (1000Hz)."] - #[inline] - pub fn freq1000hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ1000HZ) - } - #[doc = "Div 16 (500Hz)."] - #[inline] - pub fn freq500hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ500HZ) - } - #[doc = "Div 32 (250Hz)."] - #[inline] - pub fn freq250hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ250HZ) - } - #[doc = "Div 64 (125Hz)."] - #[inline] - pub fn freq125hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ125HZ) - } - #[doc = "Div 128 (63Hz)."] - #[inline] - pub fn freq63hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ63HZ) - } - #[doc = "Div 256 (31Hz)."] - #[inline] - pub fn freq31hz(self) -> &'a mut W { - self.variant(EXTFRQW::FREQ31HZ) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DIVCLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DIVCLKW { - #[doc = "Divide by 1 (8000 Hz)."] - DIV1, - #[doc = "Divide by 2 (4000 Hz)."] - DIV2, - #[doc = "Divide by 4 (2000 Hz)."] - DIV4, - #[doc = "Divide by 8 (1000 Hz)."] - DIV8, - #[doc = "Divide by 16 (500 Hz)."] - DIV16, - #[doc = "Divide by 32 (250 Hz)."] - DIV32, - #[doc = "Divide by 64 (125 Hz)."] - DIV64, - } - impl DIVCLKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - DIVCLKW::DIV1 => 0, - DIVCLKW::DIV2 => 1, - DIVCLKW::DIV4 => 2, - DIVCLKW::DIV8 => 3, - DIVCLKW::DIV16 => 4, - DIVCLKW::DIV32 => 5, - DIVCLKW::DIV64 => 6, - } - } - } - #[doc = r" Proxy"] - pub struct _DIVCLKW<'a> { - w: &'a mut W, - } - impl<'a> _DIVCLKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DIVCLKW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Divide by 1 (8000 Hz)."] - #[inline] - pub fn div1(self) -> &'a mut W { - self.variant(DIVCLKW::DIV1) - } - #[doc = "Divide by 2 (4000 Hz)."] - #[inline] - pub fn div2(self) -> &'a mut W { - self.variant(DIVCLKW::DIV2) - } - #[doc = "Divide by 4 (2000 Hz)."] - #[inline] - pub fn div4(self) -> &'a mut W { - self.variant(DIVCLKW::DIV4) - } - #[doc = "Divide by 8 (1000 Hz)."] - #[inline] - pub fn div8(self) -> &'a mut W { - self.variant(DIVCLKW::DIV8) - } - #[doc = "Divide by 16 (500 Hz)."] - #[inline] - pub fn div16(self) -> &'a mut W { - self.variant(DIVCLKW::DIV16) - } - #[doc = "Divide by 32 (250 Hz)."] - #[inline] - pub fn div32(self) -> &'a mut W { - self.variant(DIVCLKW::DIV32) - } - #[doc = "Divide by 64 (125 Hz)."] - #[inline] - pub fn div64(self) -> &'a mut W { - self.variant(DIVCLKW::DIV64) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOCKW { - #[doc = "Unlocked."] - UNLOCKED, - #[doc = "Locked."] - LOCKED, - } - impl LOCKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LOCKW::UNLOCKED => false, - LOCKW::LOCKED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LOCKW<'a> { - w: &'a mut W, - } - impl<'a> _LOCKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOCKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Unlocked."] - #[inline] - pub fn unlocked(self) -> &'a mut W { - self.variant(LOCKW::UNLOCKED) - } - #[doc = "Locked."] - #[inline] - pub fn locked(self) -> &'a mut W { - self.variant(LOCKW::LOCKED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - External Sensor Enable for input/output pair 0."] - #[inline] - pub fn exts_en0(&self) -> EXTS_EN0R { - EXTS_EN0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - External Sensor Enable for input/output pair 1."] - #[inline] - pub fn exts_en1(&self) -> EXTS_EN1R { - EXTS_EN1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - External Sensor Enable for input/output pair 2."] - #[inline] - pub fn exts_en2(&self) -> EXTS_EN2R { - EXTS_EN2R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - External Sensor Enable for input/output pair 3."] - #[inline] - pub fn exts_en3(&self) -> EXTS_EN3R { - EXTS_EN3R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - External Sensor Enable for input/output pair 4."] - #[inline] - pub fn exts_en4(&self) -> EXTS_EN4R { - EXTS_EN4R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - External Sensor Enable for input/output pair 5."] - #[inline] - pub fn exts_en5(&self) -> EXTS_EN5R { - EXTS_EN5R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:20 - External Sensor Error Counter. These bits set the number of external sensor accepted mismatches that have to occur within a single bit period before an external sensor alarm is triggered."] - #[inline] - pub fn extcnt(&self) -> EXTCNTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - EXTCNTR { bits } - } - #[doc = "Bits 21:23 - External Sensor Frequency. These bits define the frequency at which the external sensors are clocked to/from the EXTS_IN and EXTS_OUT pair."] - #[inline] - pub fn extfrq(&self) -> EXTFRQR { - EXTFRQR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 24:26 - Clock Divide. These bits are used to divide the 8KHz input clock. The resulting divided clock is used for all logic within the Security Monitor Block. Note: If the input clock is divided with these bits, the error count threshold table and output frequency will be affected accordingly with the same divide factor."] - #[inline] - pub fn divclk(&self) -> DIVCLKR { - DIVCLKR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 30 - Busy. This bit is set to 1 by hardware after EXTSCN register is written to. This bit is automatically cleared to 0 after this register information has been transferred to the security monitor domain."] - #[inline] - pub fn busy(&self) -> BUSYR { - BUSYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 30; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 31 - Lock Register. Once locked, the EXTSCN register can no longer be modified. Only a battery disconnect will clear this bit. VBAT powers this register."] - #[inline] - pub fn lock(&self) -> LOCKR { - LOCKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - External Sensor Enable for input/output pair 0."] - #[inline] - pub fn exts_en0(&mut self) -> _EXTS_EN0W { - _EXTS_EN0W { w: self } - } - #[doc = "Bit 1 - External Sensor Enable for input/output pair 1."] - #[inline] - pub fn exts_en1(&mut self) -> _EXTS_EN1W { - _EXTS_EN1W { w: self } - } - #[doc = "Bit 2 - External Sensor Enable for input/output pair 2."] - #[inline] - pub fn exts_en2(&mut self) -> _EXTS_EN2W { - _EXTS_EN2W { w: self } - } - #[doc = "Bit 3 - External Sensor Enable for input/output pair 3."] - #[inline] - pub fn exts_en3(&mut self) -> _EXTS_EN3W { - _EXTS_EN3W { w: self } - } - #[doc = "Bit 4 - External Sensor Enable for input/output pair 4."] - #[inline] - pub fn exts_en4(&mut self) -> _EXTS_EN4W { - _EXTS_EN4W { w: self } - } - #[doc = "Bit 5 - External Sensor Enable for input/output pair 5."] - #[inline] - pub fn exts_en5(&mut self) -> _EXTS_EN5W { - _EXTS_EN5W { w: self } - } - #[doc = "Bits 16:20 - External Sensor Error Counter. These bits set the number of external sensor accepted mismatches that have to occur within a single bit period before an external sensor alarm is triggered."] - #[inline] - pub fn extcnt(&mut self) -> _EXTCNTW { - _EXTCNTW { w: self } - } - #[doc = "Bits 21:23 - External Sensor Frequency. These bits define the frequency at which the external sensors are clocked to/from the EXTS_IN and EXTS_OUT pair."] - #[inline] - pub fn extfrq(&mut self) -> _EXTFRQW { - _EXTFRQW { w: self } - } - #[doc = "Bits 24:26 - Clock Divide. These bits are used to divide the 8KHz input clock. The resulting divided clock is used for all logic within the Security Monitor Block. Note: If the input clock is divided with these bits, the error count threshold table and output frequency will be affected accordingly with the same divide factor."] - #[inline] - pub fn divclk(&mut self) -> _DIVCLKW { - _DIVCLKW { w: self } - } - #[doc = "Bit 31 - Lock Register. Once locked, the EXTSCN register can no longer be modified. Only a battery disconnect will clear this bit. VBAT powers this register."] - #[inline] - pub fn lock(&mut self) -> _LOCKW { - _LOCKW { w: self } - } - } - } - #[doc = "Internal Sensor Control Register."] - pub struct INTSCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Internal Sensor Control Register."] - pub mod intscn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTSCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SHIELD_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHIELD_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl SHIELD_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SHIELD_ENR::DIS => false, - SHIELD_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SHIELD_ENR { - match value { - false => SHIELD_ENR::DIS, - true => SHIELD_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SHIELD_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SHIELD_ENR::EN - } - } - #[doc = "Possible values of the field `TEMP_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TEMP_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TEMP_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TEMP_ENR::DIS => false, - TEMP_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TEMP_ENR { - match value { - false => TEMP_ENR::DIS, - true => TEMP_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TEMP_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TEMP_ENR::EN - } - } - #[doc = "Possible values of the field `VBAT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VBAT_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VBAT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VBAT_ENR::DIS => false, - VBAT_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VBAT_ENR { - match value { - false => VBAT_ENR::DIS, - true => VBAT_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VBAT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VBAT_ENR::EN - } - } - #[doc = "Possible values of the field `LOTEMP_SEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOTEMP_SELR { - #[doc = "-50 degrees C."] - NEG50C, - #[doc = "-30 degrees C."] - NEG30C, - } - impl LOTEMP_SELR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LOTEMP_SELR::NEG50C => false, - LOTEMP_SELR::NEG30C => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LOTEMP_SELR { - match value { - false => LOTEMP_SELR::NEG50C, - true => LOTEMP_SELR::NEG30C, - } - } - #[doc = "Checks if the value of the field is `NEG50C`"] - #[inline] - pub fn is_neg50c(&self) -> bool { - *self == LOTEMP_SELR::NEG50C - } - #[doc = "Checks if the value of the field is `NEG30C`"] - #[inline] - pub fn is_neg30c(&self) -> bool { - *self == LOTEMP_SELR::NEG30C - } - } - #[doc = "Possible values of the field `VCORELOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCORELOENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VCORELOENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VCORELOENR::DIS => false, - VCORELOENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VCORELOENR { - match value { - false => VCORELOENR::DIS, - true => VCORELOENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VCORELOENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VCORELOENR::EN - } - } - #[doc = "Possible values of the field `VCOREHIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCOREHIENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VCOREHIENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VCOREHIENR::DIS => false, - VCOREHIENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VCOREHIENR { - match value { - false => VCOREHIENR::DIS, - true => VCOREHIENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VCOREHIENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VCOREHIENR::EN - } - } - #[doc = "Possible values of the field `VDDLOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDLOENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VDDLOENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDLOENR::DIS => false, - VDDLOENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDLOENR { - match value { - false => VDDLOENR::DIS, - true => VDDLOENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDLOENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDLOENR::EN - } - } - #[doc = "Possible values of the field `VDDHIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDHIENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VDDHIENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDHIENR::DIS => false, - VDDHIENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDHIENR { - match value { - false => VDDHIENR::DIS, - true => VDDHIENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VDDHIENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VDDHIENR::EN - } - } - #[doc = "Possible values of the field `VGLEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VGLENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VGLENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VGLENR::DIS => false, - VGLENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VGLENR { - match value { - false => VGLENR::DIS, - true => VGLENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == VGLENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == VGLENR::EN - } - } - #[doc = "Possible values of the field `LOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOCKR { - #[doc = "Unlocked."] - UNLOCKED, - #[doc = "Locked."] - LOCKED, - } - impl LOCKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LOCKR::UNLOCKED => false, - LOCKR::LOCKED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LOCKR { - match value { - false => LOCKR::UNLOCKED, - true => LOCKR::LOCKED, - } - } - #[doc = "Checks if the value of the field is `UNLOCKED`"] - #[inline] - pub fn is_unlocked(&self) -> bool { - *self == LOCKR::UNLOCKED - } - #[doc = "Checks if the value of the field is `LOCKED`"] - #[inline] - pub fn is_locked(&self) -> bool { - *self == LOCKR::LOCKED - } - } - #[doc = "Values that can be written to the field `SHIELD_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHIELD_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl SHIELD_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SHIELD_ENW::DIS => false, - SHIELD_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SHIELD_ENW<'a> { - w: &'a mut W, - } - impl<'a> _SHIELD_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SHIELD_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SHIELD_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SHIELD_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TEMP_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TEMP_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TEMP_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TEMP_ENW::DIS => false, - TEMP_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TEMP_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TEMP_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TEMP_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TEMP_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TEMP_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VBAT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VBAT_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VBAT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VBAT_ENW::DIS => false, - VBAT_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VBAT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _VBAT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VBAT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VBAT_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VBAT_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LOTEMP_SEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOTEMP_SELW { - #[doc = "-50 degrees C."] - NEG50C, - #[doc = "-30 degrees C."] - NEG30C, - } - impl LOTEMP_SELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LOTEMP_SELW::NEG50C => false, - LOTEMP_SELW::NEG30C => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LOTEMP_SELW<'a> { - w: &'a mut W, - } - impl<'a> _LOTEMP_SELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOTEMP_SELW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "-50 degrees C."] - #[inline] - pub fn neg50c(self) -> &'a mut W { - self.variant(LOTEMP_SELW::NEG50C) - } - #[doc = "-30 degrees C."] - #[inline] - pub fn neg30c(self) -> &'a mut W { - self.variant(LOTEMP_SELW::NEG30C) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VCORELOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCORELOENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VCORELOENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VCORELOENW::DIS => false, - VCORELOENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VCORELOENW<'a> { - w: &'a mut W, - } - impl<'a> _VCORELOENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VCORELOENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VCORELOENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VCORELOENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VCOREHIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCOREHIENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VCOREHIENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VCOREHIENW::DIS => false, - VCOREHIENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VCOREHIENW<'a> { - w: &'a mut W, - } - impl<'a> _VCOREHIENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VCOREHIENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VCOREHIENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VCOREHIENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDLOEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDLOENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VDDLOENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDLOENW::DIS => false, - VDDLOENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDLOENW<'a> { - w: &'a mut W, - } - impl<'a> _VDDLOENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDLOENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDLOENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDLOENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDHIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDHIENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VDDHIENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDHIENW::DIS => false, - VDDHIENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDHIENW<'a> { - w: &'a mut W, - } - impl<'a> _VDDHIENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDHIENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VDDHIENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VDDHIENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VGLEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VGLENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl VGLENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VGLENW::DIS => false, - VGLENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VGLENW<'a> { - w: &'a mut W, - } - impl<'a> _VGLENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VGLENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(VGLENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(VGLENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LOCK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOCKW { - #[doc = "Unlocked."] - UNLOCKED, - #[doc = "Locked."] - LOCKED, - } - impl LOCKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LOCKW::UNLOCKED => false, - LOCKW::LOCKED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LOCKW<'a> { - w: &'a mut W, - } - impl<'a> _LOCKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOCKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Unlocked."] - #[inline] - pub fn unlocked(self) -> &'a mut W { - self.variant(LOCKW::UNLOCKED) - } - #[doc = "Locked."] - #[inline] - pub fn locked(self) -> &'a mut W { - self.variant(LOCKW::LOCKED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Die Shield Enable."] - #[inline] - pub fn shield_en(&self) -> SHIELD_ENR { - SHIELD_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Temperature Sensor Enable."] - #[inline] - pub fn temp_en(&self) -> TEMP_ENR { - TEMP_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Battery Monitor Enable."] - #[inline] - pub fn vbat_en(&self) -> VBAT_ENR { - VBAT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Low Temperature Detection Select."] - #[inline] - pub fn lotemp_sel(&self) -> LOTEMP_SELR { - LOTEMP_SELR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - VCORE Undervoltage Detect Enable."] - #[inline] - pub fn vcoreloen(&self) -> VCORELOENR { - VCORELOENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 19 - VCORE Overvoltage Detect Enable."] - #[inline] - pub fn vcorehien(&self) -> VCOREHIENR { - VCOREHIENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - VDD Undervoltage Detect Enable."] - #[inline] - pub fn vddloen(&self) -> VDDLOENR { - VDDLOENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - VDD Overvoltage Detect Enable."] - #[inline] - pub fn vddhien(&self) -> VDDHIENR { - VDDHIENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 22 - Voltage Glitch Detection Enable."] - #[inline] - pub fn vglen(&self) -> VGLENR { - VGLENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 31 - Lock Register. Once locked, the INTSCN register can no longer be modified. Only a battery disconnect will clear this bit. VBAT powers this register."] - #[inline] - pub fn lock(&self) -> LOCKR { - LOCKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Die Shield Enable."] - #[inline] - pub fn shield_en(&mut self) -> _SHIELD_ENW { - _SHIELD_ENW { w: self } - } - #[doc = "Bit 1 - Temperature Sensor Enable."] - #[inline] - pub fn temp_en(&mut self) -> _TEMP_ENW { - _TEMP_ENW { w: self } - } - #[doc = "Bit 2 - Battery Monitor Enable."] - #[inline] - pub fn vbat_en(&mut self) -> _VBAT_ENW { - _VBAT_ENW { w: self } - } - #[doc = "Bit 16 - Low Temperature Detection Select."] - #[inline] - pub fn lotemp_sel(&mut self) -> _LOTEMP_SELW { - _LOTEMP_SELW { w: self } - } - #[doc = "Bit 18 - VCORE Undervoltage Detect Enable."] - #[inline] - pub fn vcoreloen(&mut self) -> _VCORELOENW { - _VCORELOENW { w: self } - } - #[doc = "Bit 19 - VCORE Overvoltage Detect Enable."] - #[inline] - pub fn vcorehien(&mut self) -> _VCOREHIENW { - _VCOREHIENW { w: self } - } - #[doc = "Bit 20 - VDD Undervoltage Detect Enable."] - #[inline] - pub fn vddloen(&mut self) -> _VDDLOENW { - _VDDLOENW { w: self } - } - #[doc = "Bit 21 - VDD Overvoltage Detect Enable."] - #[inline] - pub fn vddhien(&mut self) -> _VDDHIENW { - _VDDHIENW { w: self } - } - #[doc = "Bit 22 - Voltage Glitch Detection Enable."] - #[inline] - pub fn vglen(&mut self) -> _VGLENW { - _VGLENW { w: self } - } - #[doc = "Bit 31 - Lock Register. Once locked, the INTSCN register can no longer be modified. Only a battery disconnect will clear this bit. VBAT powers this register."] - #[inline] - pub fn lock(&mut self) -> _LOCKW { - _LOCKW { w: self } - } - } - } - #[doc = "Security Alarm Register."] - pub struct SECALM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Security Alarm Register."] - pub mod secalm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SECALM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DRS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DRSR { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl DRSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DRSR::COMPLETE => false, - DRSR::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DRSR { - match value { - false => DRSR::COMPLETE, - true => DRSR::START, - } - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == DRSR::COMPLETE - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == DRSR::START - } - } - #[doc = "Possible values of the field `KEYWIPE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum KEYWIPER { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl KEYWIPER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - KEYWIPER::COMPLETE => false, - KEYWIPER::START => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> KEYWIPER { - match value { - false => KEYWIPER::COMPLETE, - true => KEYWIPER::START, - } - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == KEYWIPER::COMPLETE - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == KEYWIPER::START - } - } - #[doc = "Possible values of the field `SHIELDF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHIELDFR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl SHIELDFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SHIELDFR::NOEVENT => false, - SHIELDFR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SHIELDFR { - match value { - false => SHIELDFR::NOEVENT, - true => SHIELDFR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == SHIELDFR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == SHIELDFR::OCCURRED - } - } - #[doc = "Possible values of the field `LOTEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOTEMPR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl LOTEMPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LOTEMPR::NOEVENT => false, - LOTEMPR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LOTEMPR { - match value { - false => LOTEMPR::NOEVENT, - true => LOTEMPR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == LOTEMPR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == LOTEMPR::OCCURRED - } - } - #[doc = "Possible values of the field `HITEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HITEMPR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl HITEMPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HITEMPR::NOEVENT => false, - HITEMPR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HITEMPR { - match value { - false => HITEMPR::NOEVENT, - true => HITEMPR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == HITEMPR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == HITEMPR::OCCURRED - } - } - #[doc = "Possible values of the field `BATLO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATLOR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATLOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BATLOR::NOEVENT => false, - BATLOR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BATLOR { - match value { - false => BATLOR::NOEVENT, - true => BATLOR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BATLOR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BATLOR::OCCURRED - } - } - #[doc = "Possible values of the field `BATHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATHIR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATHIR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BATHIR::NOEVENT => false, - BATHIR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BATHIR { - match value { - false => BATHIR::NOEVENT, - true => BATHIR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BATHIR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BATHIR::OCCURRED - } - } - #[doc = "Possible values of the field `EXTF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTFR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTFR::NOEVENT => false, - EXTFR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTFR { - match value { - false => EXTFR::NOEVENT, - true => EXTFR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTFR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTFR::OCCURRED - } - } - #[doc = "Possible values of the field `VDDLO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDLOR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VDDLOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDLOR::NOEVENT => false, - VDDLOR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDLOR { - match value { - false => VDDLOR::NOEVENT, - true => VDDLOR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == VDDLOR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == VDDLOR::OCCURRED - } - } - #[doc = "Possible values of the field `VCORELO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCORELOR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VCORELOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VCORELOR::NOEVENT => false, - VCORELOR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VCORELOR { - match value { - false => VCORELOR::NOEVENT, - true => VCORELOR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == VCORELOR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == VCORELOR::OCCURRED - } - } - #[doc = "Possible values of the field `VCOREHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCOREHIR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VCOREHIR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VCOREHIR::NOEVENT => false, - VCOREHIR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VCOREHIR { - match value { - false => VCOREHIR::NOEVENT, - true => VCOREHIR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == VCOREHIR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == VCOREHIR::OCCURRED - } - } - #[doc = "Possible values of the field `VDDHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDHIR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VDDHIR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VDDHIR::NOEVENT => false, - VDDHIR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VDDHIR { - match value { - false => VDDHIR::NOEVENT, - true => VDDHIR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == VDDHIR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == VDDHIR::OCCURRED - } - } - #[doc = "Possible values of the field `VGL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VGLR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VGLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - VGLR::NOEVENT => false, - VGLR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> VGLR { - match value { - false => VGLR::NOEVENT, - true => VGLR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == VGLR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == VGLR::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT0R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT0R::NOEVENT => false, - EXTSTAT0R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT0R { - match value { - false => EXTSTAT0R::NOEVENT, - true => EXTSTAT0R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT0R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT0R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT1R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT1R::NOEVENT => false, - EXTSTAT1R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT1R { - match value { - false => EXTSTAT1R::NOEVENT, - true => EXTSTAT1R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT1R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT1R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT2R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT2R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT2R::NOEVENT => false, - EXTSTAT2R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT2R { - match value { - false => EXTSTAT2R::NOEVENT, - true => EXTSTAT2R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT2R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT2R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT3R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT3R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT3R::NOEVENT => false, - EXTSTAT3R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT3R { - match value { - false => EXTSTAT3R::NOEVENT, - true => EXTSTAT3R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT3R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT3R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT4R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT4R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT4R::NOEVENT => false, - EXTSTAT4R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT4R { - match value { - false => EXTSTAT4R::NOEVENT, - true => EXTSTAT4R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT4R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT4R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT5R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT5R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT5R::NOEVENT => false, - EXTSTAT5R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT5R { - match value { - false => EXTSTAT5R::NOEVENT, - true => EXTSTAT5R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT5R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT5R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN0R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN0R::NOEVENT => false, - EXTSWARN0R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN0R { - match value { - false => EXTSWARN0R::NOEVENT, - true => EXTSWARN0R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN0R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN0R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN1R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN1R::NOEVENT => false, - EXTSWARN1R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN1R { - match value { - false => EXTSWARN1R::NOEVENT, - true => EXTSWARN1R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN1R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN1R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN2R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN2R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN2R::NOEVENT => false, - EXTSWARN2R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN2R { - match value { - false => EXTSWARN2R::NOEVENT, - true => EXTSWARN2R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN2R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN2R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN3R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN3R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN3R::NOEVENT => false, - EXTSWARN3R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN3R { - match value { - false => EXTSWARN3R::NOEVENT, - true => EXTSWARN3R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN3R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN3R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN4R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN4R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN4R::NOEVENT => false, - EXTSWARN4R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN4R { - match value { - false => EXTSWARN4R::NOEVENT, - true => EXTSWARN4R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN4R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN4R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSWARN5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN5R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN5R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSWARN5R::NOEVENT => false, - EXTSWARN5R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSWARN5R { - match value { - false => EXTSWARN5R::NOEVENT, - true => EXTSWARN5R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSWARN5R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSWARN5R::OCCURRED - } - } - #[doc = "Values that can be written to the field `DRS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DRSW { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl DRSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DRSW::COMPLETE => false, - DRSW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DRSW<'a> { - w: &'a mut W, - } - impl<'a> _DRSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DRSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn complete(self) -> &'a mut W { - self.variant(DRSW::COMPLETE) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(DRSW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `KEYWIPE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum KEYWIPEW { - #[doc = "No operation/complete."] - COMPLETE, - #[doc = "Start operation."] - START, - } - impl KEYWIPEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - KEYWIPEW::COMPLETE => false, - KEYWIPEW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _KEYWIPEW<'a> { - w: &'a mut W, - } - impl<'a> _KEYWIPEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: KEYWIPEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No operation/complete."] - #[inline] - pub fn complete(self) -> &'a mut W { - self.variant(KEYWIPEW::COMPLETE) - } - #[doc = "Start operation."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(KEYWIPEW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SHIELDF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHIELDFW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl SHIELDFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SHIELDFW::NOEVENT => false, - SHIELDFW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SHIELDFW<'a> { - w: &'a mut W, - } - impl<'a> _SHIELDFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SHIELDFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(SHIELDFW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(SHIELDFW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LOTEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOTEMPW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl LOTEMPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - LOTEMPW::NOEVENT => false, - LOTEMPW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _LOTEMPW<'a> { - w: &'a mut W, - } - impl<'a> _LOTEMPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOTEMPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(LOTEMPW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(LOTEMPW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HITEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HITEMPW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl HITEMPW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - HITEMPW::NOEVENT => false, - HITEMPW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _HITEMPW<'a> { - w: &'a mut W, - } - impl<'a> _HITEMPW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HITEMPW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(HITEMPW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(HITEMPW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BATLO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATLOW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATLOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BATLOW::NOEVENT => false, - BATLOW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BATLOW<'a> { - w: &'a mut W, - } - impl<'a> _BATLOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BATLOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(BATLOW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(BATLOW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BATHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATHIW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATHIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BATHIW::NOEVENT => false, - BATHIW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BATHIW<'a> { - w: &'a mut W, - } - impl<'a> _BATHIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BATHIW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(BATHIW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(BATHIW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTFW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTFW::NOEVENT => false, - EXTFW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTFW<'a> { - w: &'a mut W, - } - impl<'a> _EXTFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTFW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTFW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDLO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDLOW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VDDLOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDLOW::NOEVENT => false, - VDDLOW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDLOW<'a> { - w: &'a mut W, - } - impl<'a> _VDDLOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDLOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(VDDLOW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(VDDLOW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VCORELO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCORELOW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VCORELOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VCORELOW::NOEVENT => false, - VCORELOW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VCORELOW<'a> { - w: &'a mut W, - } - impl<'a> _VCORELOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VCORELOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(VCORELOW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(VCORELOW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VCOREHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VCOREHIW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VCOREHIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VCOREHIW::NOEVENT => false, - VCOREHIW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VCOREHIW<'a> { - w: &'a mut W, - } - impl<'a> _VCOREHIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VCOREHIW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(VCOREHIW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(VCOREHIW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VDDHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VDDHIW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VDDHIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VDDHIW::NOEVENT => false, - VDDHIW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VDDHIW<'a> { - w: &'a mut W, - } - impl<'a> _VDDHIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VDDHIW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(VDDHIW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(VDDHIW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `VGL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum VGLW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl VGLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - VGLW::NOEVENT => false, - VGLW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _VGLW<'a> { - w: &'a mut W, - } - impl<'a> _VGLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: VGLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(VGLW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(VGLW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT0W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT0W::NOEVENT => false, - EXTSTAT0W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT0W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT0W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT0W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT1W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT1W::NOEVENT => false, - EXTSTAT1W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT1W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT1W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT1W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT2W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT2W::NOEVENT => false, - EXTSTAT2W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT2W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT2W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT2W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT2W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT3W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT3W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT3W::NOEVENT => false, - EXTSTAT3W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT3W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT3W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT3W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT3W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT3W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT4W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT4W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT4W::NOEVENT => false, - EXTSTAT4W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT4W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT4W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT4W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT4W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT4W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSTAT5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT5W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT5W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSTAT5W::NOEVENT => false, - EXTSTAT5W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSTAT5W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSTAT5W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSTAT5W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSTAT5W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSTAT5W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN0W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN0W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN0W::NOEVENT => false, - EXTSWARN0W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN0W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN0W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN0W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN0W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN0W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN1W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN1W::NOEVENT => false, - EXTSWARN1W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN1W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN1W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN1W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN1W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 25; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN2W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN2W::NOEVENT => false, - EXTSWARN2W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN2W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN2W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN2W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN2W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 26; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN3W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN3W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN3W::NOEVENT => false, - EXTSWARN3W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN3W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN3W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN3W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN3W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN3W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 27; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN4W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN4W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN4W::NOEVENT => false, - EXTSWARN4W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN4W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN4W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN4W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN4W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN4W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 28; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `EXTSWARN5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSWARN5W { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSWARN5W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - EXTSWARN5W::NOEVENT => false, - EXTSWARN5W::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _EXTSWARN5W<'a> { - w: &'a mut W, - } - impl<'a> _EXTSWARN5W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: EXTSWARN5W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(EXTSWARN5W::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(EXTSWARN5W::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 29; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Destructive Reset Trigger. Setting this bit will generate a DRS. This bit is self-cleared by hardware."] - #[inline] - pub fn drs(&self) -> DRSR { - DRSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Key Wipe Trigger. Set to 1 to initiate a wipe of the AES key register. It does not reset the part, or log a timestamp. AES and DES registers are not affected by this bit. This bit is automatically cleared to 0 after the keys have been wiped."] - #[inline] - pub fn keywipe(&self) -> KEYWIPER { - KEYWIPER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Die Shield Flag."] - #[inline] - pub fn shieldf(&self) -> SHIELDFR { - SHIELDFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Low Temperature Detect."] - #[inline] - pub fn lotemp(&self) -> LOTEMPR { - LOTEMPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - High Temperature Detect."] - #[inline] - pub fn hitemp(&self) -> HITEMPR { - HITEMPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Battery Undervoltage Detect."] - #[inline] - pub fn batlo(&self) -> BATLOR { - BATLOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Battery Overvoltage Detect."] - #[inline] - pub fn bathi(&self) -> BATHIR { - BATHIR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - External Sensor Flag. This bit is set to 1 when any of the EXTSTAT bits are set."] - #[inline] - pub fn extf(&self) -> EXTFR { - EXTFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - VDD Undervoltage Detect Flag."] - #[inline] - pub fn vddlo(&self) -> VDDLOR { - VDDLOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - VCORE Undervoltage Detect Flag."] - #[inline] - pub fn vcorelo(&self) -> VCORELOR { - VCORELOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - VCORE Overvoltage Detect Flag."] - #[inline] - pub fn vcorehi(&self) -> VCOREHIR { - VCOREHIR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - VDD Overvoltage Flag."] - #[inline] - pub fn vddhi(&self) -> VDDHIR { - VDDHIR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Voltage Glitch Detection Flag."] - #[inline] - pub fn vgl(&self) -> VGLR { - VGLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - External Sensor 0 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat0(&self) -> EXTSTAT0R { - EXTSTAT0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - External Sensor 1 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat1(&self) -> EXTSTAT1R { - EXTSTAT1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - External Sensor 2 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat2(&self) -> EXTSTAT2R { - EXTSTAT2R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 19 - External Sensor 3 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat3(&self) -> EXTSTAT3R { - EXTSTAT3R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - External Sensor 4 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat4(&self) -> EXTSTAT4R { - EXTSTAT4R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - External Sensor 5 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat5(&self) -> EXTSTAT5R { - EXTSTAT5R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 24 - External Sensor 0 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn0(&self) -> EXTSWARN0R { - EXTSWARN0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 25 - External Sensor 1 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn1(&self) -> EXTSWARN1R { - EXTSWARN1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 25; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 26 - External Sensor 2 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn2(&self) -> EXTSWARN2R { - EXTSWARN2R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 26; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 27 - External Sensor 3 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn3(&self) -> EXTSWARN3R { - EXTSWARN3R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 27; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 28 - External Sensor 4 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn4(&self) -> EXTSWARN4R { - EXTSWARN4R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 28; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 29 - External Sensor 5 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn5(&self) -> EXTSWARN5R { - EXTSWARN5R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 29; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Destructive Reset Trigger. Setting this bit will generate a DRS. This bit is self-cleared by hardware."] - #[inline] - pub fn drs(&mut self) -> _DRSW { - _DRSW { w: self } - } - #[doc = "Bit 1 - Key Wipe Trigger. Set to 1 to initiate a wipe of the AES key register. It does not reset the part, or log a timestamp. AES and DES registers are not affected by this bit. This bit is automatically cleared to 0 after the keys have been wiped."] - #[inline] - pub fn keywipe(&mut self) -> _KEYWIPEW { - _KEYWIPEW { w: self } - } - #[doc = "Bit 2 - Die Shield Flag."] - #[inline] - pub fn shieldf(&mut self) -> _SHIELDFW { - _SHIELDFW { w: self } - } - #[doc = "Bit 3 - Low Temperature Detect."] - #[inline] - pub fn lotemp(&mut self) -> _LOTEMPW { - _LOTEMPW { w: self } - } - #[doc = "Bit 4 - High Temperature Detect."] - #[inline] - pub fn hitemp(&mut self) -> _HITEMPW { - _HITEMPW { w: self } - } - #[doc = "Bit 5 - Battery Undervoltage Detect."] - #[inline] - pub fn batlo(&mut self) -> _BATLOW { - _BATLOW { w: self } - } - #[doc = "Bit 6 - Battery Overvoltage Detect."] - #[inline] - pub fn bathi(&mut self) -> _BATHIW { - _BATHIW { w: self } - } - #[doc = "Bit 7 - External Sensor Flag. This bit is set to 1 when any of the EXTSTAT bits are set."] - #[inline] - pub fn extf(&mut self) -> _EXTFW { - _EXTFW { w: self } - } - #[doc = "Bit 8 - VDD Undervoltage Detect Flag."] - #[inline] - pub fn vddlo(&mut self) -> _VDDLOW { - _VDDLOW { w: self } - } - #[doc = "Bit 9 - VCORE Undervoltage Detect Flag."] - #[inline] - pub fn vcorelo(&mut self) -> _VCORELOW { - _VCORELOW { w: self } - } - #[doc = "Bit 10 - VCORE Overvoltage Detect Flag."] - #[inline] - pub fn vcorehi(&mut self) -> _VCOREHIW { - _VCOREHIW { w: self } - } - #[doc = "Bit 11 - VDD Overvoltage Flag."] - #[inline] - pub fn vddhi(&mut self) -> _VDDHIW { - _VDDHIW { w: self } - } - #[doc = "Bit 12 - Voltage Glitch Detection Flag."] - #[inline] - pub fn vgl(&mut self) -> _VGLW { - _VGLW { w: self } - } - #[doc = "Bit 16 - External Sensor 0 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat0(&mut self) -> _EXTSTAT0W { - _EXTSTAT0W { w: self } - } - #[doc = "Bit 17 - External Sensor 1 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat1(&mut self) -> _EXTSTAT1W { - _EXTSTAT1W { w: self } - } - #[doc = "Bit 18 - External Sensor 2 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat2(&mut self) -> _EXTSTAT2W { - _EXTSTAT2W { w: self } - } - #[doc = "Bit 19 - External Sensor 3 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat3(&mut self) -> _EXTSTAT3W { - _EXTSTAT3W { w: self } - } - #[doc = "Bit 20 - External Sensor 4 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat4(&mut self) -> _EXTSTAT4W { - _EXTSTAT4W { w: self } - } - #[doc = "Bit 21 - External Sensor 5 Detect. The tamper detect is only active when it is enabled. This bits needs to be cleared in software after a tamper event to re-arm the sensor."] - #[inline] - pub fn extstat5(&mut self) -> _EXTSTAT5W { - _EXTSTAT5W { w: self } - } - #[doc = "Bit 24 - External Sensor 0 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn0(&mut self) -> _EXTSWARN0W { - _EXTSWARN0W { w: self } - } - #[doc = "Bit 25 - External Sensor 1 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn1(&mut self) -> _EXTSWARN1W { - _EXTSWARN1W { w: self } - } - #[doc = "Bit 26 - External Sensor 2 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn2(&mut self) -> _EXTSWARN2W { - _EXTSWARN2W { w: self } - } - #[doc = "Bit 27 - External Sensor 3 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn3(&mut self) -> _EXTSWARN3W { - _EXTSWARN3W { w: self } - } - #[doc = "Bit 28 - External Sensor 4 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn4(&mut self) -> _EXTSWARN4W { - _EXTSWARN4W { w: self } - } - #[doc = "Bit 29 - External Sensor 5 Warning Ready flag. The tamper detect warning flags are set, regardless of whether the external sensors are enabled."] - #[inline] - pub fn extswarn5(&mut self) -> _EXTSWARN5W { - _EXTSWARN5W { w: self } - } - } - } - #[doc = "Security Diagnostic Register."] - pub struct SECDIAG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Security Diagnostic Register."] - pub mod secdiag { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SECDIAG { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `BORF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BORFR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BORFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BORFR::NOEVENT => false, - BORFR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BORFR { - match value { - false => BORFR::NOEVENT, - true => BORFR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BORFR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BORFR::OCCURRED - } - } - #[doc = "Possible values of the field `SHIELDF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SHIELDFR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl SHIELDFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SHIELDFR::NOEVENT => false, - SHIELDFR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SHIELDFR { - match value { - false => SHIELDFR::NOEVENT, - true => SHIELDFR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == SHIELDFR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == SHIELDFR::OCCURRED - } - } - #[doc = "Possible values of the field `LOTEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOTEMPR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl LOTEMPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - LOTEMPR::NOEVENT => false, - LOTEMPR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> LOTEMPR { - match value { - false => LOTEMPR::NOEVENT, - true => LOTEMPR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == LOTEMPR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == LOTEMPR::OCCURRED - } - } - #[doc = "Possible values of the field `HITEMP`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HITEMPR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl HITEMPR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HITEMPR::NOEVENT => false, - HITEMPR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HITEMPR { - match value { - false => HITEMPR::NOEVENT, - true => HITEMPR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == HITEMPR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == HITEMPR::OCCURRED - } - } - #[doc = "Possible values of the field `BATLO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATLOR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATLOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BATLOR::NOEVENT => false, - BATLOR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BATLOR { - match value { - false => BATLOR::NOEVENT, - true => BATLOR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BATLOR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BATLOR::OCCURRED - } - } - #[doc = "Possible values of the field `BATHI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BATHIR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl BATHIR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BATHIR::NOEVENT => false, - BATHIR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BATHIR { - match value { - false => BATHIR::NOEVENT, - true => BATHIR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == BATHIR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == BATHIR::OCCURRED - } - } - #[doc = "Possible values of the field `DYNF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DYNFR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl DYNFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DYNFR::NOEVENT => false, - DYNFR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DYNFR { - match value { - false => DYNFR::NOEVENT, - true => DYNFR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == DYNFR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == DYNFR::OCCURRED - } - } - #[doc = "Possible values of the field `AESKT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AESKTR { - #[doc = "Key has not been transferred."] - INCOMPLETE, - #[doc = "Key has been transferred."] - COMPLETE, - } - impl AESKTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AESKTR::INCOMPLETE => false, - AESKTR::COMPLETE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AESKTR { - match value { - false => AESKTR::INCOMPLETE, - true => AESKTR::COMPLETE, - } - } - #[doc = "Checks if the value of the field is `INCOMPLETE`"] - #[inline] - pub fn is_incomplete(&self) -> bool { - *self == AESKTR::INCOMPLETE - } - #[doc = "Checks if the value of the field is `COMPLETE`"] - #[inline] - pub fn is_complete(&self) -> bool { - *self == AESKTR::COMPLETE - } - } - #[doc = "Possible values of the field `EXTSTAT0`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT0R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT0R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT0R::NOEVENT => false, - EXTSTAT0R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT0R { - match value { - false => EXTSTAT0R::NOEVENT, - true => EXTSTAT0R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT0R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT0R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT1R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT1R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT1R::NOEVENT => false, - EXTSTAT1R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT1R { - match value { - false => EXTSTAT1R::NOEVENT, - true => EXTSTAT1R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT1R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT1R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT2R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT2R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT2R::NOEVENT => false, - EXTSTAT2R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT2R { - match value { - false => EXTSTAT2R::NOEVENT, - true => EXTSTAT2R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT2R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT2R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT3R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT3R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT3R::NOEVENT => false, - EXTSTAT3R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT3R { - match value { - false => EXTSTAT3R::NOEVENT, - true => EXTSTAT3R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT3R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT3R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT4`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT4R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT4R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT4R::NOEVENT => false, - EXTSTAT4R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT4R { - match value { - false => EXTSTAT4R::NOEVENT, - true => EXTSTAT4R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT4R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT4R::OCCURRED - } - } - #[doc = "Possible values of the field `EXTSTAT5`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSTAT5R { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl EXTSTAT5R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSTAT5R::NOEVENT => false, - EXTSTAT5R::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSTAT5R { - match value { - false => EXTSTAT5R::NOEVENT, - true => EXTSTAT5R::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == EXTSTAT5R::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == EXTSTAT5R::OCCURRED - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Battery-On-Reset Flag. This bit is set once the back up battery is conneted."] - #[inline] - pub fn borf(&self) -> BORFR { - BORFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Die Shield Flag."] - #[inline] - pub fn shieldf(&self) -> SHIELDFR { - SHIELDFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Low Temperature Detect."] - #[inline] - pub fn lotemp(&self) -> LOTEMPR { - LOTEMPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - High Temperature Detect."] - #[inline] - pub fn hitemp(&self) -> HITEMPR { - HITEMPR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Battery Undervoltage Detect."] - #[inline] - pub fn batlo(&self) -> BATLOR { - BATLOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - Battery Overvoltage Detect."] - #[inline] - pub fn bathi(&self) -> BATHIR { - BATHIR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Dynamic Sensor Flag. This bit is set to 1 when any of the EXTSTAT bits are set."] - #[inline] - pub fn dynf(&self) -> DYNFR { - DYNFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - AES Key Transfer. This bit is set to 1 when AES Key has been transferred from the TRNG to the battery backed AES key register. This bit can only be reset by a BOR."] - #[inline] - pub fn aeskt(&self) -> AESKTR { - AESKTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - External Sensor 0 Detect."] - #[inline] - pub fn extstat0(&self) -> EXTSTAT0R { - EXTSTAT0R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - External Sensor 1 Detect."] - #[inline] - pub fn extstat1(&self) -> EXTSTAT1R { - EXTSTAT1R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - External Sensor 2 Detect."] - #[inline] - pub fn extstat2(&self) -> EXTSTAT2R { - EXTSTAT2R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 19 - External Sensor 3 Detect."] - #[inline] - pub fn extstat3(&self) -> EXTSTAT3R { - EXTSTAT3R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - External Sensor 4 Detect."] - #[inline] - pub fn extstat4(&self) -> EXTSTAT4R { - EXTSTAT4R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - External Sensor 5 Detect."] - #[inline] - pub fn extstat5(&self) -> EXTSTAT5R { - EXTSTAT5R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } - #[doc = "DRS Log RTC Value. This register contains the 32 bit value in the RTC second register when the last DRS event occurred."] - pub struct DLRTC { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DRS Log RTC Value. This register contains the 32 bit value in the RTC second register when the last DRS event occurred."] - pub mod dlrtc { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::DLRTC { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct DLRTCR { - bits: u32, - } - impl DLRTCR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - DRS Log RTC Value. This register contains the 32 bit value in the RTC second register when the last DRS event occured."] - #[inline] - pub fn dlrtc(&self) -> DLRTCR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DLRTCR { bits } - } - } - } - #[doc = "Security Monitor Status Register."] - pub struct SECST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Security Monitor Status Register."] - pub mod secst { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SECST { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `EXTSRS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum EXTSRSR { - #[doc = "Access authorized."] - ALLOWED, - #[doc = "Access not authorized."] - NOTALLOWED, - } - impl EXTSRSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - EXTSRSR::ALLOWED => false, - EXTSRSR::NOTALLOWED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> EXTSRSR { - match value { - false => EXTSRSR::ALLOWED, - true => EXTSRSR::NOTALLOWED, - } - } - #[doc = "Checks if the value of the field is `ALLOWED`"] - #[inline] - pub fn is_allowed(&self) -> bool { - *self == EXTSRSR::ALLOWED - } - #[doc = "Checks if the value of the field is `NOTALLOWED`"] - #[inline] - pub fn is_not_allowed(&self) -> bool { - *self == EXTSRSR::NOTALLOWED - } - } - #[doc = "Possible values of the field `INTSRS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INTSRSR { - #[doc = "Access authorized."] - ALLOWED, - #[doc = "Access not authorized."] - NOTALLOWED, - } - impl INTSRSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INTSRSR::ALLOWED => false, - INTSRSR::NOTALLOWED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INTSRSR { - match value { - false => INTSRSR::ALLOWED, - true => INTSRSR::NOTALLOWED, - } - } - #[doc = "Checks if the value of the field is `ALLOWED`"] - #[inline] - pub fn is_allowed(&self) -> bool { - *self == INTSRSR::ALLOWED - } - #[doc = "Checks if the value of the field is `NOTALLOWED`"] - #[inline] - pub fn is_not_allowed(&self) -> bool { - *self == INTSRSR::NOTALLOWED - } - } - #[doc = "Possible values of the field `SECALRS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SECALRSR { - #[doc = "Access authorized."] - ALLOWED, - #[doc = "Access not authorized."] - NOTALLOWED, - } - impl SECALRSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SECALRSR::ALLOWED => false, - SECALRSR::NOTALLOWED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SECALRSR { - match value { - false => SECALRSR::ALLOWED, - true => SECALRSR::NOTALLOWED, - } - } - #[doc = "Checks if the value of the field is `ALLOWED`"] - #[inline] - pub fn is_allowed(&self) -> bool { - *self == SECALRSR::ALLOWED - } - #[doc = "Checks if the value of the field is `NOTALLOWED`"] - #[inline] - pub fn is_not_allowed(&self) -> bool { - *self == SECALRSR::NOTALLOWED - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - External Sensor Control Register Status."] - #[inline] - pub fn extsrs(&self) -> EXTSRSR { - EXTSRSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Internal Sensor Control Register Status."] - #[inline] - pub fn intsrs(&self) -> INTSRSR { - INTSRSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Security Alarm Register Status."] - #[inline] - pub fn secalrs(&self) -> SECALRSR { - SECALRSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } -} -#[doc = "SPIXR peripheral."] -pub struct SPIXR { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPIXR {} -impl SPIXR { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spixr::RegisterBlock { - 0x4003_a000 as *const _ - } -} -impl Deref for SPIXR { - type Target = spixr::RegisterBlock; - fn deref(&self) -> &spixr::RegisterBlock { - unsafe { &*SPIXR::ptr() } - } -} -#[doc = "SPIXR peripheral."] -pub mod spixr { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Register for reading and writing the FIFO."] - pub data32: DATA32, - #[doc = "0x04 - Register for controlling SPI peripheral."] - pub ctrl1: CTRL1, - #[doc = "0x08 - Register for controlling SPI peripheral."] - pub ctrl2: CTRL2, - #[doc = "0x0c - Register for controlling SPI peripheral."] - pub ctrl3: CTRL3, - #[doc = "0x10 - Register for controlling SPI peripheral."] - pub ctrl4: CTRL4, - #[doc = "0x14 - Register for controlling SPI clock rate."] - pub brg_ctrl: BRG_CTRL, - #[doc = "0x18 - Register for controlling I2C mode."] - pub i2s_ctrl: I2S_CTRL, - #[doc = "0x1c - Register for controlling DMA."] - pub dma: DMA, - #[doc = "0x20 - Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub irq: IRQ, - #[doc = "0x24 - Register for enabling interrupts."] - pub irqe: IRQE, - #[doc = "0x28 - Register for wake up flags. All bits in this register are write 1 to clear."] - pub wake: WAKE, - #[doc = "0x2c - Register for wake up enable."] - pub wakee: WAKEE, - #[doc = "0x30 - SPI Status register."] - pub stat: STAT, - #[doc = "0x34 - Register to control external memory."] - pub xmem_ctrl: XMEM_CTRL, - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA32 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data32 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DATA32 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA16 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data16 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::DATA16 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u16, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA8 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data8 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::DATA8 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u8, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:7 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SPIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SPIENR { - #[doc = "SPI is disabled."] - DIS, - #[doc = "SPI is enabled."] - EN, - } - impl SPIENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SPIENR::DIS => false, - SPIENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SPIENR { - match value { - false => SPIENR::DIS, - true => SPIENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SPIENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SPIENR::EN - } - } - #[doc = "Possible values of the field `MMEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MMENR { - #[doc = "SPI is Slave mode."] - DIS, - #[doc = "SPI is Master mode."] - EN, - } - impl MMENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MMENR::DIS => false, - MMENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MMENR { - match value { - false => MMENR::DIS, - true => MMENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == MMENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == MMENR::EN - } - } - #[doc = "Possible values of the field `TIMER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMERR { - #[doc = "Timer is disabled."] - DIS, - #[doc = "Timer is enabled, only valid if SPIEN=0."] - EN, - } - impl TIMERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TIMERR::DIS => false, - TIMERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TIMERR { - match value { - false => TIMERR::DIS, - true => TIMERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TIMERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TIMERR::EN - } - } - #[doc = "Possible values of the field `FL_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL_ENR { - #[doc = "Flow Control mode is disabled."] - DIS, - #[doc = "Flow Control Mode is enabled."] - EN, - } - impl FL_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FL_ENR::DIS => false, - FL_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FL_ENR { - match value { - false => FL_ENR::DIS, - true => FL_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FL_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FL_ENR::EN - } - } - #[doc = "Possible values of the field `SSIO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSIOR { - #[doc = "Slave select 0 is output."] - OUTPUT, - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - INPUT, - } - impl SSIOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSIOR::OUTPUT => false, - SSIOR::INPUT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSIOR { - match value { - false => SSIOR::OUTPUT, - true => SSIOR::INPUT, - } - } - #[doc = "Checks if the value of the field is `OUTPUT`"] - #[inline] - pub fn is_output(&self) -> bool { - *self == SSIOR::OUTPUT - } - #[doc = "Checks if the value of the field is `INPUT`"] - #[inline] - pub fn is_input(&self) -> bool { - *self == SSIOR::INPUT - } - } - #[doc = "Possible values of the field `TX_START`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STARTR { - #[doc = "Master Initiates a transaction, this bit is\n\t\t\t\t\t\t\t\tself clearing when transactions are done. If\n\t\t\t\t\t\t\t\ta transaction completes, and the TX FIFO\n\t\t\t\t\t\t\t\tis empty, the Master halts, if a transaction\n\t\t\t\t\t\t\t\tcompletes, and the TX FIFO is not empty,\n\t\t\t\t\t\t\t\tthe Master initiates another transaction."] - START, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_STARTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_STARTR::START => true, - TX_STARTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_STARTR { - match value { - true => TX_STARTR::START, - i => TX_STARTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == TX_STARTR::START - } - } - #[doc = "Possible values of the field `SS_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_CTRLR { - #[doc = "SPI de-asserts Slave Select at the end of a transaction."] - DEASSERT, - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - ASSERT, - } - impl SS_CTRLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SS_CTRLR::DEASSERT => false, - SS_CTRLR::ASSERT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SS_CTRLR { - match value { - false => SS_CTRLR::DEASSERT, - true => SS_CTRLR::ASSERT, - } - } - #[doc = "Checks if the value of the field is `DEASSERT`"] - #[inline] - pub fn is_deassert(&self) -> bool { - *self == SS_CTRLR::DEASSERT - } - #[doc = "Checks if the value of the field is `ASSERT`"] - #[inline] - pub fn is_assert(&self) -> bool { - *self == SS_CTRLR::ASSERT - } - } - #[doc = "Possible values of the field `SS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSR { - #[doc = "SS0 is selected."] - SS0, - #[doc = "SS1 is selected."] - SS1, - #[doc = "SS2 is selected."] - SS2, - #[doc = "SS3 is selected."] - SS3, - #[doc = "SS4 is selected."] - SS4, - #[doc = "SS5 is selected."] - SS5, - #[doc = "SS6 is selected."] - SS6, - #[doc = "SS7 is selected."] - SS7, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSR::SS0 => 0x01, - SSR::SS1 => 0x02, - SSR::SS2 => 0x04, - SSR::SS3 => 0x08, - SSR::SS4 => 0x10, - SSR::SS5 => 0x20, - SSR::SS6 => 0x40, - SSR::SS7 => 0x80, - SSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSR { - match value { - 1 => SSR::SS0, - 2 => SSR::SS1, - 4 => SSR::SS2, - 8 => SSR::SS3, - 16 => SSR::SS4, - 32 => SSR::SS5, - 64 => SSR::SS6, - 128 => SSR::SS7, - i => SSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SS0`"] - #[inline] - pub fn is_ss0(&self) -> bool { - *self == SSR::SS0 - } - #[doc = "Checks if the value of the field is `SS1`"] - #[inline] - pub fn is_ss1(&self) -> bool { - *self == SSR::SS1 - } - #[doc = "Checks if the value of the field is `SS2`"] - #[inline] - pub fn is_ss2(&self) -> bool { - *self == SSR::SS2 - } - #[doc = "Checks if the value of the field is `SS3`"] - #[inline] - pub fn is_ss3(&self) -> bool { - *self == SSR::SS3 - } - #[doc = "Checks if the value of the field is `SS4`"] - #[inline] - pub fn is_ss4(&self) -> bool { - *self == SSR::SS4 - } - #[doc = "Checks if the value of the field is `SS5`"] - #[inline] - pub fn is_ss5(&self) -> bool { - *self == SSR::SS5 - } - #[doc = "Checks if the value of the field is `SS6`"] - #[inline] - pub fn is_ss6(&self) -> bool { - *self == SSR::SS6 - } - #[doc = "Checks if the value of the field is `SS7`"] - #[inline] - pub fn is_ss7(&self) -> bool { - *self == SSR::SS7 - } - } - #[doc = "Values that can be written to the field `SPIEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SPIENW { - #[doc = "SPI is disabled."] - DIS, - #[doc = "SPI is enabled."] - EN, - } - impl SPIENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SPIENW::DIS => false, - SPIENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SPIENW<'a> { - w: &'a mut W, - } - impl<'a> _SPIENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SPIENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SPIENW::DIS) - } - #[doc = "SPI is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SPIENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MMEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MMENW { - #[doc = "SPI is Slave mode."] - DIS, - #[doc = "SPI is Master mode."] - EN, - } - impl MMENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MMENW::DIS => false, - MMENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MMENW<'a> { - w: &'a mut W, - } - impl<'a> _MMENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MMENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI is Slave mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(MMENW::DIS) - } - #[doc = "SPI is Master mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(MMENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TIMER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMERW { - #[doc = "Timer is disabled."] - DIS, - #[doc = "Timer is enabled, only valid if SPIEN=0."] - EN, - } - impl TIMERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TIMERW::DIS => false, - TIMERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TIMERW<'a> { - w: &'a mut W, - } - impl<'a> _TIMERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TIMERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Timer is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TIMERW::DIS) - } - #[doc = "Timer is enabled, only valid if SPIEN=0."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TIMERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FL_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FL_ENW { - #[doc = "Flow Control mode is disabled."] - DIS, - #[doc = "Flow Control Mode is enabled."] - EN, - } - impl FL_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FL_ENW::DIS => false, - FL_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FL_ENW<'a> { - w: &'a mut W, - } - impl<'a> _FL_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FL_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flow Control mode is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FL_ENW::DIS) - } - #[doc = "Flow Control Mode is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FL_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSIO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSIOW { - #[doc = "Slave select 0 is output."] - OUTPUT, - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - INPUT, - } - impl SSIOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSIOW::OUTPUT => false, - SSIOW::INPUT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSIOW<'a> { - w: &'a mut W, - } - impl<'a> _SSIOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSIOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Slave select 0 is output."] - #[inline] - pub fn output(self) -> &'a mut W { - self.variant(SSIOW::OUTPUT) - } - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - #[inline] - pub fn input(self) -> &'a mut W { - self.variant(SSIOW::INPUT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_START`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STARTW { - #[doc = "Master Initiates a transaction, this bit is\n\t\t\t\t\t\t\t\tself clearing when transactions are done. If\n\t\t\t\t\t\t\t\ta transaction completes, and the TX FIFO\n\t\t\t\t\t\t\t\tis empty, the Master halts, if a transaction\n\t\t\t\t\t\t\t\tcompletes, and the TX FIFO is not empty,\n\t\t\t\t\t\t\t\tthe Master initiates another transaction."] - START, - } - impl TX_STARTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_STARTW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_STARTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_STARTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_STARTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Master Initiates a transaction, this bit is self clearing when transactions are done. If a transaction completes, and the TX FIFO is empty, the Master halts, if a transaction completes, and the TX FIFO is not empty, the Master initiates another transaction."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(TX_STARTW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_CTRLW { - #[doc = "SPI de-asserts Slave Select at the end of a transaction."] - DEASSERT, - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - ASSERT, - } - impl SS_CTRLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SS_CTRLW::DEASSERT => false, - SS_CTRLW::ASSERT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_CTRLW<'a> { - w: &'a mut W, - } - impl<'a> _SS_CTRLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_CTRLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI de-asserts Slave Select at the end of a transaction."] - #[inline] - pub fn deassert(self) -> &'a mut W { - self.variant(SS_CTRLW::DEASSERT) - } - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - #[inline] - pub fn assert(self) -> &'a mut W { - self.variant(SS_CTRLW::ASSERT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSW { - #[doc = "SS0 is selected."] - SS0, - #[doc = "SS1 is selected."] - SS1, - #[doc = "SS2 is selected."] - SS2, - #[doc = "SS3 is selected."] - SS3, - #[doc = "SS4 is selected."] - SS4, - #[doc = "SS5 is selected."] - SS5, - #[doc = "SS6 is selected."] - SS6, - #[doc = "SS7 is selected."] - SS7, - } - impl SSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSW::SS0 => 1, - SSW::SS1 => 2, - SSW::SS2 => 4, - SSW::SS3 => 8, - SSW::SS4 => 16, - SSW::SS5 => 32, - SSW::SS6 => 64, - SSW::SS7 => 128, - } - } - } - #[doc = r" Proxy"] - pub struct _SSW<'a> { - w: &'a mut W, - } - impl<'a> _SSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SS0 is selected."] - #[inline] - pub fn ss0(self) -> &'a mut W { - self.variant(SSW::SS0) - } - #[doc = "SS1 is selected."] - #[inline] - pub fn ss1(self) -> &'a mut W { - self.variant(SSW::SS1) - } - #[doc = "SS2 is selected."] - #[inline] - pub fn ss2(self) -> &'a mut W { - self.variant(SSW::SS2) - } - #[doc = "SS3 is selected."] - #[inline] - pub fn ss3(self) -> &'a mut W { - self.variant(SSW::SS3) - } - #[doc = "SS4 is selected."] - #[inline] - pub fn ss4(self) -> &'a mut W { - self.variant(SSW::SS4) - } - #[doc = "SS5 is selected."] - #[inline] - pub fn ss5(self) -> &'a mut W { - self.variant(SSW::SS5) - } - #[doc = "SS6 is selected."] - #[inline] - pub fn ss6(self) -> &'a mut W { - self.variant(SSW::SS6) - } - #[doc = "SS7 is selected."] - #[inline] - pub fn ss7(self) -> &'a mut W { - self.variant(SSW::SS7) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SPI Enable."] - #[inline] - pub fn spien(&self) -> SPIENR { - SPIENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn mmen(&self) -> MMENR { - MMENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Timer Enable."] - #[inline] - pub fn timer(&self) -> TIMERR { - TIMERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Flow Control Mode Enable."] - #[inline] - pub fn fl_en(&self) -> FL_ENR { - FL_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select 0, IO direction, to support Multi-Master mode, Slave Select 0 can be input in Master mode. This bit has no effect in slave mode."] - #[inline] - pub fn ssio(&self) -> SSIOR { - SSIOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Start Transmit."] - #[inline] - pub fn tx_start(&self) -> TX_STARTR { - TX_STARTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Slave Select Control."] - #[inline] - pub fn ss_ctrl(&self) -> SS_CTRLR { - SS_CTRLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:23 - Slave Select, when in Master mode selects which Slave devices are selected. More than one Slave device can be selected."] - #[inline] - pub fn ss(&self) -> SSR { - SSR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - SPI Enable."] - #[inline] - pub fn spien(&mut self) -> _SPIENW { - _SPIENW { w: self } - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn mmen(&mut self) -> _MMENW { - _MMENW { w: self } - } - #[doc = "Bit 2 - Timer Enable."] - #[inline] - pub fn timer(&mut self) -> _TIMERW { - _TIMERW { w: self } - } - #[doc = "Bit 3 - Flow Control Mode Enable."] - #[inline] - pub fn fl_en(&mut self) -> _FL_ENW { - _FL_ENW { w: self } - } - #[doc = "Bit 4 - Slave Select 0, IO direction, to support Multi-Master mode, Slave Select 0 can be input in Master mode. This bit has no effect in slave mode."] - #[inline] - pub fn ssio(&mut self) -> _SSIOW { - _SSIOW { w: self } - } - #[doc = "Bit 5 - Start Transmit."] - #[inline] - pub fn tx_start(&mut self) -> _TX_STARTW { - _TX_STARTW { w: self } - } - #[doc = "Bit 8 - Slave Select Control."] - #[inline] - pub fn ss_ctrl(&mut self) -> _SS_CTRLW { - _SS_CTRLW { w: self } - } - #[doc = "Bits 16:23 - Slave Select, when in Master mode selects which Slave devices are selected. More than one Slave device can be selected."] - #[inline] - pub fn ss(&mut self) -> _SSW { - _SSW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_NUM_CHARR { - bits: u16, - } - impl TX_NUM_CHARR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_NUM_CHARR { - bits: u16, - } - impl RX_NUM_CHARR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_NUM_CHARW<'a> { - w: &'a mut W, - } - impl<'a> _TX_NUM_CHARW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_NUM_CHARW<'a> { - w: &'a mut W, - } - impl<'a> _RX_NUM_CHARW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Nubmer of Characters to transmit."] - #[inline] - pub fn tx_num_char(&self) -> TX_NUM_CHARR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - TX_NUM_CHARR { bits } - } - #[doc = "Bits 16:31 - Nubmer of Characters to receive."] - #[inline] - pub fn rx_num_char(&self) -> RX_NUM_CHARR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - RX_NUM_CHARR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Nubmer of Characters to transmit."] - #[inline] - pub fn tx_num_char(&mut self) -> _TX_NUM_CHARW { - _TX_NUM_CHARW { w: self } - } - #[doc = "Bits 16:31 - Nubmer of Characters to receive."] - #[inline] - pub fn rx_num_char(&mut self) -> _RX_NUM_CHARW { - _RX_NUM_CHARW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CPHAR { - bits: bool, - } - impl CPHAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CPOLR { - bits: bool, - } - impl CPOLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `SCLK_FB_INV`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_FB_INVR { - #[doc = "SCLK is not inverted to Line Receiver."] - NON_INV, - #[doc = "SCLK is inverted to Line Receiver."] - INV, - } - impl SCLK_FB_INVR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCLK_FB_INVR::NON_INV => false, - SCLK_FB_INVR::INV => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCLK_FB_INVR { - match value { - false => SCLK_FB_INVR::NON_INV, - true => SCLK_FB_INVR::INV, - } - } - #[doc = "Checks if the value of the field is `NON_INV`"] - #[inline] - pub fn is_non_inv(&self) -> bool { - *self == SCLK_FB_INVR::NON_INV - } - #[doc = "Checks if the value of the field is `INV`"] - #[inline] - pub fn is_inv(&self) -> bool { - *self == SCLK_FB_INVR::INV - } - } - #[doc = "Possible values of the field `NUMBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NUMBITSR { - #[doc = "16 bits per character."] - _0, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl NUMBITSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - NUMBITSR::_0 => 0, - NUMBITSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> NUMBITSR { - match value { - 0 => NUMBITSR::_0, - i => NUMBITSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0`"] - #[inline] - pub fn is_0(&self) -> bool { - *self == NUMBITSR::_0 - } - } - #[doc = "Possible values of the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHR { - #[doc = "1 data pin."] - MONO, - #[doc = "2 data pins."] - DUAL, - #[doc = "4 data pins."] - QUAD, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl DATA_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - DATA_WIDTHR::MONO => 0, - DATA_WIDTHR::DUAL => 0x01, - DATA_WIDTHR::QUAD => 0x02, - DATA_WIDTHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> DATA_WIDTHR { - match value { - 0 => DATA_WIDTHR::MONO, - 1 => DATA_WIDTHR::DUAL, - 2 => DATA_WIDTHR::QUAD, - i => DATA_WIDTHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `MONO`"] - #[inline] - pub fn is_mono(&self) -> bool { - *self == DATA_WIDTHR::MONO - } - #[doc = "Checks if the value of the field is `DUAL`"] - #[inline] - pub fn is_dual(&self) -> bool { - *self == DATA_WIDTHR::DUAL - } - #[doc = "Checks if the value of the field is `QUAD`"] - #[inline] - pub fn is_quad(&self) -> bool { - *self == DATA_WIDTHR::QUAD - } - } - #[doc = "Possible values of the field `THREE_WIRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum THREE_WIRER { - #[doc = "Use four wire mode (Mono only)."] - DIS, - #[doc = "Use three wire mode."] - EN, - } - impl THREE_WIRER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - THREE_WIRER::DIS => false, - THREE_WIRER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> THREE_WIRER { - match value { - false => THREE_WIRER::DIS, - true => THREE_WIRER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == THREE_WIRER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == THREE_WIRER::EN - } - } - #[doc = "Possible values of the field `SSPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSPOLR { - #[doc = "SS0 active high."] - SS0_HIGH, - #[doc = "SS1 active high."] - SS1_HIGH, - #[doc = "SS2 active high."] - SS2_HIGH, - #[doc = "SS3 active high."] - SS3_HIGH, - #[doc = "SS4 active high."] - SS4_HIGH, - #[doc = "SS5 active high."] - SS5_HIGH, - #[doc = "SS6 active high."] - SS6_HIGH, - #[doc = "SS7 active high."] - SS7_HIGH, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSPOLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSPOLR::SS0_HIGH => 0x01, - SSPOLR::SS1_HIGH => 0x02, - SSPOLR::SS2_HIGH => 0x04, - SSPOLR::SS3_HIGH => 0x08, - SSPOLR::SS4_HIGH => 0x10, - SSPOLR::SS5_HIGH => 0x20, - SSPOLR::SS6_HIGH => 0x40, - SSPOLR::SS7_HIGH => 0x80, - SSPOLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSPOLR { - match value { - 1 => SSPOLR::SS0_HIGH, - 2 => SSPOLR::SS1_HIGH, - 4 => SSPOLR::SS2_HIGH, - 8 => SSPOLR::SS3_HIGH, - 16 => SSPOLR::SS4_HIGH, - 32 => SSPOLR::SS5_HIGH, - 64 => SSPOLR::SS6_HIGH, - 128 => SSPOLR::SS7_HIGH, - i => SSPOLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SS0_HIGH`"] - #[inline] - pub fn is_ss0_high(&self) -> bool { - *self == SSPOLR::SS0_HIGH - } - #[doc = "Checks if the value of the field is `SS1_HIGH`"] - #[inline] - pub fn is_ss1_high(&self) -> bool { - *self == SSPOLR::SS1_HIGH - } - #[doc = "Checks if the value of the field is `SS2_HIGH`"] - #[inline] - pub fn is_ss2_high(&self) -> bool { - *self == SSPOLR::SS2_HIGH - } - #[doc = "Checks if the value of the field is `SS3_HIGH`"] - #[inline] - pub fn is_ss3_high(&self) -> bool { - *self == SSPOLR::SS3_HIGH - } - #[doc = "Checks if the value of the field is `SS4_HIGH`"] - #[inline] - pub fn is_ss4_high(&self) -> bool { - *self == SSPOLR::SS4_HIGH - } - #[doc = "Checks if the value of the field is `SS5_HIGH`"] - #[inline] - pub fn is_ss5_high(&self) -> bool { - *self == SSPOLR::SS5_HIGH - } - #[doc = "Checks if the value of the field is `SS6_HIGH`"] - #[inline] - pub fn is_ss6_high(&self) -> bool { - *self == SSPOLR::SS6_HIGH - } - #[doc = "Checks if the value of the field is `SS7_HIGH`"] - #[inline] - pub fn is_ss7_high(&self) -> bool { - *self == SSPOLR::SS7_HIGH - } - } - #[doc = "Possible values of the field `SRPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRPOLR { - #[doc = "SR0 active high."] - SR0_HIGH, - #[doc = "SR1 active high."] - SR1_HIGH, - #[doc = "SR2 active high."] - SR2_HIGH, - #[doc = "SR3 active high."] - SR3_HIGH, - #[doc = "SR4 active high."] - SR4_HIGH, - #[doc = "SR5 active high."] - SR5_HIGH, - #[doc = "SR6 active high."] - SR6_HIGH, - #[doc = "SR7 active high."] - SR7_HIGH, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SRPOLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SRPOLR::SR0_HIGH => 0x01, - SRPOLR::SR1_HIGH => 0x02, - SRPOLR::SR2_HIGH => 0x04, - SRPOLR::SR3_HIGH => 0x08, - SRPOLR::SR4_HIGH => 0x10, - SRPOLR::SR5_HIGH => 0x20, - SRPOLR::SR6_HIGH => 0x40, - SRPOLR::SR7_HIGH => 0x80, - SRPOLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SRPOLR { - match value { - 1 => SRPOLR::SR0_HIGH, - 2 => SRPOLR::SR1_HIGH, - 4 => SRPOLR::SR2_HIGH, - 8 => SRPOLR::SR3_HIGH, - 16 => SRPOLR::SR4_HIGH, - 32 => SRPOLR::SR5_HIGH, - 64 => SRPOLR::SR6_HIGH, - 128 => SRPOLR::SR7_HIGH, - i => SRPOLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SR0_HIGH`"] - #[inline] - pub fn is_sr0_high(&self) -> bool { - *self == SRPOLR::SR0_HIGH - } - #[doc = "Checks if the value of the field is `SR1_HIGH`"] - #[inline] - pub fn is_sr1_high(&self) -> bool { - *self == SRPOLR::SR1_HIGH - } - #[doc = "Checks if the value of the field is `SR2_HIGH`"] - #[inline] - pub fn is_sr2_high(&self) -> bool { - *self == SRPOLR::SR2_HIGH - } - #[doc = "Checks if the value of the field is `SR3_HIGH`"] - #[inline] - pub fn is_sr3_high(&self) -> bool { - *self == SRPOLR::SR3_HIGH - } - #[doc = "Checks if the value of the field is `SR4_HIGH`"] - #[inline] - pub fn is_sr4_high(&self) -> bool { - *self == SRPOLR::SR4_HIGH - } - #[doc = "Checks if the value of the field is `SR5_HIGH`"] - #[inline] - pub fn is_sr5_high(&self) -> bool { - *self == SRPOLR::SR5_HIGH - } - #[doc = "Checks if the value of the field is `SR6_HIGH`"] - #[inline] - pub fn is_sr6_high(&self) -> bool { - *self == SRPOLR::SR6_HIGH - } - #[doc = "Checks if the value of the field is `SR7_HIGH`"] - #[inline] - pub fn is_sr7_high(&self) -> bool { - *self == SRPOLR::SR7_HIGH - } - } - #[doc = r" Proxy"] - pub struct _CPHAW<'a> { - w: &'a mut W, - } - impl<'a> _CPHAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CPOLW<'a> { - w: &'a mut W, - } - impl<'a> _CPOLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCLK_FB_INV`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_FB_INVW { - #[doc = "SCLK is not inverted to Line Receiver."] - NON_INV, - #[doc = "SCLK is inverted to Line Receiver."] - INV, - } - impl SCLK_FB_INVW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCLK_FB_INVW::NON_INV => false, - SCLK_FB_INVW::INV => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCLK_FB_INVW<'a> { - w: &'a mut W, - } - impl<'a> _SCLK_FB_INVW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCLK_FB_INVW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SCLK is not inverted to Line Receiver."] - #[inline] - pub fn non_inv(self) -> &'a mut W { - self.variant(SCLK_FB_INVW::NON_INV) - } - #[doc = "SCLK is inverted to Line Receiver."] - #[inline] - pub fn inv(self) -> &'a mut W { - self.variant(SCLK_FB_INVW::INV) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NUMBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NUMBITSW { - #[doc = "16 bits per character."] - _0, - } - impl NUMBITSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - NUMBITSW::_0 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _NUMBITSW<'a> { - w: &'a mut W, - } - impl<'a> _NUMBITSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NUMBITSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "16 bits per character."] - #[inline] - pub fn _0(self) -> &'a mut W { - self.variant(NUMBITSW::_0) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHW { - #[doc = "1 data pin."] - MONO, - #[doc = "2 data pins."] - DUAL, - #[doc = "4 data pins."] - QUAD, - } - impl DATA_WIDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - DATA_WIDTHW::MONO => 0, - DATA_WIDTHW::DUAL => 1, - DATA_WIDTHW::QUAD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _DATA_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_WIDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DATA_WIDTHW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "1 data pin."] - #[inline] - pub fn mono(self) -> &'a mut W { - self.variant(DATA_WIDTHW::MONO) - } - #[doc = "2 data pins."] - #[inline] - pub fn dual(self) -> &'a mut W { - self.variant(DATA_WIDTHW::DUAL) - } - #[doc = "4 data pins."] - #[inline] - pub fn quad(self) -> &'a mut W { - self.variant(DATA_WIDTHW::QUAD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `THREE_WIRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum THREE_WIREW { - #[doc = "Use four wire mode (Mono only)."] - DIS, - #[doc = "Use three wire mode."] - EN, - } - impl THREE_WIREW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - THREE_WIREW::DIS => false, - THREE_WIREW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _THREE_WIREW<'a> { - w: &'a mut W, - } - impl<'a> _THREE_WIREW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: THREE_WIREW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Use four wire mode (Mono only)."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(THREE_WIREW::DIS) - } - #[doc = "Use three wire mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(THREE_WIREW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSPOLW { - #[doc = "SS0 active high."] - SS0_HIGH, - #[doc = "SS1 active high."] - SS1_HIGH, - #[doc = "SS2 active high."] - SS2_HIGH, - #[doc = "SS3 active high."] - SS3_HIGH, - #[doc = "SS4 active high."] - SS4_HIGH, - #[doc = "SS5 active high."] - SS5_HIGH, - #[doc = "SS6 active high."] - SS6_HIGH, - #[doc = "SS7 active high."] - SS7_HIGH, - } - impl SSPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSPOLW::SS0_HIGH => 1, - SSPOLW::SS1_HIGH => 2, - SSPOLW::SS2_HIGH => 4, - SSPOLW::SS3_HIGH => 8, - SSPOLW::SS4_HIGH => 16, - SSPOLW::SS5_HIGH => 32, - SSPOLW::SS6_HIGH => 64, - SSPOLW::SS7_HIGH => 128, - } - } - } - #[doc = r" Proxy"] - pub struct _SSPOLW<'a> { - w: &'a mut W, - } - impl<'a> _SSPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSPOLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SS0 active high."] - #[inline] - pub fn ss0_high(self) -> &'a mut W { - self.variant(SSPOLW::SS0_HIGH) - } - #[doc = "SS1 active high."] - #[inline] - pub fn ss1_high(self) -> &'a mut W { - self.variant(SSPOLW::SS1_HIGH) - } - #[doc = "SS2 active high."] - #[inline] - pub fn ss2_high(self) -> &'a mut W { - self.variant(SSPOLW::SS2_HIGH) - } - #[doc = "SS3 active high."] - #[inline] - pub fn ss3_high(self) -> &'a mut W { - self.variant(SSPOLW::SS3_HIGH) - } - #[doc = "SS4 active high."] - #[inline] - pub fn ss4_high(self) -> &'a mut W { - self.variant(SSPOLW::SS4_HIGH) - } - #[doc = "SS5 active high."] - #[inline] - pub fn ss5_high(self) -> &'a mut W { - self.variant(SSPOLW::SS5_HIGH) - } - #[doc = "SS6 active high."] - #[inline] - pub fn ss6_high(self) -> &'a mut W { - self.variant(SSPOLW::SS6_HIGH) - } - #[doc = "SS7 active high."] - #[inline] - pub fn ss7_high(self) -> &'a mut W { - self.variant(SSPOLW::SS7_HIGH) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRPOLW { - #[doc = "SR0 active high."] - SR0_HIGH, - #[doc = "SR1 active high."] - SR1_HIGH, - #[doc = "SR2 active high."] - SR2_HIGH, - #[doc = "SR3 active high."] - SR3_HIGH, - #[doc = "SR4 active high."] - SR4_HIGH, - #[doc = "SR5 active high."] - SR5_HIGH, - #[doc = "SR6 active high."] - SR6_HIGH, - #[doc = "SR7 active high."] - SR7_HIGH, - } - impl SRPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SRPOLW::SR0_HIGH => 1, - SRPOLW::SR1_HIGH => 2, - SRPOLW::SR2_HIGH => 4, - SRPOLW::SR3_HIGH => 8, - SRPOLW::SR4_HIGH => 16, - SRPOLW::SR5_HIGH => 32, - SRPOLW::SR6_HIGH => 64, - SRPOLW::SR7_HIGH => 128, - } - } - } - #[doc = r" Proxy"] - pub struct _SRPOLW<'a> { - w: &'a mut W, - } - impl<'a> _SRPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRPOLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SR0 active high."] - #[inline] - pub fn sr0_high(self) -> &'a mut W { - self.variant(SRPOLW::SR0_HIGH) - } - #[doc = "SR1 active high."] - #[inline] - pub fn sr1_high(self) -> &'a mut W { - self.variant(SRPOLW::SR1_HIGH) - } - #[doc = "SR2 active high."] - #[inline] - pub fn sr2_high(self) -> &'a mut W { - self.variant(SRPOLW::SR2_HIGH) - } - #[doc = "SR3 active high."] - #[inline] - pub fn sr3_high(self) -> &'a mut W { - self.variant(SRPOLW::SR3_HIGH) - } - #[doc = "SR4 active high."] - #[inline] - pub fn sr4_high(self) -> &'a mut W { - self.variant(SRPOLW::SR4_HIGH) - } - #[doc = "SR5 active high."] - #[inline] - pub fn sr5_high(self) -> &'a mut W { - self.variant(SRPOLW::SR5_HIGH) - } - #[doc = "SR6 active high."] - #[inline] - pub fn sr6_high(self) -> &'a mut W { - self.variant(SRPOLW::SR6_HIGH) - } - #[doc = "SR7 active high."] - #[inline] - pub fn sr7_high(self) -> &'a mut W { - self.variant(SRPOLW::SR7_HIGH) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Clock Phase."] - #[inline] - pub fn cpha(&self) -> CPHAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPHAR { bits } - } - #[doc = "Bit 1 - Clock Polarity."] - #[inline] - pub fn cpol(&self) -> CPOLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CPOLR { bits } - } - #[doc = "Bit 4 - Invert SCLK Feedback in Master Mode."] - #[inline] - pub fn sclk_fb_inv(&self) -> SCLK_FB_INVR { - SCLK_FB_INVR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - Number of Bits per character."] - #[inline] - pub fn numbits(&self) -> NUMBITSR { - NUMBITSR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 12:13 - SPI Data width."] - #[inline] - pub fn data_width(&self) -> DATA_WIDTHR { - DATA_WIDTHR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 15 - Three Wire mode. MOSI/MISO pin(s) shared. Only Mono mode suports Four-Wire."] - #[inline] - pub fn three_wire(&self) -> THREE_WIRER { - THREE_WIRER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:23 - Slave Select Polarity, each Slave Select can have unique polarity."] - #[inline] - pub fn sspol(&self) -> SSPOLR { - SSPOLR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 24:31 - Slave Ready Polarity, each Slave Ready can have unique polarity."] - #[inline] - pub fn srpol(&self) -> SRPOLR { - SRPOLR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Clock Phase."] - #[inline] - pub fn cpha(&mut self) -> _CPHAW { - _CPHAW { w: self } - } - #[doc = "Bit 1 - Clock Polarity."] - #[inline] - pub fn cpol(&mut self) -> _CPOLW { - _CPOLW { w: self } - } - #[doc = "Bit 4 - Invert SCLK Feedback in Master Mode."] - #[inline] - pub fn sclk_fb_inv(&mut self) -> _SCLK_FB_INVW { - _SCLK_FB_INVW { w: self } - } - #[doc = "Bits 8:11 - Number of Bits per character."] - #[inline] - pub fn numbits(&mut self) -> _NUMBITSW { - _NUMBITSW { w: self } - } - #[doc = "Bits 12:13 - SPI Data width."] - #[inline] - pub fn data_width(&mut self) -> _DATA_WIDTHW { - _DATA_WIDTHW { w: self } - } - #[doc = "Bit 15 - Three Wire mode. MOSI/MISO pin(s) shared. Only Mono mode suports Four-Wire."] - #[inline] - pub fn three_wire(&mut self) -> _THREE_WIREW { - _THREE_WIREW { w: self } - } - #[doc = "Bits 16:23 - Slave Select Polarity, each Slave Select can have unique polarity."] - #[inline] - pub fn sspol(&mut self) -> _SSPOLW { - _SSPOLW { w: self } - } - #[doc = "Bits 24:31 - Slave Ready Polarity, each Slave Ready can have unique polarity."] - #[inline] - pub fn srpol(&mut self) -> _SRPOLW { - _SRPOLW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL4 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL4 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SSACT1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACT1R { - #[doc = "256 system clocks between SS active and first serial clock edge."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSACT1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSACT1R::_256 => 0, - SSACT1R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSACT1R { - match value { - 0 => SSACT1R::_256, - i => SSACT1R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == SSACT1R::_256 - } - } - #[doc = "Possible values of the field `SSACT2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACT2R { - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSACT2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSACT2R::_256 => 0, - SSACT2R::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSACT2R { - match value { - 0 => SSACT2R::_256, - i => SSACT2R::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == SSACT2R::_256 - } - } - #[doc = "Possible values of the field `SSINACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSINACTR { - #[doc = "256 system clocks between transactions."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSINACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSINACTR::_256 => 0, - SSINACTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSINACTR { - match value { - 0 => SSINACTR::_256, - i => SSINACTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == SSINACTR::_256 - } - } - #[doc = "Values that can be written to the field `SSACT1`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACT1W { - #[doc = "256 system clocks between SS active and first serial clock edge."] - _256, - } - impl SSACT1W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSACT1W::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _SSACT1W<'a> { - w: &'a mut W, - } - impl<'a> _SSACT1W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSACT1W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between SS active and first serial clock edge."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(SSACT1W::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSACT2`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACT2W { - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - _256, - } - impl SSACT2W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSACT2W::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _SSACT2W<'a> { - w: &'a mut W, - } - impl<'a> _SSACT2W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSACT2W) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(SSACT2W::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSINACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSINACTW { - #[doc = "256 system clocks between transactions."] - _256, - } - impl SSINACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSINACTW::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _SSINACTW<'a> { - w: &'a mut W, - } - impl<'a> _SSINACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSINACTW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between transactions."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(SSINACTW::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Slave Select Action delay 1."] - #[inline] - pub fn ssact1(&self) -> SSACT1R { - SSACT1R::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:15 - Slave Select Action delay 2."] - #[inline] - pub fn ssact2(&self) -> SSACT2R { - SSACT2R::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:23 - Slave Select Inactive delay."] - #[inline] - pub fn ssinact(&self) -> SSINACTR { - SSINACTR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Slave Select Action delay 1."] - #[inline] - pub fn ssact1(&mut self) -> _SSACT1W { - _SSACT1W { w: self } - } - #[doc = "Bits 8:15 - Slave Select Action delay 2."] - #[inline] - pub fn ssact2(&mut self) -> _SSACT2W { - _SSACT2W { w: self } - } - #[doc = "Bits 16:23 - Slave Select Inactive delay."] - #[inline] - pub fn ssinact(&mut self) -> _SSINACTW { - _SSINACTW { w: self } - } - } - } - #[doc = "Register for controlling SPI clock rate."] - pub struct BRG_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI clock rate."] - pub mod brg_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BRG_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `LOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOWR { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl LOWR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - LOWR::DIS => 0, - LOWR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> LOWR { - match value { - 0 => LOWR::DIS, - i => LOWR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LOWR::DIS - } - } - #[doc = "Possible values of the field `HI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIR { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl HIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - HIR::DIS => 0, - HIR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> HIR { - match value { - 0 => HIR::DIS, - i => HIR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == HIR::DIS - } - } - #[doc = r" Value of the field"] - pub struct SCALER { - bits: u8, - } - impl SCALER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `LOW`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOWW { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - } - impl LOWW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - LOWW::DIS => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _LOWW<'a> { - w: &'a mut W, - } - impl<'a> _LOWW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOWW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Duty cycle control of serial clock generation is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LOWW::DIS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIW { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - } - impl HIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - HIW::DIS => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _HIW<'a> { - w: &'a mut W, - } - impl<'a> _HIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HIW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Duty cycle control of serial clock generation is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(HIW::DIS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCALEW<'a> { - w: &'a mut W, - } - impl<'a> _SCALEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn low(&self) -> LOWR { - LOWR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:15 - High duty cycle control. In timer mode, reload\\[15:8\\]."] - #[inline] - pub fn hi(&self) -> HIR { - HIR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:19 - System Clock scale factor. Scales the AMBA clock by 2^SCALE before generating serial clock."] - #[inline] - pub fn scale(&self) -> SCALER { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - SCALER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn low(&mut self) -> _LOWW { - _LOWW { w: self } - } - #[doc = "Bits 8:15 - High duty cycle control. In timer mode, reload\\[15:8\\]."] - #[inline] - pub fn hi(&mut self) -> _HIW { - _HIW { w: self } - } - #[doc = "Bits 16:19 - System Clock scale factor. Scales the AMBA clock by 2^SCALE before generating serial clock."] - #[inline] - pub fn scale(&mut self) -> _SCALEW { - _SCALEW { w: self } - } - } - } - #[doc = "Register for controlling I2C mode."] - pub struct I2S_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling I2C mode."] - pub mod i2s_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::I2S_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `I2S_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_ENR { - #[doc = "I2C mode is disabled."] - DIS, - #[doc = "I2C mode is enabled."] - EN, - } - impl I2S_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2S_ENR::DIS => false, - I2S_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2S_ENR { - match value { - false => I2S_ENR::DIS, - true => I2S_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2S_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2S_ENR::EN - } - } - #[doc = "Possible values of the field `I2S_MUTE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_MUTER { - #[doc = "Normal Transmit."] - DIS, - #[doc = "Transmit data is replaced with 0."] - EN, - } - impl I2S_MUTER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2S_MUTER::DIS => false, - I2S_MUTER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2S_MUTER { - match value { - false => I2S_MUTER::DIS, - true => I2S_MUTER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2S_MUTER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2S_MUTER::EN - } - } - #[doc = "Possible values of the field `I2S_PAUSE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_PAUSER { - #[doc = "Normal Transmit/Receive."] - DIS, - #[doc = "Halt Transmit and Receive FIFO and DMA accesses, Transmit 0s."] - EN, - } - impl I2S_PAUSER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2S_PAUSER::DIS => false, - I2S_PAUSER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2S_PAUSER { - match value { - false => I2S_PAUSER::DIS, - true => I2S_PAUSER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2S_PAUSER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2S_PAUSER::EN - } - } - #[doc = "Possible values of the field `I2S_MONO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_MONOR { - #[doc = "Stereophonic audio format."] - DIS, - #[doc = "Monophonic audio format. Each transmit\n\t\t\t\t\t\t\t\tdata word is replicated on both left/right\n\t\t\t\t\t\t\t\tchannels. Receive data is taken from left\n\t\t\t\t\t\t\t\tchannel, right channel receive data is\n\t\t\t\t\t\t\t\tignored."] - EN, - } - impl I2S_MONOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2S_MONOR::DIS => false, - I2S_MONOR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2S_MONOR { - match value { - false => I2S_MONOR::DIS, - true => I2S_MONOR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2S_MONOR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2S_MONOR::EN - } - } - #[doc = "Possible values of the field `I2S_LJ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_LJR { - #[doc = "Normal I 2 S audio protocol, audio data\n\t\t\t\t\t\t\t\tlags left/right channel signal by one SCLK\n\t\t\t\t\t\t\t\tperiod."] - DIS, - #[doc = "Audio data is synchronized with SSEL\n\t\t\t\t\t\t\t\t(left/right channel signal)."] - EN, - } - impl I2S_LJR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - I2S_LJR::DIS => false, - I2S_LJR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> I2S_LJR { - match value { - false => I2S_LJR::DIS, - true => I2S_LJR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == I2S_LJR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == I2S_LJR::EN - } - } - #[doc = "Values that can be written to the field `I2S_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_ENW { - #[doc = "I2C mode is disabled."] - DIS, - #[doc = "I2C mode is enabled."] - EN, - } - impl I2S_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2S_ENW::DIS => false, - I2S_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2S_ENW<'a> { - w: &'a mut W, - } - impl<'a> _I2S_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2S_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "I2C mode is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2S_ENW::DIS) - } - #[doc = "I2C mode is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2S_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2S_MUTE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_MUTEW { - #[doc = "Normal Transmit."] - DIS, - #[doc = "Transmit data is replaced with 0."] - EN, - } - impl I2S_MUTEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2S_MUTEW::DIS => false, - I2S_MUTEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2S_MUTEW<'a> { - w: &'a mut W, - } - impl<'a> _I2S_MUTEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2S_MUTEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Transmit."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2S_MUTEW::DIS) - } - #[doc = "Transmit data is replaced with 0."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2S_MUTEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2S_PAUSE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_PAUSEW { - #[doc = "Normal Transmit/Receive."] - DIS, - #[doc = "Halt Transmit and Receive FIFO and DMA accesses, Transmit 0s."] - EN, - } - impl I2S_PAUSEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2S_PAUSEW::DIS => false, - I2S_PAUSEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2S_PAUSEW<'a> { - w: &'a mut W, - } - impl<'a> _I2S_PAUSEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2S_PAUSEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Transmit/Receive."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2S_PAUSEW::DIS) - } - #[doc = "Halt Transmit and Receive FIFO and DMA accesses, Transmit 0s."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2S_PAUSEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2S_MONO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_MONOW { - #[doc = "Stereophonic audio format."] - DIS, - #[doc = "Monophonic audio format. Each transmit\n\t\t\t\t\t\t\t\tdata word is replicated on both left/right\n\t\t\t\t\t\t\t\tchannels. Receive data is taken from left\n\t\t\t\t\t\t\t\tchannel, right channel receive data is\n\t\t\t\t\t\t\t\tignored."] - EN, - } - impl I2S_MONOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2S_MONOW::DIS => false, - I2S_MONOW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2S_MONOW<'a> { - w: &'a mut W, - } - impl<'a> _I2S_MONOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2S_MONOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Stereophonic audio format."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2S_MONOW::DIS) - } - #[doc = "Monophonic audio format. Each transmit data word is replicated on both left/right channels. Receive data is taken from left channel, right channel receive data is ignored."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2S_MONOW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `I2S_LJ`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum I2S_LJW { - #[doc = "Normal I 2 S audio protocol, audio data\n\t\t\t\t\t\t\t\tlags left/right channel signal by one SCLK\n\t\t\t\t\t\t\t\tperiod."] - DIS, - #[doc = "Audio data is synchronized with SSEL\n\t\t\t\t\t\t\t\t(left/right channel signal)."] - EN, - } - impl I2S_LJW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - I2S_LJW::DIS => false, - I2S_LJW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _I2S_LJW<'a> { - w: &'a mut W, - } - impl<'a> _I2S_LJW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: I2S_LJW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal I 2 S audio protocol, audio data lags left/right channel signal by one SCLK period."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(I2S_LJW::DIS) - } - #[doc = "Audio data is synchronized with SSEL (left/right channel signal)."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(I2S_LJW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn i2s_en(&self) -> I2S_ENR { - I2S_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - I2S Mute."] - #[inline] - pub fn i2s_mute(&self) -> I2S_MUTER { - I2S_MUTER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - I2S Pause."] - #[inline] - pub fn i2s_pause(&self) -> I2S_PAUSER { - I2S_PAUSER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - I2S Monotone."] - #[inline] - pub fn i2s_mono(&self) -> I2S_MONOR { - I2S_MONOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - I2S Left Justify."] - #[inline] - pub fn i2s_lj(&self) -> I2S_LJR { - I2S_LJR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn i2s_en(&mut self) -> _I2S_ENW { - _I2S_ENW { w: self } - } - #[doc = "Bit 1 - I2S Mute."] - #[inline] - pub fn i2s_mute(&mut self) -> _I2S_MUTEW { - _I2S_MUTEW { w: self } - } - #[doc = "Bit 2 - I2S Pause."] - #[inline] - pub fn i2s_pause(&mut self) -> _I2S_PAUSEW { - _I2S_PAUSEW { w: self } - } - #[doc = "Bit 3 - I2S Monotone."] - #[inline] - pub fn i2s_mono(&mut self) -> _I2S_MONOW { - _I2S_MONOW { w: self } - } - #[doc = "Bit 4 - I2S Left Justify."] - #[inline] - pub fn i2s_lj(&mut self) -> _I2S_LJW { - _I2S_LJW { w: self } - } - } - } - #[doc = "Register for controlling DMA."] - pub struct DMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling DMA."] - pub mod dma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_LEVELR { - bits: u8, - } - impl TX_FIFO_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENR { - #[doc = "Transmit FIFO is not enabled."] - DIS, - #[doc = "Transmit FIFO is enabled."] - EN, - } - impl TX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_ENR::DIS => false, - TX_FIFO_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_ENR { - match value { - false => TX_FIFO_ENR::DIS, - true => TX_FIFO_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_FIFO_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_FIFO_ENR::EN - } - } - #[doc = "Possible values of the field `TX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_CLEARR { - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_FIFO_CLEARR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_CLEARR::CLEAR => true, - TX_FIFO_CLEARR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_CLEARR { - match value { - true => TX_FIFO_CLEARR::CLEAR, - i => TX_FIFO_CLEARR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_FIFO_CLEARR::CLEAR - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_CNTR { - bits: u8, - } - impl TX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `TX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_DMA_ENR { - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - DIS, - #[doc = "TX DMA requests are enabled."] - EN, - } - impl TX_DMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_DMA_ENR::DIS => false, - TX_DMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_DMA_ENR { - match value { - false => TX_DMA_ENR::DIS, - true => TX_DMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_DMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_DMA_ENR::EN - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_LEVELR { - bits: u8, - } - impl RX_FIFO_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENR { - #[doc = "Receive FIFO is not enabled."] - DIS, - #[doc = "Receive FIFO is enabled."] - EN, - } - impl RX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_ENR::DIS => false, - RX_FIFO_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_ENR { - match value { - false => RX_FIFO_ENR::DIS, - true => RX_FIFO_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FIFO_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FIFO_ENR::EN - } - } - #[doc = "Possible values of the field `RX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_CLEARR { - #[doc = "Clear the Receive FIFIO, clears any pending RX FIFO status."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FIFO_CLEARR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_CLEARR::CLEAR => true, - RX_FIFO_CLEARR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_CLEARR { - match value { - true => RX_FIFO_CLEARR::CLEAR, - i => RX_FIFO_CLEARR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FIFO_CLEARR::CLEAR - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_CNTR { - bits: u8, - } - impl RX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DMA_ENR { - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - DIS, - #[doc = "RX DMA requests are enabled."] - EN, - } - impl RX_DMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_DMA_ENR::DIS => false, - RX_DMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_DMA_ENR { - match value { - false => RX_DMA_ENR::DIS, - true => RX_DMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_DMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_DMA_ENR::EN - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENW { - #[doc = "Transmit FIFO is not enabled."] - DIS, - #[doc = "Transmit FIFO is enabled."] - EN, - } - impl TX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_ENW::DIS => false, - TX_FIFO_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Transmit FIFO is not enabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::DIS) - } - #[doc = "Transmit FIFO is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_CLEARW { - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - CLEAR, - } - impl TX_FIFO_CLEARW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_CLEARW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_CLEARW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_CLEARW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_CLEARW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_FIFO_CLEARW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_CNTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_DMA_ENW { - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - DIS, - #[doc = "TX DMA requests are enabled."] - EN, - } - impl TX_DMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_DMA_ENW::DIS => false, - TX_DMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_DMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_DMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_DMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_DMA_ENW::DIS) - } - #[doc = "TX DMA requests are enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_DMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENW { - #[doc = "Receive FIFO is not enabled."] - DIS, - #[doc = "Receive FIFO is enabled."] - EN, - } - impl RX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_ENW::DIS => false, - RX_FIFO_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Receive FIFO is not enabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::DIS) - } - #[doc = "Receive FIFO is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_CLEARW { - #[doc = "Clear the Receive FIFIO, clears any pending RX FIFO status."] - CLEAR, - } - impl RX_FIFO_CLEARW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_CLEARW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_CLEARW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_CLEARW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_CLEARW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clear the Receive FIFIO, clears any pending RX FIFO status."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FIFO_CLEARW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_CNTW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DMA_ENW { - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - DIS, - #[doc = "RX DMA requests are enabled."] - EN, - } - impl RX_DMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_DMA_ENW::DIS => false, - RX_DMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_DMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_DMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_DMA_ENW::DIS) - } - #[doc = "RX DMA requests are enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_DMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:5 - Transmit FIFO level that will trigger a DMA request, also level for threshold status. When TX FIFO has fewer than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn tx_fifo_level(&self) -> TX_FIFO_LEVELR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_LEVELR { bits } - } - #[doc = "Bit 6 - Transmit FIFO enabled for SPI transactions."] - #[inline] - pub fn tx_fifo_en(&self) -> TX_FIFO_ENR { - TX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Clear TX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn tx_fifo_clear(&self) -> TX_FIFO_CLEARR { - TX_FIFO_CLEARR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:12 - Count of entries in TX FIFO."] - #[inline] - pub fn tx_fifo_cnt(&self) -> TX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_CNTR { bits } - } - #[doc = "Bit 15 - TX DMA Enable."] - #[inline] - pub fn tx_dma_en(&self) -> TX_DMA_ENR { - TX_DMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:21 - Receive FIFO level that will trigger a DMA request, also level for threshold status. When RX FIFO has more than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn rx_fifo_level(&self) -> RX_FIFO_LEVELR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_LEVELR { bits } - } - #[doc = "Bit 22 - Receive FIFO enabled for SPI transactions."] - #[inline] - pub fn rx_fifo_en(&self) -> RX_FIFO_ENR { - RX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - Clear RX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn rx_fifo_clear(&self) -> RX_FIFO_CLEARR { - RX_FIFO_CLEARR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 24:29 - Count of entries in RX FIFO."] - #[inline] - pub fn rx_fifo_cnt(&self) -> RX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_CNTR { bits } - } - #[doc = "Bit 31 - RX DMA Enable."] - #[inline] - pub fn rx_dma_en(&self) -> RX_DMA_ENR { - RX_DMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:5 - Transmit FIFO level that will trigger a DMA request, also level for threshold status. When TX FIFO has fewer than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn tx_fifo_level(&mut self) -> _TX_FIFO_LEVELW { - _TX_FIFO_LEVELW { w: self } - } - #[doc = "Bit 6 - Transmit FIFO enabled for SPI transactions."] - #[inline] - pub fn tx_fifo_en(&mut self) -> _TX_FIFO_ENW { - _TX_FIFO_ENW { w: self } - } - #[doc = "Bit 7 - Clear TX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn tx_fifo_clear(&mut self) -> _TX_FIFO_CLEARW { - _TX_FIFO_CLEARW { w: self } - } - #[doc = "Bits 8:12 - Count of entries in TX FIFO."] - #[inline] - pub fn tx_fifo_cnt(&mut self) -> _TX_FIFO_CNTW { - _TX_FIFO_CNTW { w: self } - } - #[doc = "Bit 15 - TX DMA Enable."] - #[inline] - pub fn tx_dma_en(&mut self) -> _TX_DMA_ENW { - _TX_DMA_ENW { w: self } - } - #[doc = "Bits 16:21 - Receive FIFO level that will trigger a DMA request, also level for threshold status. When RX FIFO has more than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn rx_fifo_level(&mut self) -> _RX_FIFO_LEVELW { - _RX_FIFO_LEVELW { w: self } - } - #[doc = "Bit 22 - Receive FIFO enabled for SPI transactions."] - #[inline] - pub fn rx_fifo_en(&mut self) -> _RX_FIFO_ENW { - _RX_FIFO_ENW { w: self } - } - #[doc = "Bit 23 - Clear RX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn rx_fifo_clear(&mut self) -> _RX_FIFO_CLEARW { - _RX_FIFO_CLEARW { w: self } - } - #[doc = "Bits 24:29 - Count of entries in RX FIFO."] - #[inline] - pub fn rx_fifo_cnt(&mut self) -> _RX_FIFO_CNTW { - _RX_FIFO_CNTW { w: self } - } - #[doc = "Bit 31 - RX DMA Enable."] - #[inline] - pub fn rx_dma_en(&mut self) -> _RX_DMA_ENW { - _RX_DMA_ENW { w: self } - } - } - } - #[doc = "Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub struct IRQ { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub mod irq { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IRQ { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::CLEAR => true, - TX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - true => TX_THRESHR::CLEAR, - i => TX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::CLEAR => true, - TX_EMPTYR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - true => TX_EMPTYR::CLEAR, - i => TX_EMPTYR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_EMPTYR::CLEAR - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::CLEAR => true, - RX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - true => RX_THRESHR::CLEAR, - i => RX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::CLEAR => true, - RX_FULLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - true => RX_FULLR::CLEAR, - i => RX_FULLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FULLR::CLEAR - } - } - #[doc = "Possible values of the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SSAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSAR::CLEAR => true, - SSAR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSAR { - match value { - true => SSAR::CLEAR, - i => SSAR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SSAR::CLEAR - } - } - #[doc = "Possible values of the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSDR::CLEAR => true, - SSDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSDR { - match value { - true => SSDR::CLEAR, - i => SSDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SSDR::CLEAR - } - } - #[doc = "Possible values of the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl FAULTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FAULTR::CLEAR => true, - FAULTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FAULTR { - match value { - true => FAULTR::CLEAR, - i => FAULTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == FAULTR::CLEAR - } - } - #[doc = "Possible values of the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl ABORTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ABORTR::CLEAR => true, - ABORTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ABORTR { - match value { - true => ABORTR::CLEAR, - i => ABORTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == ABORTR::CLEAR - } - } - #[doc = "Possible values of the field `TIMEOUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMEOUTR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TIMEOUTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TIMEOUTR::CLEAR => true, - TIMEOUTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TIMEOUTR { - match value { - true => TIMEOUTR::CLEAR, - i => TIMEOUTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TIMEOUTR::CLEAR - } - } - #[doc = "Possible values of the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONER { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl M_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - M_DONER::CLEAR => true, - M_DONER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> M_DONER { - match value { - true => M_DONER::CLEAR, - i => M_DONER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == M_DONER::CLEAR - } - } - #[doc = "Possible values of the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_OVRR::CLEAR => true, - TX_OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_OVRR { - match value { - true => TX_OVRR::CLEAR, - i => TX_OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_OVRR::CLEAR - } - } - #[doc = "Possible values of the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDR::CLEAR => true, - TX_UNDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDR { - match value { - true => TX_UNDR::CLEAR, - i => TX_UNDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_UNDR::CLEAR - } - } - #[doc = "Possible values of the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVRR::CLEAR => true, - RX_OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVRR { - match value { - true => RX_OVRR::CLEAR, - i => RX_OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_OVRR::CLEAR - } - } - #[doc = "Possible values of the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_UNDR::CLEAR => true, - RX_UNDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_UNDR { - match value { - true => RX_UNDR::CLEAR, - i => RX_UNDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_UNDR::CLEAR - } - } - #[doc = "Possible values of the field `SR0A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR0AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR0AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR0AR::CLEAR => true, - SR0AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR0AR { - match value { - true => SR0AR::CLEAR, - i => SR0AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR0AR::CLEAR - } - } - #[doc = "Possible values of the field `SR1A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR1AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR1AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR1AR::CLEAR => true, - SR1AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR1AR { - match value { - true => SR1AR::CLEAR, - i => SR1AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR1AR::CLEAR - } - } - #[doc = "Possible values of the field `SR2A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR2AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR2AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR2AR::CLEAR => true, - SR2AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR2AR { - match value { - true => SR2AR::CLEAR, - i => SR2AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR2AR::CLEAR - } - } - #[doc = "Possible values of the field `SR3A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR3AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR3AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR3AR::CLEAR => true, - SR3AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR3AR { - match value { - true => SR3AR::CLEAR, - i => SR3AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR3AR::CLEAR - } - } - #[doc = "Possible values of the field `SR4A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR4AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR4AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR4AR::CLEAR => true, - SR4AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR4AR { - match value { - true => SR4AR::CLEAR, - i => SR4AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR4AR::CLEAR - } - } - #[doc = "Possible values of the field `SR5A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR5AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR5AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR5AR::CLEAR => true, - SR5AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR5AR { - match value { - true => SR5AR::CLEAR, - i => SR5AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR5AR::CLEAR - } - } - #[doc = "Possible values of the field `SR6A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR6AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR6AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR6AR::CLEAR => true, - SR6AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR6AR { - match value { - true => SR6AR::CLEAR, - i => SR6AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR6AR::CLEAR - } - } - #[doc = "Possible values of the field `SR7A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR7AR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SR7AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR7AR::CLEAR => true, - SR7AR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR7AR { - match value { - true => SR7AR::CLEAR, - i => SR7AR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SR7AR::CLEAR - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_EMPTYW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FULLW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SSAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSAW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSAW<'a> { - w: &'a mut W, - } - impl<'a> _SSAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SSAW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSDW<'a> { - w: &'a mut W, - } - impl<'a> _SSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SSDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl FAULTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FAULTW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FAULTW<'a> { - w: &'a mut W, - } - impl<'a> _FAULTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FAULTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(FAULTW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl ABORTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ABORTW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ABORTW<'a> { - w: &'a mut W, - } - impl<'a> _ABORTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ABORTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(ABORTW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TIMEOUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMEOUTW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TIMEOUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TIMEOUTW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TIMEOUTW<'a> { - w: &'a mut W, - } - impl<'a> _TIMEOUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TIMEOUTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TIMEOUTW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONEW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl M_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - M_DONEW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _M_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _M_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: M_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(M_DONEW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_OVRW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _TX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_OVRW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_UNDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVRW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_OVRW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_UNDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_UNDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR0A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR0AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR0AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR0AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR0AW<'a> { - w: &'a mut W, - } - impl<'a> _SR0AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR0AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR0AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR1A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR1AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR1AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR1AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR1AW<'a> { - w: &'a mut W, - } - impl<'a> _SR1AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR1AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR1AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR2A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR2AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR2AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR2AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR2AW<'a> { - w: &'a mut W, - } - impl<'a> _SR2AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR2AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR2AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR3A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR3AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR3AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR3AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR3AW<'a> { - w: &'a mut W, - } - impl<'a> _SR3AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR3AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR3AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR4A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR4AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR4AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR4AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR4AW<'a> { - w: &'a mut W, - } - impl<'a> _SR4AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR4AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR4AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR5A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR5AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR5AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR5AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR5AW<'a> { - w: &'a mut W, - } - impl<'a> _SR5AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR5AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR5AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR6A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR6AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR6AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR6AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR6AW<'a> { - w: &'a mut W, - } - impl<'a> _SR6AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR6AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR6AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR7A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR7AW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SR7AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR7AW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR7AW<'a> { - w: &'a mut W, - } - impl<'a> _SR7AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR7AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SR7AW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - TX FIFO Empty."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - RX FIFO FULL."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select Asserted."] - #[inline] - pub fn ssa(&self) -> SSAR { - SSAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Slave Select Deasserted."] - #[inline] - pub fn ssd(&self) -> SSDR { - SSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Multi-Master Mode Fault."] - #[inline] - pub fn fault(&self) -> FAULTR { - FAULTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Slave Abort Detected."] - #[inline] - pub fn abort(&self) -> ABORTR { - ABORTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Timeout."] - #[inline] - pub fn timeout(&self) -> TIMEOUTR { - TIMEOUTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Master Done, set when SPI Master has completed any transactions."] - #[inline] - pub fn m_done(&self) -> M_DONER { - M_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Transmit FIFO Overrun, set when the AMBA side attempts to write data to a full transmit FIFO."] - #[inline] - pub fn tx_ovr(&self) -> TX_OVRR { - TX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Transmit FIFO Underrun, set when the SPI side attempts to read data from an empty transmit FIFO."] - #[inline] - pub fn tx_und(&self) -> TX_UNDR { - TX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Receive FIFO Overrun, set when the SPI side attempts to write to a full receive FIFO."] - #[inline] - pub fn rx_ovr(&self) -> RX_OVRR { - RX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Receive FIFO Underrun, set when the AMBA side attempts to read data from an empty receive FIFO."] - #[inline] - pub fn rx_und(&self) -> RX_UNDR { - RX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Slave Ready 0 Asserted."] - #[inline] - pub fn sr0a(&self) -> SR0AR { - SR0AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Slave Ready 1 Asserted."] - #[inline] - pub fn sr1a(&self) -> SR1AR { - SR1AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - Slave Ready 2 Asserted."] - #[inline] - pub fn sr2a(&self) -> SR2AR { - SR2AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 19 - Slave Ready 3 Asserted."] - #[inline] - pub fn sr3a(&self) -> SR3AR { - SR3AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - Slave Ready 4 Asserted."] - #[inline] - pub fn sr4a(&self) -> SR4AR { - SR4AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - Slave Ready 5 Asserted."] - #[inline] - pub fn sr5a(&self) -> SR5AR { - SR5AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 22 - Slave Ready 6 Asserted."] - #[inline] - pub fn sr6a(&self) -> SR6AR { - SR6AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - Slave Ready 7 Asserted."] - #[inline] - pub fn sr7a(&self) -> SR7AR { - SR7AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - TX FIFO Empty."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - RX FIFO FULL."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - #[doc = "Bit 4 - Slave Select Asserted."] - #[inline] - pub fn ssa(&mut self) -> _SSAW { - _SSAW { w: self } - } - #[doc = "Bit 5 - Slave Select Deasserted."] - #[inline] - pub fn ssd(&mut self) -> _SSDW { - _SSDW { w: self } - } - #[doc = "Bit 8 - Multi-Master Mode Fault."] - #[inline] - pub fn fault(&mut self) -> _FAULTW { - _FAULTW { w: self } - } - #[doc = "Bit 9 - Slave Abort Detected."] - #[inline] - pub fn abort(&mut self) -> _ABORTW { - _ABORTW { w: self } - } - #[doc = "Bit 10 - Timeout."] - #[inline] - pub fn timeout(&mut self) -> _TIMEOUTW { - _TIMEOUTW { w: self } - } - #[doc = "Bit 11 - Master Done, set when SPI Master has completed any transactions."] - #[inline] - pub fn m_done(&mut self) -> _M_DONEW { - _M_DONEW { w: self } - } - #[doc = "Bit 12 - Transmit FIFO Overrun, set when the AMBA side attempts to write data to a full transmit FIFO."] - #[inline] - pub fn tx_ovr(&mut self) -> _TX_OVRW { - _TX_OVRW { w: self } - } - #[doc = "Bit 13 - Transmit FIFO Underrun, set when the SPI side attempts to read data from an empty transmit FIFO."] - #[inline] - pub fn tx_und(&mut self) -> _TX_UNDW { - _TX_UNDW { w: self } - } - #[doc = "Bit 14 - Receive FIFO Overrun, set when the SPI side attempts to write to a full receive FIFO."] - #[inline] - pub fn rx_ovr(&mut self) -> _RX_OVRW { - _RX_OVRW { w: self } - } - #[doc = "Bit 15 - Receive FIFO Underrun, set when the AMBA side attempts to read data from an empty receive FIFO."] - #[inline] - pub fn rx_und(&mut self) -> _RX_UNDW { - _RX_UNDW { w: self } - } - #[doc = "Bit 16 - Slave Ready 0 Asserted."] - #[inline] - pub fn sr0a(&mut self) -> _SR0AW { - _SR0AW { w: self } - } - #[doc = "Bit 17 - Slave Ready 1 Asserted."] - #[inline] - pub fn sr1a(&mut self) -> _SR1AW { - _SR1AW { w: self } - } - #[doc = "Bit 18 - Slave Ready 2 Asserted."] - #[inline] - pub fn sr2a(&mut self) -> _SR2AW { - _SR2AW { w: self } - } - #[doc = "Bit 19 - Slave Ready 3 Asserted."] - #[inline] - pub fn sr3a(&mut self) -> _SR3AW { - _SR3AW { w: self } - } - #[doc = "Bit 20 - Slave Ready 4 Asserted."] - #[inline] - pub fn sr4a(&mut self) -> _SR4AW { - _SR4AW { w: self } - } - #[doc = "Bit 21 - Slave Ready 5 Asserted."] - #[inline] - pub fn sr5a(&mut self) -> _SR5AW { - _SR5AW { w: self } - } - #[doc = "Bit 22 - Slave Ready 6 Asserted."] - #[inline] - pub fn sr6a(&mut self) -> _SR6AW { - _SR6AW { w: self } - } - #[doc = "Bit 23 - Slave Ready 7 Asserted."] - #[inline] - pub fn sr7a(&mut self) -> _SR7AW { - _SR7AW { w: self } - } - } - } - #[doc = "Register for enabling interrupts."] - pub struct IRQE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for enabling interrupts."] - pub mod irqe { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IRQE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::DIS => false, - TX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::DIS, - true => TX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_THRESHR::EN - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::DIS => false, - TX_EMPTYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - false => TX_EMPTYR::DIS, - true => TX_EMPTYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_EMPTYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_EMPTYR::EN - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::DIS => false, - RX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::DIS, - true => RX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_THRESHR::EN - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::DIS => false, - RX_FULLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - false => RX_FULLR::DIS, - true => RX_FULLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FULLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FULLR::EN - } - } - #[doc = "Possible values of the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSAR::DIS => false, - SSAR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSAR { - match value { - false => SSAR::DIS, - true => SSAR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SSAR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SSAR::EN - } - } - #[doc = "Possible values of the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSDR::DIS => false, - SSDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSDR { - match value { - false => SSDR::DIS, - true => SSDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SSDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SSDR::EN - } - } - #[doc = "Possible values of the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl FAULTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FAULTR::DIS => false, - FAULTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FAULTR { - match value { - false => FAULTR::DIS, - true => FAULTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FAULTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FAULTR::EN - } - } - #[doc = "Possible values of the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl ABORTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ABORTR::DIS => false, - ABORTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ABORTR { - match value { - false => ABORTR::DIS, - true => ABORTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ABORTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ABORTR::EN - } - } - #[doc = "Possible values of the field `TIMEOUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMEOUTR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TIMEOUTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TIMEOUTR::DIS => false, - TIMEOUTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TIMEOUTR { - match value { - false => TIMEOUTR::DIS, - true => TIMEOUTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TIMEOUTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TIMEOUTR::EN - } - } - #[doc = "Possible values of the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONER { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl M_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - M_DONER::DIS => false, - M_DONER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> M_DONER { - match value { - false => M_DONER::DIS, - true => M_DONER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == M_DONER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == M_DONER::EN - } - } - #[doc = "Possible values of the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_OVRR::DIS => false, - TX_OVRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_OVRR { - match value { - false => TX_OVRR::DIS, - true => TX_OVRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_OVRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_OVRR::EN - } - } - #[doc = "Possible values of the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDR::DIS => false, - TX_UNDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDR { - match value { - false => TX_UNDR::DIS, - true => TX_UNDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_UNDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_UNDR::EN - } - } - #[doc = "Possible values of the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVRR::DIS => false, - RX_OVRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVRR { - match value { - false => RX_OVRR::DIS, - true => RX_OVRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_OVRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_OVRR::EN - } - } - #[doc = "Possible values of the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_UNDR::DIS => false, - RX_UNDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_UNDR { - match value { - false => RX_UNDR::DIS, - true => RX_UNDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_UNDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_UNDR::EN - } - } - #[doc = "Possible values of the field `SR0A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR0AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR0AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR0AR::DIS => false, - SR0AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR0AR { - match value { - false => SR0AR::DIS, - true => SR0AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR0AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR0AR::EN - } - } - #[doc = "Possible values of the field `SR1A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR1AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR1AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR1AR::DIS => false, - SR1AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR1AR { - match value { - false => SR1AR::DIS, - true => SR1AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR1AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR1AR::EN - } - } - #[doc = "Possible values of the field `SR2A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR2AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR2AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR2AR::DIS => false, - SR2AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR2AR { - match value { - false => SR2AR::DIS, - true => SR2AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR2AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR2AR::EN - } - } - #[doc = "Possible values of the field `SR3A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR3AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR3AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR3AR::DIS => false, - SR3AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR3AR { - match value { - false => SR3AR::DIS, - true => SR3AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR3AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR3AR::EN - } - } - #[doc = "Possible values of the field `SR4A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR4AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR4AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR4AR::DIS => false, - SR4AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR4AR { - match value { - false => SR4AR::DIS, - true => SR4AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR4AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR4AR::EN - } - } - #[doc = "Possible values of the field `SR5A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR5AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR5AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR5AR::DIS => false, - SR5AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR5AR { - match value { - false => SR5AR::DIS, - true => SR5AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR5AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR5AR::EN - } - } - #[doc = "Possible values of the field `SR6A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR6AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR6AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR6AR::DIS => false, - SR6AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR6AR { - match value { - false => SR6AR::DIS, - true => SR6AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR6AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR6AR::EN - } - } - #[doc = "Possible values of the field `SR7A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR7AR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR7AR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SR7AR::DIS => false, - SR7AR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SR7AR { - match value { - false => SR7AR::DIS, - true => SR7AR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SR7AR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SR7AR::EN - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::DIS => false, - TX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_THRESHW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::DIS => false, - TX_EMPTYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_EMPTYW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_EMPTYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::DIS => false, - RX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_THRESHW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::DIS => false, - RX_FULLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FULLW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FULLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSAW::DIS => false, - SSAW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSAW<'a> { - w: &'a mut W, - } - impl<'a> _SSAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SSAW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SSAW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSDW::DIS => false, - SSDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSDW<'a> { - w: &'a mut W, - } - impl<'a> _SSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SSDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SSDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl FAULTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FAULTW::DIS => false, - FAULTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FAULTW<'a> { - w: &'a mut W, - } - impl<'a> _FAULTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FAULTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FAULTW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FAULTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl ABORTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ABORTW::DIS => false, - ABORTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ABORTW<'a> { - w: &'a mut W, - } - impl<'a> _ABORTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ABORTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ABORTW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ABORTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TIMEOUT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TIMEOUTW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TIMEOUTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TIMEOUTW::DIS => false, - TIMEOUTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TIMEOUTW<'a> { - w: &'a mut W, - } - impl<'a> _TIMEOUTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TIMEOUTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TIMEOUTW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TIMEOUTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONEW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl M_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - M_DONEW::DIS => false, - M_DONEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _M_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _M_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: M_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(M_DONEW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(M_DONEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_OVRW::DIS => false, - TX_OVRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _TX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_OVRW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_OVRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDW::DIS => false, - TX_UNDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_UNDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_UNDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVRW::DIS => false, - RX_OVRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_OVRW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_OVRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_UNDW::DIS => false, - RX_UNDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_UNDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_UNDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR0A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR0AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR0AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR0AW::DIS => false, - SR0AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR0AW<'a> { - w: &'a mut W, - } - impl<'a> _SR0AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR0AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR0AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR0AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR1A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR1AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR1AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR1AW::DIS => false, - SR1AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR1AW<'a> { - w: &'a mut W, - } - impl<'a> _SR1AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR1AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR1AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR1AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR2A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR2AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR2AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR2AW::DIS => false, - SR2AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR2AW<'a> { - w: &'a mut W, - } - impl<'a> _SR2AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR2AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR2AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR2AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR3A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR3AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR3AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR3AW::DIS => false, - SR3AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR3AW<'a> { - w: &'a mut W, - } - impl<'a> _SR3AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR3AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR3AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR3AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 19; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR4A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR4AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR4AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR4AW::DIS => false, - SR4AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR4AW<'a> { - w: &'a mut W, - } - impl<'a> _SR4AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR4AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR4AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR4AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 20; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR5A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR5AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR5AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR5AW::DIS => false, - SR5AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR5AW<'a> { - w: &'a mut W, - } - impl<'a> _SR5AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR5AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR5AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR5AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 21; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR6A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR6AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR6AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR6AW::DIS => false, - SR6AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR6AW<'a> { - w: &'a mut W, - } - impl<'a> _SR6AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR6AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR6AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR6AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SR7A`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SR7AW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SR7AW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SR7AW::DIS => false, - SR7AW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SR7AW<'a> { - w: &'a mut W, - } - impl<'a> _SR7AW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SR7AW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SR7AW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SR7AW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX FIFO Threshold interrupt enable."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - TX FIFO Empty interrupt enable."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed interrupt enable."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - RX FIFO FULL interrupt enable."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select Asserted interrupt enable."] - #[inline] - pub fn ssa(&self) -> SSAR { - SSAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Slave Select Deasserted interrupt enable."] - #[inline] - pub fn ssd(&self) -> SSDR { - SSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Multi-Master Mode Fault interrupt enable."] - #[inline] - pub fn fault(&self) -> FAULTR { - FAULTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Slave Abort Detected interrupt enable."] - #[inline] - pub fn abort(&self) -> ABORTR { - ABORTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Timeout interrupt enable."] - #[inline] - pub fn timeout(&self) -> TIMEOUTR { - TIMEOUTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Master Done interrupt enable."] - #[inline] - pub fn m_done(&self) -> M_DONER { - M_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Transmit FIFO Overrun interrupt enable."] - #[inline] - pub fn tx_ovr(&self) -> TX_OVRR { - TX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Transmit FIFO Underrun interrupt enable."] - #[inline] - pub fn tx_und(&self) -> TX_UNDR { - TX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Receive FIFO Overrun interrupt enable."] - #[inline] - pub fn rx_ovr(&self) -> RX_OVRR { - RX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Receive FIFO Underrun interrupt enable."] - #[inline] - pub fn rx_und(&self) -> RX_UNDR { - RX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 16 - Slave Ready 0 Asserted interrupt enable."] - #[inline] - pub fn sr0a(&self) -> SR0AR { - SR0AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 17 - Slave Ready 1 Asserted interrupt enable."] - #[inline] - pub fn sr1a(&self) -> SR1AR { - SR1AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 18 - Slave Ready 2 Asserted interrupt enable."] - #[inline] - pub fn sr2a(&self) -> SR2AR { - SR2AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 19 - Slave Ready 3 Asserted interrupt enable."] - #[inline] - pub fn sr3a(&self) -> SR3AR { - SR3AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 19; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 20 - Slave Ready 4 Asserted interrupt enable."] - #[inline] - pub fn sr4a(&self) -> SR4AR { - SR4AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 20; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 21 - Slave Ready 5 Asserted interrupt enable."] - #[inline] - pub fn sr5a(&self) -> SR5AR { - SR5AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 21; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 22 - Slave Ready 6 Asserted interrupt enable."] - #[inline] - pub fn sr6a(&self) -> SR6AR { - SR6AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - Slave Ready 7 Asserted interrupt enable."] - #[inline] - pub fn sr7a(&self) -> SR7AR { - SR7AR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX FIFO Threshold interrupt enable."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - TX FIFO Empty interrupt enable."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed interrupt enable."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - RX FIFO FULL interrupt enable."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - #[doc = "Bit 4 - Slave Select Asserted interrupt enable."] - #[inline] - pub fn ssa(&mut self) -> _SSAW { - _SSAW { w: self } - } - #[doc = "Bit 5 - Slave Select Deasserted interrupt enable."] - #[inline] - pub fn ssd(&mut self) -> _SSDW { - _SSDW { w: self } - } - #[doc = "Bit 8 - Multi-Master Mode Fault interrupt enable."] - #[inline] - pub fn fault(&mut self) -> _FAULTW { - _FAULTW { w: self } - } - #[doc = "Bit 9 - Slave Abort Detected interrupt enable."] - #[inline] - pub fn abort(&mut self) -> _ABORTW { - _ABORTW { w: self } - } - #[doc = "Bit 10 - Timeout interrupt enable."] - #[inline] - pub fn timeout(&mut self) -> _TIMEOUTW { - _TIMEOUTW { w: self } - } - #[doc = "Bit 11 - Master Done interrupt enable."] - #[inline] - pub fn m_done(&mut self) -> _M_DONEW { - _M_DONEW { w: self } - } - #[doc = "Bit 12 - Transmit FIFO Overrun interrupt enable."] - #[inline] - pub fn tx_ovr(&mut self) -> _TX_OVRW { - _TX_OVRW { w: self } - } - #[doc = "Bit 13 - Transmit FIFO Underrun interrupt enable."] - #[inline] - pub fn tx_und(&mut self) -> _TX_UNDW { - _TX_UNDW { w: self } - } - #[doc = "Bit 14 - Receive FIFO Overrun interrupt enable."] - #[inline] - pub fn rx_ovr(&mut self) -> _RX_OVRW { - _RX_OVRW { w: self } - } - #[doc = "Bit 15 - Receive FIFO Underrun interrupt enable."] - #[inline] - pub fn rx_und(&mut self) -> _RX_UNDW { - _RX_UNDW { w: self } - } - #[doc = "Bit 16 - Slave Ready 0 Asserted interrupt enable."] - #[inline] - pub fn sr0a(&mut self) -> _SR0AW { - _SR0AW { w: self } - } - #[doc = "Bit 17 - Slave Ready 1 Asserted interrupt enable."] - #[inline] - pub fn sr1a(&mut self) -> _SR1AW { - _SR1AW { w: self } - } - #[doc = "Bit 18 - Slave Ready 2 Asserted interrupt enable."] - #[inline] - pub fn sr2a(&mut self) -> _SR2AW { - _SR2AW { w: self } - } - #[doc = "Bit 19 - Slave Ready 3 Asserted interrupt enable."] - #[inline] - pub fn sr3a(&mut self) -> _SR3AW { - _SR3AW { w: self } - } - #[doc = "Bit 20 - Slave Ready 4 Asserted interrupt enable."] - #[inline] - pub fn sr4a(&mut self) -> _SR4AW { - _SR4AW { w: self } - } - #[doc = "Bit 21 - Slave Ready 5 Asserted interrupt enable."] - #[inline] - pub fn sr5a(&mut self) -> _SR5AW { - _SR5AW { w: self } - } - #[doc = "Bit 22 - Slave Ready 6 Asserted interrupt enable."] - #[inline] - pub fn sr6a(&mut self) -> _SR6AW { - _SR6AW { w: self } - } - #[doc = "Bit 23 - Slave Ready 7 Asserted interrupt enable."] - #[inline] - pub fn sr7a(&mut self) -> _SR7AW { - _SR7AW { w: self } - } - } - } - #[doc = "Register for wake up flags. All bits in this register are write 1 to clear."] - pub struct WAKE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for wake up flags. All bits in this register are write 1 to clear."] - pub mod wake { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::CLEAR => true, - TX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - true => TX_THRESHR::CLEAR, - i => TX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::CLEAR => true, - TX_EMPTYR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - true => TX_EMPTYR::CLEAR, - i => TX_EMPTYR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_EMPTYR::CLEAR - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::CLEAR => true, - RX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - true => RX_THRESHR::CLEAR, - i => RX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::CLEAR => true, - RX_FULLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - true => RX_FULLR::CLEAR, - i => RX_FULLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FULLR::CLEAR - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_EMPTYW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FULLW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Wake on TX FIFO Empty."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Wake on RX FIFO Full."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - Wake on TX FIFO Empty."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - Wake on RX FIFO Full."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - } - } - #[doc = "Register for wake up enable."] - pub struct WAKEE { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for wake up enable."] - pub mod wakee { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKEE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::DIS => false, - TX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::DIS, - true => TX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_THRESHR::EN - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::DIS => false, - TX_EMPTYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - false => TX_EMPTYR::DIS, - true => TX_EMPTYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_EMPTYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_EMPTYR::EN - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::DIS => false, - RX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::DIS, - true => RX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_THRESHR::EN - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::DIS => false, - RX_FULLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - false => RX_FULLR::DIS, - true => RX_FULLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FULLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FULLR::EN - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::DIS => false, - TX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_THRESHW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::DIS => false, - TX_EMPTYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_EMPTYW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_EMPTYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::DIS => false, - RX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_THRESHW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::DIS => false, - RX_FULLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FULLW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FULLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed Enable."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Wake on TX FIFO Empty Enable."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed Enable."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Wake on RX FIFO Full Enable."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed Enable."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - Wake on TX FIFO Empty Enable."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed Enable."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - Wake on RX FIFO Full Enable."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - } - } - #[doc = "SPI Status register."] - pub struct STAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI Status register."] - pub mod stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::STAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `BUSY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSYR { - #[doc = "SPI not active."] - NOT, - #[doc = "SPI active."] - ACTIVE, - } - impl BUSYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSYR::NOT => false, - BUSYR::ACTIVE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSYR { - match value { - false => BUSYR::NOT, - true => BUSYR::ACTIVE, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == BUSYR::NOT - } - #[doc = "Checks if the value of the field is `ACTIVE`"] - #[inline] - pub fn is_active(&self) -> bool { - *self == BUSYR::ACTIVE - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SPI active status. In Master mode, set when transaction starts, cleared when last bit of last character is acted upon and Slave Select de-assertion would occur. In Slave mode, set when Slave Select is asserted, cleared when Slave Select is de-asserted. Not used in Timer mode."] - #[inline] - pub fn busy(&self) -> BUSYR { - BUSYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } - #[doc = "Register to control external memory."] - pub struct XMEM_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register to control external memory."] - pub mod xmem_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::XMEM_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RD_CMDR { - bits: u8, - } - impl RD_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct WR_CMDR { - bits: u8, - } - impl WR_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct DUMMY_CLKR { - bits: u8, - } - impl DUMMY_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct XMEM_ENR { - bits: bool, - } - impl XMEM_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _RD_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _RD_CMDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _WR_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _WR_CMDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DUMMY_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _DUMMY_CLKW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _XMEM_ENW<'a> { - w: &'a mut W, - } - impl<'a> _XMEM_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Read command."] - #[inline] - pub fn rd_cmd(&self) -> RD_CMDR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RD_CMDR { bits } - } - #[doc = "Bits 8:15 - Write command."] - #[inline] - pub fn wr_cmd(&self) -> WR_CMDR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - WR_CMDR { bits } - } - #[doc = "Bits 16:23 - Dummy clocks."] - #[inline] - pub fn dummy_clk(&self) -> DUMMY_CLKR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DUMMY_CLKR { bits } - } - #[doc = "Bit 31 - XMEM enable."] - #[inline] - pub fn xmem_en(&self) -> XMEM_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - XMEM_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Read command."] - #[inline] - pub fn rd_cmd(&mut self) -> _RD_CMDW { - _RD_CMDW { w: self } - } - #[doc = "Bits 8:15 - Write command."] - #[inline] - pub fn wr_cmd(&mut self) -> _WR_CMDW { - _WR_CMDW { w: self } - } - #[doc = "Bits 16:23 - Dummy clocks."] - #[inline] - pub fn dummy_clk(&mut self) -> _DUMMY_CLKW { - _DUMMY_CLKW { w: self } - } - #[doc = "Bit 31 - XMEM enable."] - #[inline] - pub fn xmem_en(&mut self) -> _XMEM_ENW { - _XMEM_ENW { w: self } - } - } - } -} -#[doc = "SPI XiP Flash Configuration Controller"] -pub struct SPIXFC { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPIXFC {} -impl SPIXFC { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spixfc::RegisterBlock { - 0x4002_7000 as *const _ - } -} -impl Deref for SPIXFC { - type Target = spixfc::RegisterBlock; - fn deref(&self) -> &spixfc::RegisterBlock { - unsafe { &*SPIXFC::ptr() } - } -} -#[doc = "SPI XiP Flash Configuration Controller"] -pub mod spixfc { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Configuration Register."] - pub config: CONFIG, - #[doc = "0x04 - SPIX Controller Slave Select Polarity Register."] - pub ss_pol: SS_POL, - #[doc = "0x08 - SPIX Controller General Controller Register."] - pub gen_ctrl: GEN_CTRL, - #[doc = "0x0c - SPIX Controller FIFO Control and Status Register."] - pub fifo_ctrl: FIFO_CTRL, - #[doc = "0x10 - SPIX Controller Special Control Register."] - pub spctrl: SPCTRL, - #[doc = "0x14 - SPIX Controller Interrupt Status Register."] - pub intfl: INTFL, - #[doc = "0x18 - SPIX Controller Interrupt Enable Register."] - pub inten: INTEN, - } - #[doc = "Configuration Register."] - pub struct CONFIG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Configuration Register."] - pub mod config { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CONFIG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSELR { - #[doc = "Slave 0 is selected."] - SLAVE_0, - #[doc = "Slave 1 is selected."] - SLAVE_1, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSELR::SLAVE_0 => 0, - SSELR::SLAVE_1 => 0x01, - SSELR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSELR { - match value { - 0 => SSELR::SLAVE_0, - 1 => SSELR::SLAVE_1, - i => SSELR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SLAVE_0`"] - #[inline] - pub fn is_slave_0(&self) -> bool { - *self == SSELR::SLAVE_0 - } - #[doc = "Checks if the value of the field is `SLAVE_1`"] - #[inline] - pub fn is_slave_1(&self) -> bool { - *self == SSELR::SLAVE_1 - } - } - #[doc = "Possible values of the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "SPIX Mode 0. CLK Polarity = 0, CLK Phase = 0."] - SPIX_MODE_0, - #[doc = "SPIX Mode 3. CLK Polarity = 1, CLK Phase = 1."] - SPIX_MODE_3, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - MODER::SPIX_MODE_0 => 0, - MODER::SPIX_MODE_3 => 0x03, - MODER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> MODER { - match value { - 0 => MODER::SPIX_MODE_0, - 3 => MODER::SPIX_MODE_3, - i => MODER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SPIX_MODE_0`"] - #[inline] - pub fn is_spix_mode_0(&self) -> bool { - *self == MODER::SPIX_MODE_0 - } - #[doc = "Checks if the value of the field is `SPIX_MODE_3`"] - #[inline] - pub fn is_spix_mode_3(&self) -> bool { - *self == MODER::SPIX_MODE_3 - } - } - #[doc = "Possible values of the field `PAGE_SIZE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PAGE_SIZER { - #[doc = "4 bytes."] - _4_BYTES, - #[doc = "8 bytes."] - _8_BYTES, - #[doc = "16 bytes."] - _16_BYTES, - #[doc = "32 bytes."] - _32_BYTES, - } - impl PAGE_SIZER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PAGE_SIZER::_4_BYTES => 0, - PAGE_SIZER::_8_BYTES => 0x01, - PAGE_SIZER::_16_BYTES => 0x02, - PAGE_SIZER::_32_BYTES => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PAGE_SIZER { - match value { - 0 => PAGE_SIZER::_4_BYTES, - 1 => PAGE_SIZER::_8_BYTES, - 2 => PAGE_SIZER::_16_BYTES, - 3 => PAGE_SIZER::_32_BYTES, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_4_BYTES`"] - #[inline] - pub fn is_4_bytes(&self) -> bool { - *self == PAGE_SIZER::_4_BYTES - } - #[doc = "Checks if the value of the field is `_8_BYTES`"] - #[inline] - pub fn is_8_bytes(&self) -> bool { - *self == PAGE_SIZER::_8_BYTES - } - #[doc = "Checks if the value of the field is `_16_BYTES`"] - #[inline] - pub fn is_16_bytes(&self) -> bool { - *self == PAGE_SIZER::_16_BYTES - } - #[doc = "Checks if the value of the field is `_32_BYTES`"] - #[inline] - pub fn is_32_bytes(&self) -> bool { - *self == PAGE_SIZER::_32_BYTES - } - } - #[doc = "Possible values of the field `HI_CLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HI_CLKR { - #[doc = "16 system clocks."] - _16_SCLK, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl HI_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - HI_CLKR::_16_SCLK => 0, - HI_CLKR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> HI_CLKR { - match value { - 0 => HI_CLKR::_16_SCLK, - i => HI_CLKR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_16_SCLK`"] - #[inline] - pub fn is_16_sclk(&self) -> bool { - *self == HI_CLKR::_16_SCLK - } - } - #[doc = "Possible values of the field `LO_CLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LO_CLKR { - #[doc = "16 system clocks."] - _16_SCLK, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl LO_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - LO_CLKR::_16_SCLK => 0, - LO_CLKR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> LO_CLKR { - match value { - 0 => LO_CLKR::_16_SCLK, - i => LO_CLKR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_16_SCLK`"] - #[inline] - pub fn is_16_sclk(&self) -> bool { - *self == LO_CLKR::_16_SCLK - } - } - #[doc = "Possible values of the field `SS_ACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_ACTR { - #[doc = "0 sytem clocks."] - _0_CLKS, - #[doc = "2 sytem clocks."] - _2_CLKS, - #[doc = "4 sytem clocks."] - _4_CLKS, - #[doc = "8 sytem clocks."] - _8_CLKS, - } - impl SS_ACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SS_ACTR::_0_CLKS => 0, - SS_ACTR::_2_CLKS => 0x01, - SS_ACTR::_4_CLKS => 0x02, - SS_ACTR::_8_CLKS => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SS_ACTR { - match value { - 0 => SS_ACTR::_0_CLKS, - 1 => SS_ACTR::_2_CLKS, - 2 => SS_ACTR::_4_CLKS, - 3 => SS_ACTR::_8_CLKS, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_0_CLKS`"] - #[inline] - pub fn is_0_clks(&self) -> bool { - *self == SS_ACTR::_0_CLKS - } - #[doc = "Checks if the value of the field is `_2_CLKS`"] - #[inline] - pub fn is_2_clks(&self) -> bool { - *self == SS_ACTR::_2_CLKS - } - #[doc = "Checks if the value of the field is `_4_CLKS`"] - #[inline] - pub fn is_4_clks(&self) -> bool { - *self == SS_ACTR::_4_CLKS - } - #[doc = "Checks if the value of the field is `_8_CLKS`"] - #[inline] - pub fn is_8_clks(&self) -> bool { - *self == SS_ACTR::_8_CLKS - } - } - #[doc = "Possible values of the field `SS_INACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_INACTR { - #[doc = "4 sytem clocks."] - _4_CLKS, - #[doc = "6 sytem clocks."] - _6_CLKS, - #[doc = "8 sytem clocks."] - _8_CLKS, - #[doc = "12 sytem clocks."] - _12_CLKS, - } - impl SS_INACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SS_INACTR::_4_CLKS => 0, - SS_INACTR::_6_CLKS => 0x01, - SS_INACTR::_8_CLKS => 0x02, - SS_INACTR::_12_CLKS => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SS_INACTR { - match value { - 0 => SS_INACTR::_4_CLKS, - 1 => SS_INACTR::_6_CLKS, - 2 => SS_INACTR::_8_CLKS, - 3 => SS_INACTR::_12_CLKS, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_4_CLKS`"] - #[inline] - pub fn is_4_clks(&self) -> bool { - *self == SS_INACTR::_4_CLKS - } - #[doc = "Checks if the value of the field is `_6_CLKS`"] - #[inline] - pub fn is_6_clks(&self) -> bool { - *self == SS_INACTR::_6_CLKS - } - #[doc = "Checks if the value of the field is `_8_CLKS`"] - #[inline] - pub fn is_8_clks(&self) -> bool { - *self == SS_INACTR::_8_CLKS - } - #[doc = "Checks if the value of the field is `_12_CLKS`"] - #[inline] - pub fn is_12_clks(&self) -> bool { - *self == SS_INACTR::_12_CLKS - } - } - #[doc = "Values that can be written to the field `SSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSELW { - #[doc = "Slave 0 is selected."] - SLAVE_0, - #[doc = "Slave 1 is selected."] - SLAVE_1, - } - impl SSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSELW::SLAVE_0 => 0, - SSELW::SLAVE_1 => 1, - } - } - } - #[doc = r" Proxy"] - pub struct _SSELW<'a> { - w: &'a mut W, - } - impl<'a> _SSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSELW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Slave 0 is selected."] - #[inline] - pub fn slave_0(self) -> &'a mut W { - self.variant(SSELW::SLAVE_0) - } - #[doc = "Slave 1 is selected."] - #[inline] - pub fn slave_1(self) -> &'a mut W { - self.variant(SSELW::SLAVE_1) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "SPIX Mode 0. CLK Polarity = 0, CLK Phase = 0."] - SPIX_MODE_0, - #[doc = "SPIX Mode 3. CLK Polarity = 1, CLK Phase = 1."] - SPIX_MODE_3, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - MODEW::SPIX_MODE_0 => 0, - MODEW::SPIX_MODE_3 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SPIX Mode 0. CLK Polarity = 0, CLK Phase = 0."] - #[inline] - pub fn spix_mode_0(self) -> &'a mut W { - self.variant(MODEW::SPIX_MODE_0) - } - #[doc = "SPIX Mode 3. CLK Polarity = 1, CLK Phase = 1."] - #[inline] - pub fn spix_mode_3(self) -> &'a mut W { - self.variant(MODEW::SPIX_MODE_3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PAGE_SIZE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PAGE_SIZEW { - #[doc = "4 bytes."] - _4_BYTES, - #[doc = "8 bytes."] - _8_BYTES, - #[doc = "16 bytes."] - _16_BYTES, - #[doc = "32 bytes."] - _32_BYTES, - } - impl PAGE_SIZEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PAGE_SIZEW::_4_BYTES => 0, - PAGE_SIZEW::_8_BYTES => 1, - PAGE_SIZEW::_16_BYTES => 2, - PAGE_SIZEW::_32_BYTES => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _PAGE_SIZEW<'a> { - w: &'a mut W, - } - impl<'a> _PAGE_SIZEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PAGE_SIZEW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "4 bytes."] - #[inline] - pub fn _4_bytes(self) -> &'a mut W { - self.variant(PAGE_SIZEW::_4_BYTES) - } - #[doc = "8 bytes."] - #[inline] - pub fn _8_bytes(self) -> &'a mut W { - self.variant(PAGE_SIZEW::_8_BYTES) - } - #[doc = "16 bytes."] - #[inline] - pub fn _16_bytes(self) -> &'a mut W { - self.variant(PAGE_SIZEW::_16_BYTES) - } - #[doc = "32 bytes."] - #[inline] - pub fn _32_bytes(self) -> &'a mut W { - self.variant(PAGE_SIZEW::_32_BYTES) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HI_CLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HI_CLKW { - #[doc = "16 system clocks."] - _16_SCLK, - } - impl HI_CLKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - HI_CLKW::_16_SCLK => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _HI_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _HI_CLKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HI_CLKW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "16 system clocks."] - #[inline] - pub fn _16_sclk(self) -> &'a mut W { - self.variant(HI_CLKW::_16_SCLK) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `LO_CLK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LO_CLKW { - #[doc = "16 system clocks."] - _16_SCLK, - } - impl LO_CLKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - LO_CLKW::_16_SCLK => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _LO_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _LO_CLKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LO_CLKW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "16 system clocks."] - #[inline] - pub fn _16_sclk(self) -> &'a mut W { - self.variant(LO_CLKW::_16_SCLK) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_ACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_ACTW { - #[doc = "0 sytem clocks."] - _0_CLKS, - #[doc = "2 sytem clocks."] - _2_CLKS, - #[doc = "4 sytem clocks."] - _4_CLKS, - #[doc = "8 sytem clocks."] - _8_CLKS, - } - impl SS_ACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SS_ACTW::_0_CLKS => 0, - SS_ACTW::_2_CLKS => 1, - SS_ACTW::_4_CLKS => 2, - SS_ACTW::_8_CLKS => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_ACTW<'a> { - w: &'a mut W, - } - impl<'a> _SS_ACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_ACTW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "0 sytem clocks."] - #[inline] - pub fn _0_clks(self) -> &'a mut W { - self.variant(SS_ACTW::_0_CLKS) - } - #[doc = "2 sytem clocks."] - #[inline] - pub fn _2_clks(self) -> &'a mut W { - self.variant(SS_ACTW::_2_CLKS) - } - #[doc = "4 sytem clocks."] - #[inline] - pub fn _4_clks(self) -> &'a mut W { - self.variant(SS_ACTW::_4_CLKS) - } - #[doc = "8 sytem clocks."] - #[inline] - pub fn _8_clks(self) -> &'a mut W { - self.variant(SS_ACTW::_8_CLKS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_INACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_INACTW { - #[doc = "4 sytem clocks."] - _4_CLKS, - #[doc = "6 sytem clocks."] - _6_CLKS, - #[doc = "8 sytem clocks."] - _8_CLKS, - #[doc = "12 sytem clocks."] - _12_CLKS, - } - impl SS_INACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SS_INACTW::_4_CLKS => 0, - SS_INACTW::_6_CLKS => 1, - SS_INACTW::_8_CLKS => 2, - SS_INACTW::_12_CLKS => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_INACTW<'a> { - w: &'a mut W, - } - impl<'a> _SS_INACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_INACTW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "4 sytem clocks."] - #[inline] - pub fn _4_clks(self) -> &'a mut W { - self.variant(SS_INACTW::_4_CLKS) - } - #[doc = "6 sytem clocks."] - #[inline] - pub fn _6_clks(self) -> &'a mut W { - self.variant(SS_INACTW::_6_CLKS) - } - #[doc = "8 sytem clocks."] - #[inline] - pub fn _8_clks(self) -> &'a mut W { - self.variant(SS_INACTW::_8_CLKS) - } - #[doc = "12 sytem clocks."] - #[inline] - pub fn _12_clks(self) -> &'a mut W { - self.variant(SS_INACTW::_12_CLKS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:2 - Slaves Select."] - #[inline] - pub fn ssel(&self) -> SSELR { - SSELR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 4:5 - Defines SPI Mode, Only valid values are 0 and 3."] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 6:7 - Page Size."] - #[inline] - pub fn page_size(&self) -> PAGE_SIZER { - PAGE_SIZER::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:11 - SCLK High Clocks. Number of system clocks that SCLK will be high when SCLK pulses are generated. 0 Correspond to 16 system clocks and, all other values defines the number of system clock taht SCLK will be held high."] - #[inline] - pub fn hi_clk(&self) -> HI_CLKR { - HI_CLKR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 12:15 - SCLK low Clocks. Number of system clocks that SCLK will be low when SCLK pulses are generated. 0 correspond to 16 system clocks and, all other values defines the number of system clock taht SCLK will be held low."] - #[inline] - pub fn lo_clk(&self) -> LO_CLKR { - LO_CLKR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:17 - Slaves Select Activate Timing."] - #[inline] - pub fn ss_act(&self) -> SS_ACTR { - SS_ACTR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 18:19 - Slaves Select Inactive Timing."] - #[inline] - pub fn ss_inact(&self) -> SS_INACTR { - SS_INACTR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - Slaves Select."] - #[inline] - pub fn ssel(&mut self) -> _SSELW { - _SSELW { w: self } - } - #[doc = "Bits 4:5 - Defines SPI Mode, Only valid values are 0 and 3."] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - #[doc = "Bits 6:7 - Page Size."] - #[inline] - pub fn page_size(&mut self) -> _PAGE_SIZEW { - _PAGE_SIZEW { w: self } - } - #[doc = "Bits 8:11 - SCLK High Clocks. Number of system clocks that SCLK will be high when SCLK pulses are generated. 0 Correspond to 16 system clocks and, all other values defines the number of system clock taht SCLK will be held high."] - #[inline] - pub fn hi_clk(&mut self) -> _HI_CLKW { - _HI_CLKW { w: self } - } - #[doc = "Bits 12:15 - SCLK low Clocks. Number of system clocks that SCLK will be low when SCLK pulses are generated. 0 correspond to 16 system clocks and, all other values defines the number of system clock taht SCLK will be held low."] - #[inline] - pub fn lo_clk(&mut self) -> _LO_CLKW { - _LO_CLKW { w: self } - } - #[doc = "Bits 16:17 - Slaves Select Activate Timing."] - #[inline] - pub fn ss_act(&mut self) -> _SS_ACTW { - _SS_ACTW { w: self } - } - #[doc = "Bits 18:19 - Slaves Select Inactive Timing."] - #[inline] - pub fn ss_inact(&mut self) -> _SS_INACTW { - _SS_INACTW { w: self } - } - } - } - #[doc = "SPIX Controller Slave Select Polarity Register."] - pub struct SS_POL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller Slave Select Polarity Register."] - pub mod ss_pol { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SS_POL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SS_POLARITY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_POLARITYR { - #[doc = "Active Low."] - LO, - #[doc = "Active High."] - HI, - } - impl SS_POLARITYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SS_POLARITYR::LO => false, - SS_POLARITYR::HI => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SS_POLARITYR { - match value { - false => SS_POLARITYR::LO, - true => SS_POLARITYR::HI, - } - } - #[doc = "Checks if the value of the field is `LO`"] - #[inline] - pub fn is_lo(&self) -> bool { - *self == SS_POLARITYR::LO - } - #[doc = "Checks if the value of the field is `HI`"] - #[inline] - pub fn is_hi(&self) -> bool { - *self == SS_POLARITYR::HI - } - } - #[doc = "Values that can be written to the field `SS_POLARITY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_POLARITYW { - #[doc = "Active Low."] - LO, - #[doc = "Active High."] - HI, - } - impl SS_POLARITYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SS_POLARITYW::LO => false, - SS_POLARITYW::HI => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_POLARITYW<'a> { - w: &'a mut W, - } - impl<'a> _SS_POLARITYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_POLARITYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Active Low."] - #[inline] - pub fn lo(self) -> &'a mut W { - self.variant(SS_POLARITYW::LO) - } - #[doc = "Active High."] - #[inline] - pub fn hi(self) -> &'a mut W { - self.variant(SS_POLARITYW::HI) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Slave Select Polarity."] - #[inline] - pub fn ss_polarity(&self) -> SS_POLARITYR { - SS_POLARITYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Slave Select Polarity."] - #[inline] - pub fn ss_polarity(&mut self) -> _SS_POLARITYW { - _SS_POLARITYW { w: self } - } - } - } - #[doc = "SPIX Controller General Controller Register."] - pub struct GEN_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller General Controller Register."] - pub mod gen_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::GEN_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ENABLE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENABLER { - #[doc = "Disable SPI Master, putting a reset state."] - DIS, - #[doc = "Enable SPI Master for processing transactions."] - EN, - } - impl ENABLER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ENABLER::DIS => false, - ENABLER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ENABLER { - match value { - false => ENABLER::DIS, - true => ENABLER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ENABLER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ENABLER::EN - } - } - #[doc = "Possible values of the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENR { - #[doc = "Disable Transaction FIFO."] - DIS_TXFIFO, - #[doc = "Enable Transaction FIFO."] - EN_TXFIFO, - } - impl TX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_ENR::DIS_TXFIFO => false, - TX_FIFO_ENR::EN_TXFIFO => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_ENR { - match value { - false => TX_FIFO_ENR::DIS_TXFIFO, - true => TX_FIFO_ENR::EN_TXFIFO, - } - } - #[doc = "Checks if the value of the field is `DIS_TXFIFO`"] - #[inline] - pub fn is_dis_txfifo(&self) -> bool { - *self == TX_FIFO_ENR::DIS_TXFIFO - } - #[doc = "Checks if the value of the field is `EN_TXFIFO`"] - #[inline] - pub fn is_en_txfifo(&self) -> bool { - *self == TX_FIFO_ENR::EN_TXFIFO - } - } - #[doc = "Possible values of the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENR { - #[doc = "Disable Result FIFO."] - DIS_RXFIFO, - #[doc = "Enable Result FIFO."] - EN_RXFIFO, - } - impl RX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_ENR::DIS_RXFIFO => false, - RX_FIFO_ENR::EN_RXFIFO => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_ENR { - match value { - false => RX_FIFO_ENR::DIS_RXFIFO, - true => RX_FIFO_ENR::EN_RXFIFO, - } - } - #[doc = "Checks if the value of the field is `DIS_RXFIFO`"] - #[inline] - pub fn is_dis_rxfifo(&self) -> bool { - *self == RX_FIFO_ENR::DIS_RXFIFO - } - #[doc = "Checks if the value of the field is `EN_RXFIFO`"] - #[inline] - pub fn is_en_rxfifo(&self) -> bool { - *self == RX_FIFO_ENR::EN_RXFIFO - } - } - #[doc = "Possible values of the field `BBMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BBMODER { - #[doc = "Disable Bit-Bang Mode."] - DIS, - #[doc = "Enable Bit-Bang Mode."] - EN, - } - impl BBMODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BBMODER::DIS => false, - BBMODER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BBMODER { - match value { - false => BBMODER::DIS, - true => BBMODER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BBMODER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BBMODER::EN - } - } - #[doc = "Possible values of the field `SSDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDRR { - #[doc = "Selected Slave select output = 0."] - OUTPUT0, - #[doc = "Selected Slave select output = 1."] - OUTPUT1, - } - impl SSDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSDRR::OUTPUT0 => false, - SSDRR::OUTPUT1 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSDRR { - match value { - false => SSDRR::OUTPUT0, - true => SSDRR::OUTPUT1, - } - } - #[doc = "Checks if the value of the field is `OUTPUT0`"] - #[inline] - pub fn is_output0(&self) -> bool { - *self == SSDRR::OUTPUT0 - } - #[doc = "Checks if the value of the field is `OUTPUT1`"] - #[inline] - pub fn is_output1(&self) -> bool { - *self == SSDRR::OUTPUT1 - } - } - #[doc = "Possible values of the field `SCLK_DR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_DRR { - #[doc = "SCLK is 0."] - SCLK_0, - #[doc = "SCLK is 1."] - SCLK_1, - } - impl SCLK_DRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCLK_DRR::SCLK_0 => false, - SCLK_DRR::SCLK_1 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCLK_DRR { - match value { - false => SCLK_DRR::SCLK_0, - true => SCLK_DRR::SCLK_1, - } - } - #[doc = "Checks if the value of the field is `SCLK_0`"] - #[inline] - pub fn is_sclk_0(&self) -> bool { - *self == SCLK_DRR::SCLK_0 - } - #[doc = "Checks if the value of the field is `SCLK_1`"] - #[inline] - pub fn is_sclk_1(&self) -> bool { - *self == SCLK_DRR::SCLK_1 - } - } - #[doc = "Possible values of the field `SDIO_DATA_IN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIO_DATA_INR { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SDIO_DATA_INR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SDIO_DATA_INR::SDIO0 => 0, - SDIO_DATA_INR::SDIO1 => 0x01, - SDIO_DATA_INR::SDIO2 => 0x02, - SDIO_DATA_INR::SDIO3 => 0x03, - SDIO_DATA_INR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SDIO_DATA_INR { - match value { - 0 => SDIO_DATA_INR::SDIO0, - 1 => SDIO_DATA_INR::SDIO1, - 2 => SDIO_DATA_INR::SDIO2, - 3 => SDIO_DATA_INR::SDIO3, - i => SDIO_DATA_INR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SDIO0`"] - #[inline] - pub fn is_sdio0(&self) -> bool { - *self == SDIO_DATA_INR::SDIO0 - } - #[doc = "Checks if the value of the field is `SDIO1`"] - #[inline] - pub fn is_sdio1(&self) -> bool { - *self == SDIO_DATA_INR::SDIO1 - } - #[doc = "Checks if the value of the field is `SDIO2`"] - #[inline] - pub fn is_sdio2(&self) -> bool { - *self == SDIO_DATA_INR::SDIO2 - } - #[doc = "Checks if the value of the field is `SDIO3`"] - #[inline] - pub fn is_sdio3(&self) -> bool { - *self == SDIO_DATA_INR::SDIO3 - } - } - #[doc = "Possible values of the field `BB_DATA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BB_DATAR { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl BB_DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - BB_DATAR::SDIO0 => 0, - BB_DATAR::SDIO1 => 0x01, - BB_DATAR::SDIO2 => 0x02, - BB_DATAR::SDIO3 => 0x03, - BB_DATAR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> BB_DATAR { - match value { - 0 => BB_DATAR::SDIO0, - 1 => BB_DATAR::SDIO1, - 2 => BB_DATAR::SDIO2, - 3 => BB_DATAR::SDIO3, - i => BB_DATAR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SDIO0`"] - #[inline] - pub fn is_sdio0(&self) -> bool { - *self == BB_DATAR::SDIO0 - } - #[doc = "Checks if the value of the field is `SDIO1`"] - #[inline] - pub fn is_sdio1(&self) -> bool { - *self == BB_DATAR::SDIO1 - } - #[doc = "Checks if the value of the field is `SDIO2`"] - #[inline] - pub fn is_sdio2(&self) -> bool { - *self == BB_DATAR::SDIO2 - } - #[doc = "Checks if the value of the field is `SDIO3`"] - #[inline] - pub fn is_sdio3(&self) -> bool { - *self == BB_DATAR::SDIO3 - } - } - #[doc = "Possible values of the field `BB_DATA_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BB_DATA_OUT_ENR { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl BB_DATA_OUT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - BB_DATA_OUT_ENR::SDIO0 => 0, - BB_DATA_OUT_ENR::SDIO1 => 0x01, - BB_DATA_OUT_ENR::SDIO2 => 0x02, - BB_DATA_OUT_ENR::SDIO3 => 0x03, - BB_DATA_OUT_ENR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> BB_DATA_OUT_ENR { - match value { - 0 => BB_DATA_OUT_ENR::SDIO0, - 1 => BB_DATA_OUT_ENR::SDIO1, - 2 => BB_DATA_OUT_ENR::SDIO2, - 3 => BB_DATA_OUT_ENR::SDIO3, - i => BB_DATA_OUT_ENR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SDIO0`"] - #[inline] - pub fn is_sdio0(&self) -> bool { - *self == BB_DATA_OUT_ENR::SDIO0 - } - #[doc = "Checks if the value of the field is `SDIO1`"] - #[inline] - pub fn is_sdio1(&self) -> bool { - *self == BB_DATA_OUT_ENR::SDIO1 - } - #[doc = "Checks if the value of the field is `SDIO2`"] - #[inline] - pub fn is_sdio2(&self) -> bool { - *self == BB_DATA_OUT_ENR::SDIO2 - } - #[doc = "Checks if the value of the field is `SDIO3`"] - #[inline] - pub fn is_sdio3(&self) -> bool { - *self == BB_DATA_OUT_ENR::SDIO3 - } - } - #[doc = "Possible values of the field `SCLK_FB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_FBR { - #[doc = "undocumented"] - DIS, - #[doc = "undocumented"] - EN, - } - impl SCLK_FBR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCLK_FBR::DIS => false, - SCLK_FBR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCLK_FBR { - match value { - false => SCLK_FBR::DIS, - true => SCLK_FBR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SCLK_FBR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SCLK_FBR::EN - } - } - #[doc = "Values that can be written to the field `ENABLE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENABLEW { - #[doc = "Disable SPI Master, putting a reset state."] - DIS, - #[doc = "Enable SPI Master for processing transactions."] - EN, - } - impl ENABLEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ENABLEW::DIS => false, - ENABLEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ENABLEW<'a> { - w: &'a mut W, - } - impl<'a> _ENABLEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ENABLEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable SPI Master, putting a reset state."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ENABLEW::DIS) - } - #[doc = "Enable SPI Master for processing transactions."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ENABLEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENW { - #[doc = "Disable Transaction FIFO."] - DIS_TXFIFO, - #[doc = "Enable Transaction FIFO."] - EN_TXFIFO, - } - impl TX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_ENW::DIS_TXFIFO => false, - TX_FIFO_ENW::EN_TXFIFO => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Transaction FIFO."] - #[inline] - pub fn dis_txfifo(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::DIS_TXFIFO) - } - #[doc = "Enable Transaction FIFO."] - #[inline] - pub fn en_txfifo(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::EN_TXFIFO) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENW { - #[doc = "Disable Result FIFO."] - DIS_RXFIFO, - #[doc = "Enable Result FIFO."] - EN_RXFIFO, - } - impl RX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_ENW::DIS_RXFIFO => false, - RX_FIFO_ENW::EN_RXFIFO => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Result FIFO."] - #[inline] - pub fn dis_rxfifo(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::DIS_RXFIFO) - } - #[doc = "Enable Result FIFO."] - #[inline] - pub fn en_rxfifo(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::EN_RXFIFO) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BBMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BBMODEW { - #[doc = "Disable Bit-Bang Mode."] - DIS, - #[doc = "Enable Bit-Bang Mode."] - EN, - } - impl BBMODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BBMODEW::DIS => false, - BBMODEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BBMODEW<'a> { - w: &'a mut W, - } - impl<'a> _BBMODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BBMODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Bit-Bang Mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BBMODEW::DIS) - } - #[doc = "Enable Bit-Bang Mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BBMODEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDRW { - #[doc = "Selected Slave select output = 0."] - OUTPUT0, - #[doc = "Selected Slave select output = 1."] - OUTPUT1, - } - impl SSDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSDRW::OUTPUT0 => false, - SSDRW::OUTPUT1 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSDRW<'a> { - w: &'a mut W, - } - impl<'a> _SSDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Selected Slave select output = 0."] - #[inline] - pub fn output0(self) -> &'a mut W { - self.variant(SSDRW::OUTPUT0) - } - #[doc = "Selected Slave select output = 1."] - #[inline] - pub fn output1(self) -> &'a mut W { - self.variant(SSDRW::OUTPUT1) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCLK_DR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_DRW { - #[doc = "SCLK is 0."] - SCLK_0, - #[doc = "SCLK is 1."] - SCLK_1, - } - impl SCLK_DRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCLK_DRW::SCLK_0 => false, - SCLK_DRW::SCLK_1 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCLK_DRW<'a> { - w: &'a mut W, - } - impl<'a> _SCLK_DRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCLK_DRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SCLK is 0."] - #[inline] - pub fn sclk_0(self) -> &'a mut W { - self.variant(SCLK_DRW::SCLK_0) - } - #[doc = "SCLK is 1."] - #[inline] - pub fn sclk_1(self) -> &'a mut W { - self.variant(SCLK_DRW::SCLK_1) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIO_DATA_IN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIO_DATA_INW { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - } - impl SDIO_DATA_INW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SDIO_DATA_INW::SDIO0 => 0, - SDIO_DATA_INW::SDIO1 => 1, - SDIO_DATA_INW::SDIO2 => 2, - SDIO_DATA_INW::SDIO3 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIO_DATA_INW<'a> { - w: &'a mut W, - } - impl<'a> _SDIO_DATA_INW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIO_DATA_INW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SDIO\\[0\\]"] - #[inline] - pub fn sdio0(self) -> &'a mut W { - self.variant(SDIO_DATA_INW::SDIO0) - } - #[doc = "SDIO\\[1\\]"] - #[inline] - pub fn sdio1(self) -> &'a mut W { - self.variant(SDIO_DATA_INW::SDIO1) - } - #[doc = "SDIO\\[2\\]"] - #[inline] - pub fn sdio2(self) -> &'a mut W { - self.variant(SDIO_DATA_INW::SDIO2) - } - #[doc = "SDIO\\[3\\]"] - #[inline] - pub fn sdio3(self) -> &'a mut W { - self.variant(SDIO_DATA_INW::SDIO3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BB_DATA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BB_DATAW { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - } - impl BB_DATAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - BB_DATAW::SDIO0 => 0, - BB_DATAW::SDIO1 => 1, - BB_DATAW::SDIO2 => 2, - BB_DATAW::SDIO3 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _BB_DATAW<'a> { - w: &'a mut W, - } - impl<'a> _BB_DATAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BB_DATAW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SDIO\\[0\\]"] - #[inline] - pub fn sdio0(self) -> &'a mut W { - self.variant(BB_DATAW::SDIO0) - } - #[doc = "SDIO\\[1\\]"] - #[inline] - pub fn sdio1(self) -> &'a mut W { - self.variant(BB_DATAW::SDIO1) - } - #[doc = "SDIO\\[2\\]"] - #[inline] - pub fn sdio2(self) -> &'a mut W { - self.variant(BB_DATAW::SDIO2) - } - #[doc = "SDIO\\[3\\]"] - #[inline] - pub fn sdio3(self) -> &'a mut W { - self.variant(BB_DATAW::SDIO3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BB_DATA_OUT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BB_DATA_OUT_ENW { - #[doc = "SDIO\\[0\\]"] - SDIO0, - #[doc = "SDIO\\[1\\]"] - SDIO1, - #[doc = "SDIO\\[2\\]"] - SDIO2, - #[doc = "SDIO\\[3\\]"] - SDIO3, - } - impl BB_DATA_OUT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - BB_DATA_OUT_ENW::SDIO0 => 0, - BB_DATA_OUT_ENW::SDIO1 => 1, - BB_DATA_OUT_ENW::SDIO2 => 2, - BB_DATA_OUT_ENW::SDIO3 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _BB_DATA_OUT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _BB_DATA_OUT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BB_DATA_OUT_ENW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SDIO\\[0\\]"] - #[inline] - pub fn sdio0(self) -> &'a mut W { - self.variant(BB_DATA_OUT_ENW::SDIO0) - } - #[doc = "SDIO\\[1\\]"] - #[inline] - pub fn sdio1(self) -> &'a mut W { - self.variant(BB_DATA_OUT_ENW::SDIO1) - } - #[doc = "SDIO\\[2\\]"] - #[inline] - pub fn sdio2(self) -> &'a mut W { - self.variant(BB_DATA_OUT_ENW::SDIO2) - } - #[doc = "SDIO\\[3\\]"] - #[inline] - pub fn sdio3(self) -> &'a mut W { - self.variant(BB_DATA_OUT_ENW::SDIO3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SCLK_FB`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_FBW { - #[doc = "`0`"] - DIS, - #[doc = "`1`"] - EN, - } - impl SCLK_FBW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCLK_FBW::DIS => false, - SCLK_FBW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCLK_FBW<'a> { - w: &'a mut W, - } - impl<'a> _SCLK_FBW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCLK_FBW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "`0`"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SCLK_FBW::DIS) - } - #[doc = "`1`"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SCLK_FBW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SPI Master enable."] - #[inline] - pub fn enable(&self) -> ENABLER { - ENABLER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Transaction FIFO Enable."] - #[inline] - pub fn tx_fifo_en(&self) -> TX_FIFO_ENR { - TX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Result FIFO Enable."] - #[inline] - pub fn rx_fifo_en(&self) -> RX_FIFO_ENR { - RX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Bit-Bang Mode."] - #[inline] - pub fn bbmode(&self) -> BBMODER { - BBMODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - This bits reflects the state of the currently selected slave select."] - #[inline] - pub fn ssdr(&self) -> SSDRR { - SSDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 6 - SSCLK Drive and State."] - #[inline] - pub fn sclk_dr(&self) -> SCLK_DRR { - SCLK_DRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:11 - SDIO Input Data Value."] - #[inline] - pub fn sdio_data_in(&self) -> SDIO_DATA_INR { - SDIO_DATA_INR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 12:15 - No description available."] - #[inline] - pub fn bb_data(&self) -> BB_DATAR { - BB_DATAR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:19 - Bit Bang SDIO Output Enable."] - #[inline] - pub fn bb_data_out_en(&self) -> BB_DATA_OUT_ENR { - BB_DATA_OUT_ENR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 24 - Enable SCLK Feedback Mode."] - #[inline] - pub fn sclk_fb(&self) -> SCLK_FBR { - SCLK_FBR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - SPI Master enable."] - #[inline] - pub fn enable(&mut self) -> _ENABLEW { - _ENABLEW { w: self } - } - #[doc = "Bit 1 - Transaction FIFO Enable."] - #[inline] - pub fn tx_fifo_en(&mut self) -> _TX_FIFO_ENW { - _TX_FIFO_ENW { w: self } - } - #[doc = "Bit 2 - Result FIFO Enable."] - #[inline] - pub fn rx_fifo_en(&mut self) -> _RX_FIFO_ENW { - _RX_FIFO_ENW { w: self } - } - #[doc = "Bit 3 - Bit-Bang Mode."] - #[inline] - pub fn bbmode(&mut self) -> _BBMODEW { - _BBMODEW { w: self } - } - #[doc = "Bit 4 - This bits reflects the state of the currently selected slave select."] - #[inline] - pub fn ssdr(&mut self) -> _SSDRW { - _SSDRW { w: self } - } - #[doc = "Bit 6 - SSCLK Drive and State."] - #[inline] - pub fn sclk_dr(&mut self) -> _SCLK_DRW { - _SCLK_DRW { w: self } - } - #[doc = "Bits 8:11 - SDIO Input Data Value."] - #[inline] - pub fn sdio_data_in(&mut self) -> _SDIO_DATA_INW { - _SDIO_DATA_INW { w: self } - } - #[doc = "Bits 12:15 - No description available."] - #[inline] - pub fn bb_data(&mut self) -> _BB_DATAW { - _BB_DATAW { w: self } - } - #[doc = "Bits 16:19 - Bit Bang SDIO Output Enable."] - #[inline] - pub fn bb_data_out_en(&mut self) -> _BB_DATA_OUT_ENW { - _BB_DATA_OUT_ENW { w: self } - } - #[doc = "Bit 24 - Enable SCLK Feedback Mode."] - #[inline] - pub fn sclk_fb(&mut self) -> _SCLK_FBW { - _SCLK_FBW { w: self } - } - } - } - #[doc = "SPIX Controller FIFO Control and Status Register."] - pub struct FIFO_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller FIFO Control and Status Register."] - pub mod fifo_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_AE_LVLR { - bits: u8, - } - impl TX_FIFO_AE_LVLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_CNTR { - bits: u8, - } - impl TX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_AF_LVLR { - bits: u8, - } - impl RX_FIFO_AF_LVLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_CNTR { - bits: u8, - } - impl RX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_AE_LVLW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_AE_LVLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_CNTW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_AF_LVLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_AF_LVLW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_CNTW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_CNTW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Transaction FIFO Almost Empty Level."] - #[inline] - pub fn tx_fifo_ae_lvl(&self) -> TX_FIFO_AE_LVLR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_AE_LVLR { bits } - } - #[doc = "Bits 8:12 - Transaction FIFO Used."] - #[inline] - pub fn tx_fifo_cnt(&self) -> TX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_CNTR { bits } - } - #[doc = "Bits 16:20 - Results FIFO Almost Full Level."] - #[inline] - pub fn rx_fifo_af_lvl(&self) -> RX_FIFO_AF_LVLR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_AF_LVLR { bits } - } - #[doc = "Bits 24:29 - Result FIFO Used."] - #[inline] - pub fn rx_fifo_cnt(&self) -> RX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_CNTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Transaction FIFO Almost Empty Level."] - #[inline] - pub fn tx_fifo_ae_lvl(&mut self) -> _TX_FIFO_AE_LVLW { - _TX_FIFO_AE_LVLW { w: self } - } - #[doc = "Bits 8:12 - Transaction FIFO Used."] - #[inline] - pub fn tx_fifo_cnt(&mut self) -> _TX_FIFO_CNTW { - _TX_FIFO_CNTW { w: self } - } - #[doc = "Bits 16:20 - Results FIFO Almost Full Level."] - #[inline] - pub fn rx_fifo_af_lvl(&mut self) -> _RX_FIFO_AF_LVLW { - _RX_FIFO_AF_LVLW { w: self } - } - #[doc = "Bits 24:29 - Result FIFO Used."] - #[inline] - pub fn rx_fifo_cnt(&mut self) -> _RX_FIFO_CNTW { - _RX_FIFO_CNTW { w: self } - } - } - } - #[doc = "SPIX Controller Special Control Register."] - pub struct SPCTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller Special Control Register."] - pub mod spctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SPCTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SCLKINH3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLKINH3R { - #[doc = "Allow trailing SCLK low pulse prior to Slave Select de-assertion."] - EN, - #[doc = "Inhibit trailing SCLK low pulse prior to Slave Select de-assertion."] - DIS, - } - impl SCLKINH3R { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCLKINH3R::EN => false, - SCLKINH3R::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCLKINH3R { - match value { - false => SCLKINH3R::EN, - true => SCLKINH3R::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SCLKINH3R::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SCLKINH3R::DIS - } - } - #[doc = "Values that can be written to the field `SCLKINH3`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLKINH3W { - #[doc = "Allow trailing SCLK low pulse prior to Slave Select de-assertion."] - EN, - #[doc = "Inhibit trailing SCLK low pulse prior to Slave Select de-assertion."] - DIS, - } - impl SCLKINH3W { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCLKINH3W::EN => false, - SCLKINH3W::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCLKINH3W<'a> { - w: &'a mut W, - } - impl<'a> _SCLKINH3W<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCLKINH3W) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Allow trailing SCLK low pulse prior to Slave Select de-assertion."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SCLKINH3W::EN) - } - #[doc = "Inhibit trailing SCLK low pulse prior to Slave Select de-assertion."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SCLKINH3W::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 16 - SCLK Inhibit Mode3. In SPI Mode 3, some SPI flash read timing diagrams show the last SCLK going low prior to de-assertion. The default is to support this additional falling edge of clock. When this bit is set and the device is in SPI Mode 3, the SPI clock is held high while Slave Select is de-asserted. This is to support some SPI flash write timing diagrams."] - #[inline] - pub fn sclkinh3(&self) -> SCLKINH3R { - SCLKINH3R::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 16 - SCLK Inhibit Mode3. In SPI Mode 3, some SPI flash read timing diagrams show the last SCLK going low prior to de-assertion. The default is to support this additional falling edge of clock. When this bit is set and the device is in SPI Mode 3, the SPI clock is held high while Slave Select is de-asserted. This is to support some SPI flash write timing diagrams."] - #[inline] - pub fn sclkinh3(&mut self) -> _SCLKINH3W { - _SCLKINH3W { w: self } - } - } - } - #[doc = "SPIX Controller Interrupt Status Register."] - pub struct INTFL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller Interrupt Status Register."] - pub mod intfl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTFL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STALLEDR { - #[doc = "Normal FIFO Transaction."] - CLR, - #[doc = "Stalled FIFO Transaction."] - SET, - } - impl TX_STALLEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_STALLEDR::CLR => false, - TX_STALLEDR::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_STALLEDR { - match value { - false => TX_STALLEDR::CLR, - true => TX_STALLEDR::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == TX_STALLEDR::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == TX_STALLEDR::SET - } - } - #[doc = "Possible values of the field `RX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_STALLEDR { - #[doc = "Normal FIFO Operation."] - CLR, - #[doc = "Stalled FIFO."] - SET, - } - impl RX_STALLEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_STALLEDR::CLR => false, - RX_STALLEDR::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_STALLEDR { - match value { - false => RX_STALLEDR::CLR, - true => RX_STALLEDR::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == RX_STALLEDR::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == RX_STALLEDR::SET - } - } - #[doc = "Possible values of the field `TX_READY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READYR { - #[doc = "FIFO Transaction not ready."] - CLR, - #[doc = "FIFO Transaction ready."] - SET, - } - impl TX_READYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_READYR::CLR => false, - TX_READYR::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_READYR { - match value { - false => TX_READYR::CLR, - true => TX_READYR::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == TX_READYR::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == TX_READYR::SET - } - } - #[doc = "Possible values of the field `RX_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DONER { - #[doc = "Results FIFO ready."] - CLR, - #[doc = "Results FIFO Not ready."] - SET, - } - impl RX_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_DONER::CLR => false, - RX_DONER::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_DONER { - match value { - false => RX_DONER::CLR, - true => RX_DONER::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == RX_DONER::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == RX_DONER::SET - } - } - #[doc = "Possible values of the field `TX_FIFO_AE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_AER { - #[doc = "Transaction FIFO not Almost Empty."] - CLR, - #[doc = "Transaction FIFO Almost Empty."] - SET, - } - impl TX_FIFO_AER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_AER::CLR => false, - TX_FIFO_AER::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_AER { - match value { - false => TX_FIFO_AER::CLR, - true => TX_FIFO_AER::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == TX_FIFO_AER::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == TX_FIFO_AER::SET - } - } - #[doc = "Possible values of the field `RX_FIFO_AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_AFR { - #[doc = "Results FIFO level below the Almost Full level."] - CLR, - #[doc = "Results FIFO level at Almost Full level."] - SET, - } - impl RX_FIFO_AFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_AFR::CLR => false, - RX_FIFO_AFR::SET => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_AFR { - match value { - false => RX_FIFO_AFR::CLR, - true => RX_FIFO_AFR::SET, - } - } - #[doc = "Checks if the value of the field is `CLR`"] - #[inline] - pub fn is_clr(&self) -> bool { - *self == RX_FIFO_AFR::CLR - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == RX_FIFO_AFR::SET - } - } - #[doc = "Values that can be written to the field `TX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STALLEDW { - #[doc = "Normal FIFO Transaction."] - CLR, - #[doc = "Stalled FIFO Transaction."] - SET, - } - impl TX_STALLEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_STALLEDW::CLR => false, - TX_STALLEDW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_STALLEDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_STALLEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_STALLEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal FIFO Transaction."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(TX_STALLEDW::CLR) - } - #[doc = "Stalled FIFO Transaction."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(TX_STALLEDW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_STALLEDW { - #[doc = "Normal FIFO Operation."] - CLR, - #[doc = "Stalled FIFO."] - SET, - } - impl RX_STALLEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_STALLEDW::CLR => false, - RX_STALLEDW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_STALLEDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_STALLEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_STALLEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal FIFO Operation."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(RX_STALLEDW::CLR) - } - #[doc = "Stalled FIFO."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(RX_STALLEDW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_READY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READYW { - #[doc = "FIFO Transaction not ready."] - CLR, - #[doc = "FIFO Transaction ready."] - SET, - } - impl TX_READYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_READYW::CLR => false, - TX_READYW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_READYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_READYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_READYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "FIFO Transaction not ready."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(TX_READYW::CLR) - } - #[doc = "FIFO Transaction ready."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(TX_READYW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DONEW { - #[doc = "Results FIFO ready."] - CLR, - #[doc = "Results FIFO Not ready."] - SET, - } - impl RX_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_DONEW::CLR => false, - RX_DONEW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Results FIFO ready."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(RX_DONEW::CLR) - } - #[doc = "Results FIFO Not ready."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(RX_DONEW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_AE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_AEW { - #[doc = "Transaction FIFO not Almost Empty."] - CLR, - #[doc = "Transaction FIFO Almost Empty."] - SET, - } - impl TX_FIFO_AEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_AEW::CLR => false, - TX_FIFO_AEW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_AEW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_AEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_AEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Transaction FIFO not Almost Empty."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(TX_FIFO_AEW::CLR) - } - #[doc = "Transaction FIFO Almost Empty."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(TX_FIFO_AEW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_AFW { - #[doc = "Results FIFO level below the Almost Full level."] - CLR, - #[doc = "Results FIFO level at Almost Full level."] - SET, - } - impl RX_FIFO_AFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_AFW::CLR => false, - RX_FIFO_AFW::SET => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_AFW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_AFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_AFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Results FIFO level below the Almost Full level."] - #[inline] - pub fn clr(self) -> &'a mut W { - self.variant(RX_FIFO_AFW::CLR) - } - #[doc = "Results FIFO level at Almost Full level."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(RX_FIFO_AFW::SET) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transaction Stalled Interrupt Flag."] - #[inline] - pub fn tx_stalled(&self) -> TX_STALLEDR { - TX_STALLEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Results Stalled Interrupt Flag."] - #[inline] - pub fn rx_stalled(&self) -> RX_STALLEDR { - RX_STALLEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Transaction Ready Interrupt Status."] - #[inline] - pub fn tx_ready(&self) -> TX_READYR { - TX_READYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Results Done Interrupt Status."] - #[inline] - pub fn rx_done(&self) -> RX_DONER { - RX_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Transaction FIFO Almost Empty Flag."] - #[inline] - pub fn tx_fifo_ae(&self) -> TX_FIFO_AER { - TX_FIFO_AER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Results FIFO Almost Full Flag."] - #[inline] - pub fn rx_fifo_af(&self) -> RX_FIFO_AFR { - RX_FIFO_AFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transaction Stalled Interrupt Flag."] - #[inline] - pub fn tx_stalled(&mut self) -> _TX_STALLEDW { - _TX_STALLEDW { w: self } - } - #[doc = "Bit 1 - Results Stalled Interrupt Flag."] - #[inline] - pub fn rx_stalled(&mut self) -> _RX_STALLEDW { - _RX_STALLEDW { w: self } - } - #[doc = "Bit 2 - Transaction Ready Interrupt Status."] - #[inline] - pub fn tx_ready(&mut self) -> _TX_READYW { - _TX_READYW { w: self } - } - #[doc = "Bit 3 - Results Done Interrupt Status."] - #[inline] - pub fn rx_done(&mut self) -> _RX_DONEW { - _RX_DONEW { w: self } - } - #[doc = "Bit 4 - Transaction FIFO Almost Empty Flag."] - #[inline] - pub fn tx_fifo_ae(&mut self) -> _TX_FIFO_AEW { - _TX_FIFO_AEW { w: self } - } - #[doc = "Bit 5 - Results FIFO Almost Full Flag."] - #[inline] - pub fn rx_fifo_af(&mut self) -> _RX_FIFO_AFW { - _RX_FIFO_AFW { w: self } - } - } - } - #[doc = "SPIX Controller Interrupt Enable Register."] - pub struct INTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Controller Interrupt Enable Register."] - pub mod inten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STALLEDR { - #[doc = "Disable Transaction Stalled Interrupt."] - EN, - #[doc = "Enable Transaction Stalled Interrupt."] - DIS, - } - impl TX_STALLEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_STALLEDR::EN => false, - TX_STALLEDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_STALLEDR { - match value { - false => TX_STALLEDR::EN, - true => TX_STALLEDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_STALLEDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_STALLEDR::DIS - } - } - #[doc = "Possible values of the field `RX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_STALLEDR { - #[doc = "Disable Results Stalled Interrupt."] - EN, - #[doc = "Enable Results Stalled Interrupt."] - DIS, - } - impl RX_STALLEDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_STALLEDR::EN => false, - RX_STALLEDR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_STALLEDR { - match value { - false => RX_STALLEDR::EN, - true => RX_STALLEDR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_STALLEDR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_STALLEDR::DIS - } - } - #[doc = "Possible values of the field `TX_READY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READYR { - #[doc = "Disable FIFO Transaction Ready Interrupt."] - EN, - #[doc = "Enable FIFO Transaction Ready Interrupt."] - DIS, - } - impl TX_READYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_READYR::EN => false, - TX_READYR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_READYR { - match value { - false => TX_READYR::EN, - true => TX_READYR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_READYR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_READYR::DIS - } - } - #[doc = "Possible values of the field `RX_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DONER { - #[doc = "Disable Results Done Interrupt."] - EN, - #[doc = "Enable Results Done Interrupt."] - DIS, - } - impl RX_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_DONER::EN => false, - RX_DONER::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_DONER { - match value { - false => RX_DONER::EN, - true => RX_DONER::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_DONER::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_DONER::DIS - } - } - #[doc = "Possible values of the field `TX_FIFO_AE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_AER { - #[doc = "Disable Transaction FIFO Almost Empty Interrupt."] - EN, - #[doc = "Enable Transaction FIFO Almost Empty Interrupt."] - DIS, - } - impl TX_FIFO_AER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_AER::EN => false, - TX_FIFO_AER::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_AER { - match value { - false => TX_FIFO_AER::EN, - true => TX_FIFO_AER::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_FIFO_AER::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_FIFO_AER::DIS - } - } - #[doc = "Possible values of the field `RX_FIFO_AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_AFR { - #[doc = "Disable Results FIFO Almost Full Interrupt."] - EN, - #[doc = "Enable Results FIFO Almost Full Interrupt."] - DIS, - } - impl RX_FIFO_AFR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_AFR::EN => false, - RX_FIFO_AFR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_AFR { - match value { - false => RX_FIFO_AFR::EN, - true => RX_FIFO_AFR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FIFO_AFR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FIFO_AFR::DIS - } - } - #[doc = "Values that can be written to the field `TX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_STALLEDW { - #[doc = "Disable Transaction Stalled Interrupt."] - EN, - #[doc = "Enable Transaction Stalled Interrupt."] - DIS, - } - impl TX_STALLEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_STALLEDW::EN => false, - TX_STALLEDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_STALLEDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_STALLEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_STALLEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Transaction Stalled Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_STALLEDW::EN) - } - #[doc = "Enable Transaction Stalled Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_STALLEDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_STALLED`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_STALLEDW { - #[doc = "Disable Results Stalled Interrupt."] - EN, - #[doc = "Enable Results Stalled Interrupt."] - DIS, - } - impl RX_STALLEDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_STALLEDW::EN => false, - RX_STALLEDW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_STALLEDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_STALLEDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_STALLEDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Results Stalled Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_STALLEDW::EN) - } - #[doc = "Enable Results Stalled Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_STALLEDW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_READY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_READYW { - #[doc = "Disable FIFO Transaction Ready Interrupt."] - EN, - #[doc = "Enable FIFO Transaction Ready Interrupt."] - DIS, - } - impl TX_READYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_READYW::EN => false, - TX_READYW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_READYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_READYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_READYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable FIFO Transaction Ready Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_READYW::EN) - } - #[doc = "Enable FIFO Transaction Ready Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_READYW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DONEW { - #[doc = "Disable Results Done Interrupt."] - EN, - #[doc = "Enable Results Done Interrupt."] - DIS, - } - impl RX_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_DONEW::EN => false, - RX_DONEW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Results Done Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_DONEW::EN) - } - #[doc = "Enable Results Done Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_DONEW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_AE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_AEW { - #[doc = "Disable Transaction FIFO Almost Empty Interrupt."] - EN, - #[doc = "Enable Transaction FIFO Almost Empty Interrupt."] - DIS, - } - impl TX_FIFO_AEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_AEW::EN => false, - TX_FIFO_AEW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_AEW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_AEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_AEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Transaction FIFO Almost Empty Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_FIFO_AEW::EN) - } - #[doc = "Enable Transaction FIFO Almost Empty Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_FIFO_AEW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_AF`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_AFW { - #[doc = "Disable Results FIFO Almost Full Interrupt."] - EN, - #[doc = "Enable Results FIFO Almost Full Interrupt."] - DIS, - } - impl RX_FIFO_AFW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_AFW::EN => false, - RX_FIFO_AFW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_AFW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_AFW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_AFW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Results FIFO Almost Full Interrupt."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FIFO_AFW::EN) - } - #[doc = "Enable Results FIFO Almost Full Interrupt."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FIFO_AFW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Transaction Stalled Interrupt Enable."] - #[inline] - pub fn tx_stalled(&self) -> TX_STALLEDR { - TX_STALLEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Results Stalled Interrupt Enable."] - #[inline] - pub fn rx_stalled(&self) -> RX_STALLEDR { - RX_STALLEDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Transaction Ready Interrupt Enable."] - #[inline] - pub fn tx_ready(&self) -> TX_READYR { - TX_READYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Results Done Interrupt Enable."] - #[inline] - pub fn rx_done(&self) -> RX_DONER { - RX_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Transaction FIFO Almost Empty Interrupt Enable."] - #[inline] - pub fn tx_fifo_ae(&self) -> TX_FIFO_AER { - TX_FIFO_AER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Results FIFO Almost Full Interrupt Enable."] - #[inline] - pub fn rx_fifo_af(&self) -> RX_FIFO_AFR { - RX_FIFO_AFR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Transaction Stalled Interrupt Enable."] - #[inline] - pub fn tx_stalled(&mut self) -> _TX_STALLEDW { - _TX_STALLEDW { w: self } - } - #[doc = "Bit 1 - Results Stalled Interrupt Enable."] - #[inline] - pub fn rx_stalled(&mut self) -> _RX_STALLEDW { - _RX_STALLEDW { w: self } - } - #[doc = "Bit 2 - Transaction Ready Interrupt Enable."] - #[inline] - pub fn tx_ready(&mut self) -> _TX_READYW { - _TX_READYW { w: self } - } - #[doc = "Bit 3 - Results Done Interrupt Enable."] - #[inline] - pub fn rx_done(&mut self) -> _RX_DONEW { - _RX_DONEW { w: self } - } - #[doc = "Bit 4 - Transaction FIFO Almost Empty Interrupt Enable."] - #[inline] - pub fn tx_fifo_ae(&mut self) -> _TX_FIFO_AEW { - _TX_FIFO_AEW { w: self } - } - #[doc = "Bit 5 - Results FIFO Almost Full Interrupt Enable."] - #[inline] - pub fn rx_fifo_af(&mut self) -> _RX_FIFO_AFW { - _RX_FIFO_AFW { w: self } - } - } - } -} -#[doc = "SPI XiP Master Controller FIFO."] -pub struct SPIXF_FIFO { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPIXF_FIFO {} -impl SPIXF_FIFO { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spixf_fifo::RegisterBlock { - 0x400b_c000 as *const _ - } -} -impl Deref for SPIXF_FIFO { - type Target = spixf_fifo::RegisterBlock; - fn deref(&self) -> &spixf_fifo::RegisterBlock { - unsafe { &*SPIXF_FIFO::ptr() } - } -} -#[doc = "SPI XiP Master Controller FIFO."] -pub mod spixf_fifo { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - SPI TX FIFO 8-Bit Write"] - pub tx_8: TX_8, - _reserved0: [u8; 3usize], - #[doc = "0x04 - SPI RX FIFO 8-Bit Access"] - pub rx_8: RX_8, - } - #[doc = "SPI TX FIFO 8-Bit Write"] - pub struct TX_8 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "SPI TX FIFO 8-Bit Write"] - pub mod tx_8 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::TX_8 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "SPI TX FIFO 16-Bit Write"] - pub struct TX_16 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "SPI TX FIFO 16-Bit Write"] - pub mod tx_16 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::TX_16 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "SPI TX FIFO 32-Bit Write"] - pub struct TX_32 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI TX FIFO 32-Bit Write"] - pub mod tx_32 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TX_32 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "SPI RX FIFO 8-Bit Access"] - pub struct RX_8 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "SPI RX FIFO 8-Bit Access"] - pub mod rx_8 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::RX_8 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "SPI RX FIFO 16-Bit Access"] - pub struct RX_16 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "SPI RX FIFO 16-Bit Access"] - pub mod rx_16 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::RX_16 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "SPI RX FIFO 32-Bit Access"] - pub struct RX_32 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI RX FIFO 32-Bit Access"] - pub mod rx_32 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RX_32 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } -} -#[doc = "SPIXF Master"] -pub struct SPIXF { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPIXF {} -impl SPIXF { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spixf::RegisterBlock { - 0x4002_6000 as *const _ - } -} -impl Deref for SPIXF { - type Target = spixf::RegisterBlock; - fn deref(&self) -> &spixf::RegisterBlock { - unsafe { &*SPIXF::ptr() } - } -} -#[doc = "SPIXF Master"] -pub mod spixf { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - SPIX Configuration Register."] - pub cfg: CFG, - #[doc = "0x04 - SPIX Fetch Control Register."] - pub fetch_ctrl: FETCH_CTRL, - #[doc = "0x08 - SPIX Mode Control Register."] - pub mode_ctrl: MODE_CTRL, - #[doc = "0x0c - SPIX Mode Data Register."] - pub mode_data: MODE_DATA, - #[doc = "0x10 - SPIX Feedback Control Register."] - pub sclk_fb_ctrl: SCLK_FB_CTRL, - _reserved0: [u8; 8usize], - #[doc = "0x1c - SPIX IO Control Register."] - pub io_ctrl: IO_CTRL, - #[doc = "0x20 - SPIX Memory Security Control Register."] - pub memseccn: MEMSECCN, - } - #[doc = "SPIX Configuration Register."] - pub struct CFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Configuration Register."] - pub mod cfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CFG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "Description not available."] - SCLK_HI_SAMPLE_RISING, - #[doc = "Description not available."] - SCLK_LO_SAMPLE_FAILLING, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - MODER::SCLK_HI_SAMPLE_RISING => 0, - MODER::SCLK_LO_SAMPLE_FAILLING => 0x03, - MODER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> MODER { - match value { - 0 => MODER::SCLK_HI_SAMPLE_RISING, - 3 => MODER::SCLK_LO_SAMPLE_FAILLING, - i => MODER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SCLK_HI_SAMPLE_RISING`"] - #[inline] - pub fn is_sclk_hi_sample_rising(&self) -> bool { - *self == MODER::SCLK_HI_SAMPLE_RISING - } - #[doc = "Checks if the value of the field is `SCLK_LO_SAMPLE_FAILLING`"] - #[inline] - pub fn is_sclk_lo_sample_failling(&self) -> bool { - *self == MODER::SCLK_LO_SAMPLE_FAILLING - } - } - #[doc = "Possible values of the field `SSPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSPOLR { - #[doc = "Slave Select is Active High."] - ACTIVE_HIGH, - #[doc = "Slave Select is Active Low."] - ACTIVE_LOW, - } - impl SSPOLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSPOLR::ACTIVE_HIGH => false, - SSPOLR::ACTIVE_LOW => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSPOLR { - match value { - false => SSPOLR::ACTIVE_HIGH, - true => SSPOLR::ACTIVE_LOW, - } - } - #[doc = "Checks if the value of the field is `ACTIVE_HIGH`"] - #[inline] - pub fn is_active_high(&self) -> bool { - *self == SSPOLR::ACTIVE_HIGH - } - #[doc = "Checks if the value of the field is `ACTIVE_LOW`"] - #[inline] - pub fn is_active_low(&self) -> bool { - *self == SSPOLR::ACTIVE_LOW - } - } - #[doc = r" Value of the field"] - pub struct SSELR { - bits: u8, - } - impl SSELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct LO_CLKR { - bits: u8, - } - impl LO_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct HI_CLKR { - bits: u8, - } - impl HI_CLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `SSACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACTR { - #[doc = "0 system clocks."] - OFF, - #[doc = "2 System clocks."] - FOR_2_MOD_CLK, - #[doc = "4 System clocks."] - FOR_4_MOD_CLK, - #[doc = "8 System clocks."] - FOR_8_MOD_CLK, - } - impl SSACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSACTR::OFF => 0, - SSACTR::FOR_2_MOD_CLK => 0x01, - SSACTR::FOR_4_MOD_CLK => 0x02, - SSACTR::FOR_8_MOD_CLK => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSACTR { - match value { - 0 => SSACTR::OFF, - 1 => SSACTR::FOR_2_MOD_CLK, - 2 => SSACTR::FOR_4_MOD_CLK, - 3 => SSACTR::FOR_8_MOD_CLK, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `OFF`"] - #[inline] - pub fn is_off(&self) -> bool { - *self == SSACTR::OFF - } - #[doc = "Checks if the value of the field is `FOR_2_MOD_CLK`"] - #[inline] - pub fn is_for_2_mod_clk(&self) -> bool { - *self == SSACTR::FOR_2_MOD_CLK - } - #[doc = "Checks if the value of the field is `FOR_4_MOD_CLK`"] - #[inline] - pub fn is_for_4_mod_clk(&self) -> bool { - *self == SSACTR::FOR_4_MOD_CLK - } - #[doc = "Checks if the value of the field is `FOR_8_MOD_CLK`"] - #[inline] - pub fn is_for_8_mod_clk(&self) -> bool { - *self == SSACTR::FOR_8_MOD_CLK - } - } - #[doc = "Possible values of the field `SSIACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSIACTR { - #[doc = "1 system clocks."] - FOR_1_MOD_CLK, - #[doc = "3 System clocks."] - FOR_3_MOD_CLK, - #[doc = "5 System clocks."] - FOR_5_MOD_CLK, - #[doc = "9 System clocks."] - FOR_9_MOD_CLK, - } - impl SSIACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSIACTR::FOR_1_MOD_CLK => 0, - SSIACTR::FOR_3_MOD_CLK => 0x01, - SSIACTR::FOR_5_MOD_CLK => 0x02, - SSIACTR::FOR_9_MOD_CLK => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSIACTR { - match value { - 0 => SSIACTR::FOR_1_MOD_CLK, - 1 => SSIACTR::FOR_3_MOD_CLK, - 2 => SSIACTR::FOR_5_MOD_CLK, - 3 => SSIACTR::FOR_9_MOD_CLK, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `FOR_1_MOD_CLK`"] - #[inline] - pub fn is_for_1_mod_clk(&self) -> bool { - *self == SSIACTR::FOR_1_MOD_CLK - } - #[doc = "Checks if the value of the field is `FOR_3_MOD_CLK`"] - #[inline] - pub fn is_for_3_mod_clk(&self) -> bool { - *self == SSIACTR::FOR_3_MOD_CLK - } - #[doc = "Checks if the value of the field is `FOR_5_MOD_CLK`"] - #[inline] - pub fn is_for_5_mod_clk(&self) -> bool { - *self == SSIACTR::FOR_5_MOD_CLK - } - #[doc = "Checks if the value of the field is `FOR_9_MOD_CLK`"] - #[inline] - pub fn is_for_9_mod_clk(&self) -> bool { - *self == SSIACTR::FOR_9_MOD_CLK - } - } - #[doc = "Values that can be written to the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "Description not available."] - SCLK_HI_SAMPLE_RISING, - #[doc = "Description not available."] - SCLK_LO_SAMPLE_FAILLING, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - MODEW::SCLK_HI_SAMPLE_RISING => 0, - MODEW::SCLK_LO_SAMPLE_FAILLING => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Description not available."] - #[inline] - pub fn sclk_hi_sample_rising(self) -> &'a mut W { - self.variant(MODEW::SCLK_HI_SAMPLE_RISING) - } - #[doc = "Description not available."] - #[inline] - pub fn sclk_lo_sample_failling(self) -> &'a mut W { - self.variant(MODEW::SCLK_LO_SAMPLE_FAILLING) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSPOLW { - #[doc = "Slave Select is Active High."] - ACTIVE_HIGH, - #[doc = "Slave Select is Active Low."] - ACTIVE_LOW, - } - impl SSPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSPOLW::ACTIVE_HIGH => false, - SSPOLW::ACTIVE_LOW => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSPOLW<'a> { - w: &'a mut W, - } - impl<'a> _SSPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSPOLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Slave Select is Active High."] - #[inline] - pub fn active_high(self) -> &'a mut W { - self.variant(SSPOLW::ACTIVE_HIGH) - } - #[doc = "Slave Select is Active Low."] - #[inline] - pub fn active_low(self) -> &'a mut W { - self.variant(SSPOLW::ACTIVE_LOW) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SSELW<'a> { - w: &'a mut W, - } - impl<'a> _SSELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LO_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _LO_CLKW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HI_CLKW<'a> { - w: &'a mut W, - } - impl<'a> _HI_CLKW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSACTW { - #[doc = "0 system clocks."] - OFF, - #[doc = "2 System clocks."] - FOR_2_MOD_CLK, - #[doc = "4 System clocks."] - FOR_4_MOD_CLK, - #[doc = "8 System clocks."] - FOR_8_MOD_CLK, - } - impl SSACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSACTW::OFF => 0, - SSACTW::FOR_2_MOD_CLK => 1, - SSACTW::FOR_4_MOD_CLK => 2, - SSACTW::FOR_8_MOD_CLK => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SSACTW<'a> { - w: &'a mut W, - } - impl<'a> _SSACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSACTW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "0 system clocks."] - #[inline] - pub fn off(self) -> &'a mut W { - self.variant(SSACTW::OFF) - } - #[doc = "2 System clocks."] - #[inline] - pub fn for_2_mod_clk(self) -> &'a mut W { - self.variant(SSACTW::FOR_2_MOD_CLK) - } - #[doc = "4 System clocks."] - #[inline] - pub fn for_4_mod_clk(self) -> &'a mut W { - self.variant(SSACTW::FOR_4_MOD_CLK) - } - #[doc = "8 System clocks."] - #[inline] - pub fn for_8_mod_clk(self) -> &'a mut W { - self.variant(SSACTW::FOR_8_MOD_CLK) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSIACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSIACTW { - #[doc = "1 system clocks."] - FOR_1_MOD_CLK, - #[doc = "3 System clocks."] - FOR_3_MOD_CLK, - #[doc = "5 System clocks."] - FOR_5_MOD_CLK, - #[doc = "9 System clocks."] - FOR_9_MOD_CLK, - } - impl SSIACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSIACTW::FOR_1_MOD_CLK => 0, - SSIACTW::FOR_3_MOD_CLK => 1, - SSIACTW::FOR_5_MOD_CLK => 2, - SSIACTW::FOR_9_MOD_CLK => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _SSIACTW<'a> { - w: &'a mut W, - } - impl<'a> _SSIACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSIACTW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "1 system clocks."] - #[inline] - pub fn for_1_mod_clk(self) -> &'a mut W { - self.variant(SSIACTW::FOR_1_MOD_CLK) - } - #[doc = "3 System clocks."] - #[inline] - pub fn for_3_mod_clk(self) -> &'a mut W { - self.variant(SSIACTW::FOR_3_MOD_CLK) - } - #[doc = "5 System clocks."] - #[inline] - pub fn for_5_mod_clk(self) -> &'a mut W { - self.variant(SSIACTW::FOR_5_MOD_CLK) - } - #[doc = "9 System clocks."] - #[inline] - pub fn for_9_mod_clk(self) -> &'a mut W { - self.variant(SSIACTW::FOR_9_MOD_CLK) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 18; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:1 - Defines SPI Mode, Only valid values are 0 and 3."] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 2 - Slave Select Polarity."] - #[inline] - pub fn sspol(&self) -> SSPOLR { - SSPOLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 4:6 - Slave Select. Only valid value is zero."] - #[inline] - pub fn ssel(&self) -> SSELR { - let bits = { - const MASK: u8 = 0x07; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - SSELR { bits } - } - #[doc = "Bits 8:11 - Number of system clocks that SCLK will be low when SCLK pulses are generated."] - #[inline] - pub fn lo_clk(&self) -> LO_CLKR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - LO_CLKR { bits } - } - #[doc = "Bits 12:15 - Number of system clocks that SCLK will be high when SCLK pulses are generated."] - #[inline] - pub fn hi_clk(&self) -> HI_CLKR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - HI_CLKR { bits } - } - #[doc = "Bits 16:17 - Slave Select Active Timing."] - #[inline] - pub fn ssact(&self) -> SSACTR { - SSACTR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 18:19 - Slave Select Inactive Timing."] - #[inline] - pub fn ssiact(&self) -> SSIACTR { - SSIACTR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 18; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:1 - Defines SPI Mode, Only valid values are 0 and 3."] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - #[doc = "Bit 2 - Slave Select Polarity."] - #[inline] - pub fn sspol(&mut self) -> _SSPOLW { - _SSPOLW { w: self } - } - #[doc = "Bits 4:6 - Slave Select. Only valid value is zero."] - #[inline] - pub fn ssel(&mut self) -> _SSELW { - _SSELW { w: self } - } - #[doc = "Bits 8:11 - Number of system clocks that SCLK will be low when SCLK pulses are generated."] - #[inline] - pub fn lo_clk(&mut self) -> _LO_CLKW { - _LO_CLKW { w: self } - } - #[doc = "Bits 12:15 - Number of system clocks that SCLK will be high when SCLK pulses are generated."] - #[inline] - pub fn hi_clk(&mut self) -> _HI_CLKW { - _HI_CLKW { w: self } - } - #[doc = "Bits 16:17 - Slave Select Active Timing."] - #[inline] - pub fn ssact(&mut self) -> _SSACTW { - _SSACTW { w: self } - } - #[doc = "Bits 18:19 - Slave Select Inactive Timing."] - #[inline] - pub fn ssiact(&mut self) -> _SSIACTW { - _SSIACTW { w: self } - } - } - } - #[doc = "SPIX Fetch Control Register."] - pub struct FETCH_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Fetch Control Register."] - pub mod fetch_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FETCH_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CMDVALR { - bits: u8, - } - impl CMDVALR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `CMD_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CMD_WIDTHR { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl CMD_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - CMD_WIDTHR::SINGLE => 0, - CMD_WIDTHR::DUAL_IO => 0x01, - CMD_WIDTHR::QUAD_IO => 0x02, - CMD_WIDTHR::INVALID => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> CMD_WIDTHR { - match value { - 0 => CMD_WIDTHR::SINGLE, - 1 => CMD_WIDTHR::DUAL_IO, - 2 => CMD_WIDTHR::QUAD_IO, - 3 => CMD_WIDTHR::INVALID, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `SINGLE`"] - #[inline] - pub fn is_single(&self) -> bool { - *self == CMD_WIDTHR::SINGLE - } - #[doc = "Checks if the value of the field is `DUAL_IO`"] - #[inline] - pub fn is_dual_io(&self) -> bool { - *self == CMD_WIDTHR::DUAL_IO - } - #[doc = "Checks if the value of the field is `QUAD_IO`"] - #[inline] - pub fn is_quad_io(&self) -> bool { - *self == CMD_WIDTHR::QUAD_IO - } - #[doc = "Checks if the value of the field is `INVALID`"] - #[inline] - pub fn is_invalid(&self) -> bool { - *self == CMD_WIDTHR::INVALID - } - } - #[doc = "Possible values of the field `ADDR_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_WIDTHR { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl ADDR_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - ADDR_WIDTHR::SINGLE => 0, - ADDR_WIDTHR::DUAL_IO => 0x01, - ADDR_WIDTHR::QUAD_IO => 0x02, - ADDR_WIDTHR::INVALID => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> ADDR_WIDTHR { - match value { - 0 => ADDR_WIDTHR::SINGLE, - 1 => ADDR_WIDTHR::DUAL_IO, - 2 => ADDR_WIDTHR::QUAD_IO, - 3 => ADDR_WIDTHR::INVALID, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `SINGLE`"] - #[inline] - pub fn is_single(&self) -> bool { - *self == ADDR_WIDTHR::SINGLE - } - #[doc = "Checks if the value of the field is `DUAL_IO`"] - #[inline] - pub fn is_dual_io(&self) -> bool { - *self == ADDR_WIDTHR::DUAL_IO - } - #[doc = "Checks if the value of the field is `QUAD_IO`"] - #[inline] - pub fn is_quad_io(&self) -> bool { - *self == ADDR_WIDTHR::QUAD_IO - } - #[doc = "Checks if the value of the field is `INVALID`"] - #[inline] - pub fn is_invalid(&self) -> bool { - *self == ADDR_WIDTHR::INVALID - } - } - #[doc = "Possible values of the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHR { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl DATA_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - DATA_WIDTHR::SINGLE => 0, - DATA_WIDTHR::DUAL_IO => 0x01, - DATA_WIDTHR::QUAD_IO => 0x02, - DATA_WIDTHR::INVALID => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> DATA_WIDTHR { - match value { - 0 => DATA_WIDTHR::SINGLE, - 1 => DATA_WIDTHR::DUAL_IO, - 2 => DATA_WIDTHR::QUAD_IO, - 3 => DATA_WIDTHR::INVALID, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `SINGLE`"] - #[inline] - pub fn is_single(&self) -> bool { - *self == DATA_WIDTHR::SINGLE - } - #[doc = "Checks if the value of the field is `DUAL_IO`"] - #[inline] - pub fn is_dual_io(&self) -> bool { - *self == DATA_WIDTHR::DUAL_IO - } - #[doc = "Checks if the value of the field is `QUAD_IO`"] - #[inline] - pub fn is_quad_io(&self) -> bool { - *self == DATA_WIDTHR::QUAD_IO - } - #[doc = "Checks if the value of the field is `INVALID`"] - #[inline] - pub fn is_invalid(&self) -> bool { - *self == DATA_WIDTHR::INVALID - } - } - #[doc = "Possible values of the field `FOUR_BYTE_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FOUR_BYTE_ADDRR { - #[doc = "3 Byte Address Mode."] - _3, - #[doc = "4 Byte Address Mode."] - _4, - } - impl FOUR_BYTE_ADDRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FOUR_BYTE_ADDRR::_3 => false, - FOUR_BYTE_ADDRR::_4 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FOUR_BYTE_ADDRR { - match value { - false => FOUR_BYTE_ADDRR::_3, - true => FOUR_BYTE_ADDRR::_4, - } - } - #[doc = "Checks if the value of the field is `_3`"] - #[inline] - pub fn is_3(&self) -> bool { - *self == FOUR_BYTE_ADDRR::_3 - } - #[doc = "Checks if the value of the field is `_4`"] - #[inline] - pub fn is_4(&self) -> bool { - *self == FOUR_BYTE_ADDRR::_4 - } - } - #[doc = r" Proxy"] - pub struct _CMDVALW<'a> { - w: &'a mut W, - } - impl<'a> _CMDVALW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CMD_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CMD_WIDTHW { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl CMD_WIDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - CMD_WIDTHW::SINGLE => 0, - CMD_WIDTHW::DUAL_IO => 1, - CMD_WIDTHW::QUAD_IO => 2, - CMD_WIDTHW::INVALID => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _CMD_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _CMD_WIDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CMD_WIDTHW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Single SDIO."] - #[inline] - pub fn single(self) -> &'a mut W { - self.variant(CMD_WIDTHW::SINGLE) - } - #[doc = "Dual SDIO."] - #[inline] - pub fn dual_io(self) -> &'a mut W { - self.variant(CMD_WIDTHW::DUAL_IO) - } - #[doc = "Quad SDIO."] - #[inline] - pub fn quad_io(self) -> &'a mut W { - self.variant(CMD_WIDTHW::QUAD_IO) - } - #[doc = "Invalid."] - #[inline] - pub fn invalid(self) -> &'a mut W { - self.variant(CMD_WIDTHW::INVALID) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ADDR_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ADDR_WIDTHW { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl ADDR_WIDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - ADDR_WIDTHW::SINGLE => 0, - ADDR_WIDTHW::DUAL_IO => 1, - ADDR_WIDTHW::QUAD_IO => 2, - ADDR_WIDTHW::INVALID => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _ADDR_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _ADDR_WIDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ADDR_WIDTHW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Single SDIO."] - #[inline] - pub fn single(self) -> &'a mut W { - self.variant(ADDR_WIDTHW::SINGLE) - } - #[doc = "Dual SDIO."] - #[inline] - pub fn dual_io(self) -> &'a mut W { - self.variant(ADDR_WIDTHW::DUAL_IO) - } - #[doc = "Quad SDIO."] - #[inline] - pub fn quad_io(self) -> &'a mut W { - self.variant(ADDR_WIDTHW::QUAD_IO) - } - #[doc = "Invalid."] - #[inline] - pub fn invalid(self) -> &'a mut W { - self.variant(ADDR_WIDTHW::INVALID) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHW { - #[doc = "Single SDIO."] - SINGLE, - #[doc = "Dual SDIO."] - DUAL_IO, - #[doc = "Quad SDIO."] - QUAD_IO, - #[doc = "Invalid."] - INVALID, - } - impl DATA_WIDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - DATA_WIDTHW::SINGLE => 0, - DATA_WIDTHW::DUAL_IO => 1, - DATA_WIDTHW::QUAD_IO => 2, - DATA_WIDTHW::INVALID => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _DATA_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_WIDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DATA_WIDTHW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Single SDIO."] - #[inline] - pub fn single(self) -> &'a mut W { - self.variant(DATA_WIDTHW::SINGLE) - } - #[doc = "Dual SDIO."] - #[inline] - pub fn dual_io(self) -> &'a mut W { - self.variant(DATA_WIDTHW::DUAL_IO) - } - #[doc = "Quad SDIO."] - #[inline] - pub fn quad_io(self) -> &'a mut W { - self.variant(DATA_WIDTHW::QUAD_IO) - } - #[doc = "Invalid."] - #[inline] - pub fn invalid(self) -> &'a mut W { - self.variant(DATA_WIDTHW::INVALID) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FOUR_BYTE_ADDR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FOUR_BYTE_ADDRW { - #[doc = "3 Byte Address Mode."] - _3, - #[doc = "4 Byte Address Mode."] - _4, - } - impl FOUR_BYTE_ADDRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FOUR_BYTE_ADDRW::_3 => false, - FOUR_BYTE_ADDRW::_4 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FOUR_BYTE_ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _FOUR_BYTE_ADDRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FOUR_BYTE_ADDRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "3 Byte Address Mode."] - #[inline] - pub fn _3(self) -> &'a mut W { - self.variant(FOUR_BYTE_ADDRW::_3) - } - #[doc = "4 Byte Address Mode."] - #[inline] - pub fn _4(self) -> &'a mut W { - self.variant(FOUR_BYTE_ADDRW::_4) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Command Value sent to target to initiate fetching from SPI flash."] - #[inline] - pub fn cmdval(&self) -> CMDVALR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - CMDVALR { bits } - } - #[doc = "Bits 8:9 - Command Width. Number of data I/O used to send commands."] - #[inline] - pub fn cmd_width(&self) -> CMD_WIDTHR { - CMD_WIDTHR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 10:11 - Address Width. Number of data I/O used to send address, and mode/dummy clocks."] - #[inline] - pub fn addr_width(&self) -> ADDR_WIDTHR { - ADDR_WIDTHR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 12:13 - Data Width. Number of data I/O used to receive data."] - #[inline] - pub fn data_width(&self) -> DATA_WIDTHR { - DATA_WIDTHR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 16 - Four Byte Address Mode. Enables 4-byte Flash Address Mode."] - #[inline] - pub fn four_byte_addr(&self) -> FOUR_BYTE_ADDRR { - FOUR_BYTE_ADDRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Command Value sent to target to initiate fetching from SPI flash."] - #[inline] - pub fn cmdval(&mut self) -> _CMDVALW { - _CMDVALW { w: self } - } - #[doc = "Bits 8:9 - Command Width. Number of data I/O used to send commands."] - #[inline] - pub fn cmd_width(&mut self) -> _CMD_WIDTHW { - _CMD_WIDTHW { w: self } - } - #[doc = "Bits 10:11 - Address Width. Number of data I/O used to send address, and mode/dummy clocks."] - #[inline] - pub fn addr_width(&mut self) -> _ADDR_WIDTHW { - _ADDR_WIDTHW { w: self } - } - #[doc = "Bits 12:13 - Data Width. Number of data I/O used to receive data."] - #[inline] - pub fn data_width(&mut self) -> _DATA_WIDTHW { - _DATA_WIDTHW { w: self } - } - #[doc = "Bit 16 - Four Byte Address Mode. Enables 4-byte Flash Address Mode."] - #[inline] - pub fn four_byte_addr(&mut self) -> _FOUR_BYTE_ADDRW { - _FOUR_BYTE_ADDRW { w: self } - } - } - } - #[doc = "SPIX Mode Control Register."] - pub struct MODE_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Mode Control Register."] - pub mod mode_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MODE_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct MDCLKR { - bits: u8, - } - impl MDCLKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `NO_CMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NO_CMDR { - #[doc = "Send read command every time SPI transaction is initiated."] - ALWAYS, - #[doc = "Send read command only once. NO read command in subsequent SPI transactions."] - ONCE, - } - impl NO_CMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - NO_CMDR::ALWAYS => false, - NO_CMDR::ONCE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> NO_CMDR { - match value { - false => NO_CMDR::ALWAYS, - true => NO_CMDR::ONCE, - } - } - #[doc = "Checks if the value of the field is `ALWAYS`"] - #[inline] - pub fn is_always(&self) -> bool { - *self == NO_CMDR::ALWAYS - } - #[doc = "Checks if the value of the field is `ONCE`"] - #[inline] - pub fn is_once(&self) -> bool { - *self == NO_CMDR::ONCE - } - } - #[doc = r" Proxy"] - pub struct _MDCLKW<'a> { - w: &'a mut W, - } - impl<'a> _MDCLKW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NO_CMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NO_CMDW { - #[doc = "Send read command every time SPI transaction is initiated."] - ALWAYS, - #[doc = "Send read command only once. NO read command in subsequent SPI transactions."] - ONCE, - } - impl NO_CMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - NO_CMDW::ALWAYS => false, - NO_CMDW::ONCE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _NO_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _NO_CMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NO_CMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Send read command every time SPI transaction is initiated."] - #[inline] - pub fn always(self) -> &'a mut W { - self.variant(NO_CMDW::ALWAYS) - } - #[doc = "Send read command only once. NO read command in subsequent SPI transactions."] - #[inline] - pub fn once(self) -> &'a mut W { - self.variant(NO_CMDW::ONCE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Mode Clocks. Number of SPI clocks needed during mode/dummy phase of fetch."] - #[inline] - pub fn mdclk(&self) -> MDCLKR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - MDCLKR { bits } - } - #[doc = "Bit 8 - No Command Mode."] - #[inline] - pub fn no_cmd(&self) -> NO_CMDR { - NO_CMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Mode Clocks. Number of SPI clocks needed during mode/dummy phase of fetch."] - #[inline] - pub fn mdclk(&mut self) -> _MDCLKW { - _MDCLKW { w: self } - } - #[doc = "Bit 8 - No Command Mode."] - #[inline] - pub fn no_cmd(&mut self) -> _NO_CMDW { - _NO_CMDW { w: self } - } - } - } - #[doc = "SPIX Mode Data Register."] - pub struct MODE_DATA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Mode Data Register."] - pub mod mode_data { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MODE_DATA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u16, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct OUT_ENR { - bits: u16, - } - impl OUT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OUT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _OUT_ENW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Mode Data. Specifies the data to send with the Dummy/Mode clocks."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - DATAR { bits } - } - #[doc = "Bits 16:31 - Mode Output Enable. Output enable state for each corresponding data bit in MD_DATA. 0: output enable off, I/O is tristate and 1: Output enable on, I/O is driving MD_DATA."] - #[inline] - pub fn out_en(&self) -> OUT_ENR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - OUT_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Mode Data. Specifies the data to send with the Dummy/Mode clocks."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - #[doc = "Bits 16:31 - Mode Output Enable. Output enable state for each corresponding data bit in MD_DATA. 0: output enable off, I/O is tristate and 1: Output enable on, I/O is driving MD_DATA."] - #[inline] - pub fn out_en(&mut self) -> _OUT_ENW { - _OUT_ENW { w: self } - } - } - } - #[doc = "SPIX Feedback Control Register."] - pub struct SCLK_FB_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Feedback Control Register."] - pub mod sclk_fb_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SCLK_FB_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `FB_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FB_ENR { - #[doc = "Disable SCLK feedback mode."] - DIS, - #[doc = "Enable SCLK feedback mode."] - EN, - } - impl FB_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FB_ENR::DIS => false, - FB_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FB_ENR { - match value { - false => FB_ENR::DIS, - true => FB_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FB_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FB_ENR::EN - } - } - #[doc = "Possible values of the field `INVERT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INVERT_ENR { - #[doc = "Disable Invert SCLK feedback mode."] - DIS, - #[doc = "Enable Invert SCLK feedback mode."] - EN, - } - impl INVERT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INVERT_ENR::DIS => false, - INVERT_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INVERT_ENR { - match value { - false => INVERT_ENR::DIS, - true => INVERT_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == INVERT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == INVERT_ENR::EN - } - } - #[doc = r" Value of the field"] - pub struct IGNORE_CLKSR { - bits: u8, - } - impl IGNORE_CLKSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct IGNORE_CLKS_NO_CMDR { - bits: u8, - } - impl IGNORE_CLKS_NO_CMDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `FB_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FB_ENW { - #[doc = "Disable SCLK feedback mode."] - DIS, - #[doc = "Enable SCLK feedback mode."] - EN, - } - impl FB_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FB_ENW::DIS => false, - FB_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FB_ENW<'a> { - w: &'a mut W, - } - impl<'a> _FB_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FB_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable SCLK feedback mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FB_ENW::DIS) - } - #[doc = "Enable SCLK feedback mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FB_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `INVERT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INVERT_ENW { - #[doc = "Disable Invert SCLK feedback mode."] - DIS, - #[doc = "Enable Invert SCLK feedback mode."] - EN, - } - impl INVERT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INVERT_ENW::DIS => false, - INVERT_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INVERT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _INVERT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INVERT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable Invert SCLK feedback mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(INVERT_ENW::DIS) - } - #[doc = "Enable Invert SCLK feedback mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(INVERT_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IGNORE_CLKSW<'a> { - w: &'a mut W, - } - impl<'a> _IGNORE_CLKSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _IGNORE_CLKS_NO_CMDW<'a> { - w: &'a mut W, - } - impl<'a> _IGNORE_CLKS_NO_CMDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Enable SCLK feedback mode."] - #[inline] - pub fn fb_en(&self) -> FB_ENR { - FB_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Invert SCLK in feedback mode."] - #[inline] - pub fn invert_en(&self) -> INVERT_ENR { - INVERT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 4:9 - Number of clocks to ignore after SS asertion prior to reading data."] - #[inline] - pub fn ignore_clks(&self) -> IGNORE_CLKSR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IGNORE_CLKSR { bits } - } - #[doc = "Bits 12:17 - Number of clocks to ignore after SS asertion prior to reading data when a read command is not explicitly sent."] - #[inline] - pub fn ignore_clks_no_cmd(&self) -> IGNORE_CLKS_NO_CMDR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - IGNORE_CLKS_NO_CMDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable SCLK feedback mode."] - #[inline] - pub fn fb_en(&mut self) -> _FB_ENW { - _FB_ENW { w: self } - } - #[doc = "Bit 1 - Invert SCLK in feedback mode."] - #[inline] - pub fn invert_en(&mut self) -> _INVERT_ENW { - _INVERT_ENW { w: self } - } - #[doc = "Bits 4:9 - Number of clocks to ignore after SS asertion prior to reading data."] - #[inline] - pub fn ignore_clks(&mut self) -> _IGNORE_CLKSW { - _IGNORE_CLKSW { w: self } - } - #[doc = "Bits 12:17 - Number of clocks to ignore after SS asertion prior to reading data when a read command is not explicitly sent."] - #[inline] - pub fn ignore_clks_no_cmd(&mut self) -> _IGNORE_CLKS_NO_CMDW { - _IGNORE_CLKS_NO_CMDW { w: self } - } - } - } - #[doc = "SPIX IO Control Register."] - pub struct IO_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX IO Control Register."] - pub mod io_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::IO_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `SCLK_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_DSR { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SCLK_DSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SCLK_DSR::LOW => false, - SCLK_DSR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SCLK_DSR { - match value { - false => SCLK_DSR::LOW, - true => SCLK_DSR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == SCLK_DSR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == SCLK_DSR::HIGH - } - } - #[doc = "Possible values of the field `SS_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_DSR { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SS_DSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SS_DSR::LOW => false, - SS_DSR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SS_DSR { - match value { - false => SS_DSR::LOW, - true => SS_DSR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == SS_DSR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == SS_DSR::HIGH - } - } - #[doc = "Possible values of the field `SDIO_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIO_DSR { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SDIO_DSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SDIO_DSR::LOW => false, - SDIO_DSR::HIGH => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SDIO_DSR { - match value { - false => SDIO_DSR::LOW, - true => SDIO_DSR::HIGH, - } - } - #[doc = "Checks if the value of the field is `LOW`"] - #[inline] - pub fn is_low(&self) -> bool { - *self == SDIO_DSR::LOW - } - #[doc = "Checks if the value of the field is `HIGH`"] - #[inline] - pub fn is_high(&self) -> bool { - *self == SDIO_DSR::HIGH - } - } - #[doc = "Possible values of the field `PU_PD_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PU_PD_CTRLR { - #[doc = "Tristate."] - TRI_STATE, - #[doc = "Pull-Up."] - PULL_UP, - #[doc = "Pull-Down."] - PULL_DOWN, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl PU_PD_CTRLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PU_PD_CTRLR::TRI_STATE => 0, - PU_PD_CTRLR::PULL_UP => 0x01, - PU_PD_CTRLR::PULL_DOWN => 0x02, - PU_PD_CTRLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PU_PD_CTRLR { - match value { - 0 => PU_PD_CTRLR::TRI_STATE, - 1 => PU_PD_CTRLR::PULL_UP, - 2 => PU_PD_CTRLR::PULL_DOWN, - i => PU_PD_CTRLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `TRI_STATE`"] - #[inline] - pub fn is_tri_state(&self) -> bool { - *self == PU_PD_CTRLR::TRI_STATE - } - #[doc = "Checks if the value of the field is `PULL_UP`"] - #[inline] - pub fn is_pull_up(&self) -> bool { - *self == PU_PD_CTRLR::PULL_UP - } - #[doc = "Checks if the value of the field is `PULL_DOWN`"] - #[inline] - pub fn is_pull_down(&self) -> bool { - *self == PU_PD_CTRLR::PULL_DOWN - } - } - #[doc = "Values that can be written to the field `SCLK_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SCLK_DSW { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SCLK_DSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SCLK_DSW::LOW => false, - SCLK_DSW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SCLK_DSW<'a> { - w: &'a mut W, - } - impl<'a> _SCLK_DSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SCLK_DSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low drive strength."] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(SCLK_DSW::LOW) - } - #[doc = "High drive strength."] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(SCLK_DSW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_DSW { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SS_DSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SS_DSW::LOW => false, - SS_DSW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_DSW<'a> { - w: &'a mut W, - } - impl<'a> _SS_DSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_DSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low drive strength."] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(SS_DSW::LOW) - } - #[doc = "High drive strength."] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(SS_DSW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SDIO_DS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SDIO_DSW { - #[doc = "Low drive strength."] - LOW, - #[doc = "High drive strength."] - HIGH, - } - impl SDIO_DSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SDIO_DSW::LOW => false, - SDIO_DSW::HIGH => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SDIO_DSW<'a> { - w: &'a mut W, - } - impl<'a> _SDIO_DSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SDIO_DSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Low drive strength."] - #[inline] - pub fn low(self) -> &'a mut W { - self.variant(SDIO_DSW::LOW) - } - #[doc = "High drive strength."] - #[inline] - pub fn high(self) -> &'a mut W { - self.variant(SDIO_DSW::HIGH) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PU_PD_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PU_PD_CTRLW { - #[doc = "Tristate."] - TRI_STATE, - #[doc = "Pull-Up."] - PULL_UP, - #[doc = "Pull-Down."] - PULL_DOWN, - } - impl PU_PD_CTRLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PU_PD_CTRLW::TRI_STATE => 0, - PU_PD_CTRLW::PULL_UP => 1, - PU_PD_CTRLW::PULL_DOWN => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _PU_PD_CTRLW<'a> { - w: &'a mut W, - } - impl<'a> _PU_PD_CTRLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PU_PD_CTRLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Tristate."] - #[inline] - pub fn tri_state(self) -> &'a mut W { - self.variant(PU_PD_CTRLW::TRI_STATE) - } - #[doc = "Pull-Up."] - #[inline] - pub fn pull_up(self) -> &'a mut W { - self.variant(PU_PD_CTRLW::PULL_UP) - } - #[doc = "Pull-Down."] - #[inline] - pub fn pull_down(self) -> &'a mut W { - self.variant(PU_PD_CTRLW::PULL_DOWN) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SCLK drive Strength. This bit controls the drive strength on the SCLK pin."] - #[inline] - pub fn sclk_ds(&self) -> SCLK_DSR { - SCLK_DSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Slave Select Drive Strength. This bit controls the drive strength on the dedicated slave select pin."] - #[inline] - pub fn ss_ds(&self) -> SS_DSR { - SS_DSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - SDIO Drive Strength. This bit controls the drive strength of all SDIO pins."] - #[inline] - pub fn sdio_ds(&self) -> SDIO_DSR { - SDIO_DSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 3:4 - IO Pullup/Pulldown Control. These bits control the pullups and pulldowns associated with all SPI XiP SDIO pins."] - #[inline] - pub fn pu_pd_ctrl(&self) -> PU_PD_CTRLR { - PU_PD_CTRLR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - SCLK drive Strength. This bit controls the drive strength on the SCLK pin."] - #[inline] - pub fn sclk_ds(&mut self) -> _SCLK_DSW { - _SCLK_DSW { w: self } - } - #[doc = "Bit 1 - Slave Select Drive Strength. This bit controls the drive strength on the dedicated slave select pin."] - #[inline] - pub fn ss_ds(&mut self) -> _SS_DSW { - _SS_DSW { w: self } - } - #[doc = "Bit 2 - SDIO Drive Strength. This bit controls the drive strength of all SDIO pins."] - #[inline] - pub fn sdio_ds(&mut self) -> _SDIO_DSW { - _SDIO_DSW { w: self } - } - #[doc = "Bits 3:4 - IO Pullup/Pulldown Control. These bits control the pullups and pulldowns associated with all SPI XiP SDIO pins."] - #[inline] - pub fn pu_pd_ctrl(&mut self) -> _PU_PD_CTRLW { - _PU_PD_CTRLW { w: self } - } - } - } - #[doc = "SPIX Memory Security Control Register."] - pub struct MEMSECCN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPIX Memory Security Control Register."] - pub mod memseccn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MEMSECCN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `DECEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DECENR { - #[doc = "Disable decryption of SPIX data."] - DIS, - #[doc = "Enable decryption of SPIX data."] - EN, - } - impl DECENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DECENR::DIS => false, - DECENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DECENR { - match value { - false => DECENR::DIS, - true => DECENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DECENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DECENR::EN - } - } - #[doc = "Values that can be written to the field `DECEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DECENW { - #[doc = "Disable decryption of SPIX data."] - DIS, - #[doc = "Enable decryption of SPIX data."] - EN, - } - impl DECENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DECENW::DIS => false, - DECENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DECENW<'a> { - w: &'a mut W, - } - impl<'a> _DECENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DECENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable decryption of SPIX data."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DECENW::DIS) - } - #[doc = "Enable decryption of SPIX data."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DECENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Decryption Enable."] - #[inline] - pub fn decen(&self) -> DECENR { - DECENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Decryption Enable."] - #[inline] - pub fn decen(&mut self) -> _DECENW { - _DECENW { w: self } - } - } - } -} -#[doc = "SPI peripheral."] -pub struct SPI17Y { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPI17Y {} -impl SPI17Y { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spi17y::RegisterBlock { - 0x400b_e000 as *const _ - } -} -impl Deref for SPI17Y { - type Target = spi17y::RegisterBlock; - fn deref(&self) -> &spi17y::RegisterBlock { - unsafe { &*SPI17Y::ptr() } - } -} -#[doc = "SPI peripheral."] -pub mod spi17y { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Register for reading and writing the FIFO."] - pub data32: DATA32, - #[doc = "0x04 - Register for controlling SPI peripheral."] - pub ctrl0: CTRL0, - #[doc = "0x08 - Register for controlling SPI peripheral."] - pub ctrl1: CTRL1, - #[doc = "0x0c - Register for controlling SPI peripheral."] - pub ctrl2: CTRL2, - #[doc = "0x10 - Register for controlling SPI peripheral/Slave Select Timing."] - pub ss_time: SS_TIME, - #[doc = "0x14 - Register for controlling SPI clock rate."] - pub clk_cfg: CLK_CFG, - _reserved0: [u8; 4usize], - #[doc = "0x1c - Register for controlling DMA."] - pub dma: DMA, - #[doc = "0x20 - Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub int_fl: INT_FL, - #[doc = "0x24 - Register for enabling interrupts."] - pub int_en: INT_EN, - #[doc = "0x28 - Register for wake up flags. All bits in this register are write 1 to clear."] - pub wake_fl: WAKE_FL, - #[doc = "0x2c - Register for wake up enable."] - pub wake_en: WAKE_EN, - #[doc = "0x30 - SPI Status register."] - pub stat: STAT, - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA32 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data32 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DATA32 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA16 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data16 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::DATA16 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u16, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for reading and writing the FIFO."] - pub struct DATA8 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Register for reading and writing the FIFO."] - pub mod data8 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::DATA8 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u8, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:7 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Read to pull from RX FIFO, write to put into TX FIFO."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENR { - #[doc = "SPI is disabled."] - DIS, - #[doc = "SPI is enabled."] - EN, - } - impl ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ENR::DIS => false, - ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ENR { - match value { - false => ENR::DIS, - true => ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ENR::EN - } - } - #[doc = "Possible values of the field `MASTER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MASTERR { - #[doc = "SPI is Slave mode."] - DIS, - #[doc = "SPI is Master mode."] - EN, - } - impl MASTERR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MASTERR::DIS => false, - MASTERR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MASTERR { - match value { - false => MASTERR::DIS, - true => MASTERR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == MASTERR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == MASTERR::EN - } - } - #[doc = "Possible values of the field `SS_IO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_IOR { - #[doc = "Slave select 0 is output."] - OUTPUT, - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - INPUT, - } - impl SS_IOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SS_IOR::OUTPUT => false, - SS_IOR::INPUT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SS_IOR { - match value { - false => SS_IOR::OUTPUT, - true => SS_IOR::INPUT, - } - } - #[doc = "Checks if the value of the field is `OUTPUT`"] - #[inline] - pub fn is_output(&self) -> bool { - *self == SS_IOR::OUTPUT - } - #[doc = "Checks if the value of the field is `INPUT`"] - #[inline] - pub fn is_input(&self) -> bool { - *self == SS_IOR::INPUT - } - } - #[doc = "Possible values of the field `START`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STARTR { - #[doc = "Master Initiates a transaction, this bit is self clearing when transactions are done. If a transaction cimpletes, and the TX FIFO is empty, the Master halts, if a transaction completes, and the TX FIFO is not empty, the Master initiates another transaction."] - START, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl STARTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STARTR::START => true, - STARTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STARTR { - match value { - true => STARTR::START, - i => STARTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `START`"] - #[inline] - pub fn is_start(&self) -> bool { - *self == STARTR::START - } - } - #[doc = "Possible values of the field `SS_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_CTRLR { - #[doc = "SPI De-asserts Slave Select at the end of a transaction."] - DEASSERT, - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - ASSERT, - } - impl SS_CTRLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SS_CTRLR::DEASSERT => false, - SS_CTRLR::ASSERT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SS_CTRLR { - match value { - false => SS_CTRLR::DEASSERT, - true => SS_CTRLR::ASSERT, - } - } - #[doc = "Checks if the value of the field is `DEASSERT`"] - #[inline] - pub fn is_deassert(&self) -> bool { - *self == SS_CTRLR::DEASSERT - } - #[doc = "Checks if the value of the field is `ASSERT`"] - #[inline] - pub fn is_assert(&self) -> bool { - *self == SS_CTRLR::ASSERT - } - } - #[doc = "Possible values of the field `SS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSR { - #[doc = "SS0 is selected."] - SS0, - #[doc = "SS1 is selected."] - SS1, - #[doc = "SS2 is selected."] - SS2, - #[doc = "SS3 is selected."] - SS3, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SSR::SS0 => 0x01, - SSR::SS1 => 0x02, - SSR::SS2 => 0x04, - SSR::SS3 => 0x08, - SSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SSR { - match value { - 1 => SSR::SS0, - 2 => SSR::SS1, - 4 => SSR::SS2, - 8 => SSR::SS3, - i => SSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SS0`"] - #[inline] - pub fn is_ss0(&self) -> bool { - *self == SSR::SS0 - } - #[doc = "Checks if the value of the field is `SS1`"] - #[inline] - pub fn is_ss1(&self) -> bool { - *self == SSR::SS1 - } - #[doc = "Checks if the value of the field is `SS2`"] - #[inline] - pub fn is_ss2(&self) -> bool { - *self == SSR::SS2 - } - #[doc = "Checks if the value of the field is `SS3`"] - #[inline] - pub fn is_ss3(&self) -> bool { - *self == SSR::SS3 - } - } - #[doc = "Values that can be written to the field `EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENW { - #[doc = "SPI is disabled."] - DIS, - #[doc = "SPI is enabled."] - EN, - } - impl ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ENW::DIS => false, - ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ENW<'a> { - w: &'a mut W, - } - impl<'a> _ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ENW::DIS) - } - #[doc = "SPI is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MASTER`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MASTERW { - #[doc = "SPI is Slave mode."] - DIS, - #[doc = "SPI is Master mode."] - EN, - } - impl MASTERW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MASTERW::DIS => false, - MASTERW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MASTERW<'a> { - w: &'a mut W, - } - impl<'a> _MASTERW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MASTERW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI is Slave mode."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(MASTERW::DIS) - } - #[doc = "SPI is Master mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(MASTERW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_IO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_IOW { - #[doc = "Slave select 0 is output."] - OUTPUT, - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - INPUT, - } - impl SS_IOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SS_IOW::OUTPUT => false, - SS_IOW::INPUT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_IOW<'a> { - w: &'a mut W, - } - impl<'a> _SS_IOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_IOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Slave select 0 is output."] - #[inline] - pub fn output(self) -> &'a mut W { - self.variant(SS_IOW::OUTPUT) - } - #[doc = "Slave Select 0 is input, only valid if MMEN=1."] - #[inline] - pub fn input(self) -> &'a mut W { - self.variant(SS_IOW::INPUT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `START`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STARTW { - #[doc = "Master Initiates a transaction, this bit is self clearing when transactions are done. If a transaction cimpletes, and the TX FIFO is empty, the Master halts, if a transaction completes, and the TX FIFO is not empty, the Master initiates another transaction."] - START, - } - impl STARTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STARTW::START => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STARTW<'a> { - w: &'a mut W, - } - impl<'a> _STARTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STARTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Master Initiates a transaction, this bit is self clearing when transactions are done. If a transaction cimpletes, and the TX FIFO is empty, the Master halts, if a transaction completes, and the TX FIFO is not empty, the Master initiates another transaction."] - #[inline] - pub fn start(self) -> &'a mut W { - self.variant(STARTW::START) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_CTRLW { - #[doc = "SPI De-asserts Slave Select at the end of a transaction."] - DEASSERT, - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - ASSERT, - } - impl SS_CTRLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SS_CTRLW::DEASSERT => false, - SS_CTRLW::ASSERT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_CTRLW<'a> { - w: &'a mut W, - } - impl<'a> _SS_CTRLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_CTRLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "SPI De-asserts Slave Select at the end of a transaction."] - #[inline] - pub fn deassert(self) -> &'a mut W { - self.variant(SS_CTRLW::DEASSERT) - } - #[doc = "SPI leaves Slave Select asserted at the end of a transaction."] - #[inline] - pub fn assert(self) -> &'a mut W { - self.variant(SS_CTRLW::ASSERT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSW { - #[doc = "SS0 is selected."] - SS0, - #[doc = "SS1 is selected."] - SS1, - #[doc = "SS2 is selected."] - SS2, - #[doc = "SS3 is selected."] - SS3, - } - impl SSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SSW::SS0 => 1, - SSW::SS1 => 2, - SSW::SS2 => 4, - SSW::SS3 => 8, - } - } - } - #[doc = r" Proxy"] - pub struct _SSW<'a> { - w: &'a mut W, - } - impl<'a> _SSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SS0 is selected."] - #[inline] - pub fn ss0(self) -> &'a mut W { - self.variant(SSW::SS0) - } - #[doc = "SS1 is selected."] - #[inline] - pub fn ss1(self) -> &'a mut W { - self.variant(SSW::SS1) - } - #[doc = "SS2 is selected."] - #[inline] - pub fn ss2(self) -> &'a mut W { - self.variant(SSW::SS2) - } - #[doc = "SS3 is selected."] - #[inline] - pub fn ss3(self) -> &'a mut W { - self.variant(SSW::SS3) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SPI Enable."] - #[inline] - pub fn en(&self) -> ENR { - ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn master(&self) -> MASTERR { - MASTERR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select 0, IO direction, to support Multi-Master mode,Slave Select 0 can be input in Master mode. This bit has no effect in slave mode."] - #[inline] - pub fn ss_io(&self) -> SS_IOR { - SS_IOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Start Transmit."] - #[inline] - pub fn start(&self) -> STARTR { - STARTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Start Select Control. Used in Master mode to control the behavior of the Slave Select signal at the end of a transaction."] - #[inline] - pub fn ss_ctrl(&self) -> SS_CTRLR { - SS_CTRLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:19 - Slave Select, when in Master mode selects which Slave devices are selected. More than one Slave device can be selected."] - #[inline] - pub fn ss(&self) -> SSR { - SSR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - SPI Enable."] - #[inline] - pub fn en(&mut self) -> _ENW { - _ENW { w: self } - } - #[doc = "Bit 1 - Master Mode Enable."] - #[inline] - pub fn master(&mut self) -> _MASTERW { - _MASTERW { w: self } - } - #[doc = "Bit 4 - Slave Select 0, IO direction, to support Multi-Master mode,Slave Select 0 can be input in Master mode. This bit has no effect in slave mode."] - #[inline] - pub fn ss_io(&mut self) -> _SS_IOW { - _SS_IOW { w: self } - } - #[doc = "Bit 5 - Start Transmit."] - #[inline] - pub fn start(&mut self) -> _STARTW { - _STARTW { w: self } - } - #[doc = "Bit 8 - Start Select Control. Used in Master mode to control the behavior of the Slave Select signal at the end of a transaction."] - #[inline] - pub fn ss_ctrl(&mut self) -> _SS_CTRLW { - _SS_CTRLW { w: self } - } - #[doc = "Bits 16:19 - Slave Select, when in Master mode selects which Slave devices are selected. More than one Slave device can be selected."] - #[inline] - pub fn ss(&mut self) -> _SSW { - _SSW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_NUM_CHARR { - bits: u16, - } - impl TX_NUM_CHARR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_NUM_CHARR { - bits: u16, - } - impl RX_NUM_CHARR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _TX_NUM_CHARW<'a> { - w: &'a mut W, - } - impl<'a> _TX_NUM_CHARW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_NUM_CHARW<'a> { - w: &'a mut W, - } - impl<'a> _RX_NUM_CHARW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:15 - Nubmer of Characters to transmit."] - #[inline] - pub fn tx_num_char(&self) -> TX_NUM_CHARR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - TX_NUM_CHARR { bits } - } - #[doc = "Bits 16:31 - Nubmer of Characters to receive."] - #[inline] - pub fn rx_num_char(&self) -> RX_NUM_CHARR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - RX_NUM_CHARR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - Nubmer of Characters to transmit."] - #[inline] - pub fn tx_num_char(&mut self) -> _TX_NUM_CHARW { - _TX_NUM_CHARW { w: self } - } - #[doc = "Bits 16:31 - Nubmer of Characters to receive."] - #[inline] - pub fn rx_num_char(&mut self) -> _RX_NUM_CHARW { - _RX_NUM_CHARW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral."] - pub struct CTRL2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral."] - pub mod ctrl2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `CPHA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CPHAR { - #[doc = "Data Sampled on clock rising edge. Use when in SPI Mode 0 and Mode 2 "] - RISING_EDGE, - #[doc = "Data Sampled on clock falling edge. Use when in SPI Mode 1 and Mode 3"] - FALLING_EDGE, - } - impl CPHAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CPHAR::RISING_EDGE => false, - CPHAR::FALLING_EDGE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CPHAR { - match value { - false => CPHAR::RISING_EDGE, - true => CPHAR::FALLING_EDGE, - } - } - #[doc = "Checks if the value of the field is `RISING_EDGE`"] - #[inline] - pub fn is_rising_edge(&self) -> bool { - *self == CPHAR::RISING_EDGE - } - #[doc = "Checks if the value of the field is `FALLING_EDGE`"] - #[inline] - pub fn is_falling_edge(&self) -> bool { - *self == CPHAR::FALLING_EDGE - } - } - #[doc = "Possible values of the field `CPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CPOLR { - #[doc = "Normal Clock. Use when in SPI Mode 0 and Mode 1"] - NORMAL, - #[doc = "Inverted Clock. Use when in SPI Mode 2 and Mode 3"] - INVERTED, - } - impl CPOLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CPOLR::NORMAL => false, - CPOLR::INVERTED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CPOLR { - match value { - false => CPOLR::NORMAL, - true => CPOLR::INVERTED, - } - } - #[doc = "Checks if the value of the field is `NORMAL`"] - #[inline] - pub fn is_normal(&self) -> bool { - *self == CPOLR::NORMAL - } - #[doc = "Checks if the value of the field is `INVERTED`"] - #[inline] - pub fn is_inverted(&self) -> bool { - *self == CPOLR::INVERTED - } - } - #[doc = r" Value of the field"] - pub struct SCLK_INVR { - bits: bool, - } - impl SCLK_INVR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `NUMBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NUMBITSR { - #[doc = "16 bits per character."] - _0, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl NUMBITSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - NUMBITSR::_0 => 0, - NUMBITSR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> NUMBITSR { - match value { - 0 => NUMBITSR::_0, - i => NUMBITSR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_0`"] - #[inline] - pub fn is_0(&self) -> bool { - *self == NUMBITSR::_0 - } - } - #[doc = "Possible values of the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHR { - #[doc = "1 data pin."] - MONO, - #[doc = "2 data pins."] - DUAL, - #[doc = "4 data pins."] - QUAD, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl DATA_WIDTHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - DATA_WIDTHR::MONO => 0, - DATA_WIDTHR::DUAL => 0x01, - DATA_WIDTHR::QUAD => 0x02, - DATA_WIDTHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> DATA_WIDTHR { - match value { - 0 => DATA_WIDTHR::MONO, - 1 => DATA_WIDTHR::DUAL, - 2 => DATA_WIDTHR::QUAD, - i => DATA_WIDTHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `MONO`"] - #[inline] - pub fn is_mono(&self) -> bool { - *self == DATA_WIDTHR::MONO - } - #[doc = "Checks if the value of the field is `DUAL`"] - #[inline] - pub fn is_dual(&self) -> bool { - *self == DATA_WIDTHR::DUAL - } - #[doc = "Checks if the value of the field is `QUAD`"] - #[inline] - pub fn is_quad(&self) -> bool { - *self == DATA_WIDTHR::QUAD - } - } - #[doc = "Possible values of the field `THREE_WIRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum THREE_WIRER { - #[doc = "Use four wire mode (Mono only)."] - DIS, - #[doc = "Use three wire mode."] - EN, - } - impl THREE_WIRER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - THREE_WIRER::DIS => false, - THREE_WIRER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> THREE_WIRER { - match value { - false => THREE_WIRER::DIS, - true => THREE_WIRER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == THREE_WIRER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == THREE_WIRER::EN - } - } - #[doc = "Possible values of the field `SS_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_POLR { - #[doc = "SS0 active high."] - SS0_HIGH, - #[doc = "SS1 active high."] - SS1_HIGH, - #[doc = "SS2 active high."] - SS2_HIGH, - #[doc = "SS3 active high."] - SS3_HIGH, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SS_POLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SS_POLR::SS0_HIGH => 0x01, - SS_POLR::SS1_HIGH => 0x02, - SS_POLR::SS2_HIGH => 0x04, - SS_POLR::SS3_HIGH => 0x08, - SS_POLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SS_POLR { - match value { - 1 => SS_POLR::SS0_HIGH, - 2 => SS_POLR::SS1_HIGH, - 4 => SS_POLR::SS2_HIGH, - 8 => SS_POLR::SS3_HIGH, - i => SS_POLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SS0_HIGH`"] - #[inline] - pub fn is_ss0_high(&self) -> bool { - *self == SS_POLR::SS0_HIGH - } - #[doc = "Checks if the value of the field is `SS1_HIGH`"] - #[inline] - pub fn is_ss1_high(&self) -> bool { - *self == SS_POLR::SS1_HIGH - } - #[doc = "Checks if the value of the field is `SS2_HIGH`"] - #[inline] - pub fn is_ss2_high(&self) -> bool { - *self == SS_POLR::SS2_HIGH - } - #[doc = "Checks if the value of the field is `SS3_HIGH`"] - #[inline] - pub fn is_ss3_high(&self) -> bool { - *self == SS_POLR::SS3_HIGH - } - } - #[doc = "Possible values of the field `SRPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRPOLR { - #[doc = "SR0 active high."] - SR0_HIGH, - #[doc = "SR1 active high."] - SR1_HIGH, - #[doc = "SR2 active high."] - SR2_HIGH, - #[doc = "SR3 active high."] - SR3_HIGH, - #[doc = "SR4 active high."] - SR4_HIGH, - #[doc = "SR5 active high."] - SR5_HIGH, - #[doc = "SR6 active high."] - SR6_HIGH, - #[doc = "SR7 active high."] - SR7_HIGH, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl SRPOLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - SRPOLR::SR0_HIGH => 0x01, - SRPOLR::SR1_HIGH => 0x02, - SRPOLR::SR2_HIGH => 0x04, - SRPOLR::SR3_HIGH => 0x08, - SRPOLR::SR4_HIGH => 0x10, - SRPOLR::SR5_HIGH => 0x20, - SRPOLR::SR6_HIGH => 0x40, - SRPOLR::SR7_HIGH => 0x80, - SRPOLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> SRPOLR { - match value { - 1 => SRPOLR::SR0_HIGH, - 2 => SRPOLR::SR1_HIGH, - 4 => SRPOLR::SR2_HIGH, - 8 => SRPOLR::SR3_HIGH, - 16 => SRPOLR::SR4_HIGH, - 32 => SRPOLR::SR5_HIGH, - 64 => SRPOLR::SR6_HIGH, - 128 => SRPOLR::SR7_HIGH, - i => SRPOLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `SR0_HIGH`"] - #[inline] - pub fn is_sr0_high(&self) -> bool { - *self == SRPOLR::SR0_HIGH - } - #[doc = "Checks if the value of the field is `SR1_HIGH`"] - #[inline] - pub fn is_sr1_high(&self) -> bool { - *self == SRPOLR::SR1_HIGH - } - #[doc = "Checks if the value of the field is `SR2_HIGH`"] - #[inline] - pub fn is_sr2_high(&self) -> bool { - *self == SRPOLR::SR2_HIGH - } - #[doc = "Checks if the value of the field is `SR3_HIGH`"] - #[inline] - pub fn is_sr3_high(&self) -> bool { - *self == SRPOLR::SR3_HIGH - } - #[doc = "Checks if the value of the field is `SR4_HIGH`"] - #[inline] - pub fn is_sr4_high(&self) -> bool { - *self == SRPOLR::SR4_HIGH - } - #[doc = "Checks if the value of the field is `SR5_HIGH`"] - #[inline] - pub fn is_sr5_high(&self) -> bool { - *self == SRPOLR::SR5_HIGH - } - #[doc = "Checks if the value of the field is `SR6_HIGH`"] - #[inline] - pub fn is_sr6_high(&self) -> bool { - *self == SRPOLR::SR6_HIGH - } - #[doc = "Checks if the value of the field is `SR7_HIGH`"] - #[inline] - pub fn is_sr7_high(&self) -> bool { - *self == SRPOLR::SR7_HIGH - } - } - #[doc = "Values that can be written to the field `CPHA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CPHAW { - #[doc = "Data Sampled on clock rising edge. Use when in SPI Mode 0 and Mode 2 "] - RISING_EDGE, - #[doc = "Data Sampled on clock falling edge. Use when in SPI Mode 1 and Mode 3"] - FALLING_EDGE, - } - impl CPHAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CPHAW::RISING_EDGE => false, - CPHAW::FALLING_EDGE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CPHAW<'a> { - w: &'a mut W, - } - impl<'a> _CPHAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CPHAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Data Sampled on clock rising edge. Use when in SPI Mode 0 and Mode 2"] - #[inline] - pub fn rising_edge(self) -> &'a mut W { - self.variant(CPHAW::RISING_EDGE) - } - #[doc = "Data Sampled on clock falling edge. Use when in SPI Mode 1 and Mode 3"] - #[inline] - pub fn falling_edge(self) -> &'a mut W { - self.variant(CPHAW::FALLING_EDGE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CPOLW { - #[doc = "Normal Clock. Use when in SPI Mode 0 and Mode 1"] - NORMAL, - #[doc = "Inverted Clock. Use when in SPI Mode 2 and Mode 3"] - INVERTED, - } - impl CPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CPOLW::NORMAL => false, - CPOLW::INVERTED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CPOLW<'a> { - w: &'a mut W, - } - impl<'a> _CPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CPOLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Normal Clock. Use when in SPI Mode 0 and Mode 1"] - #[inline] - pub fn normal(self) -> &'a mut W { - self.variant(CPOLW::NORMAL) - } - #[doc = "Inverted Clock. Use when in SPI Mode 2 and Mode 3"] - #[inline] - pub fn inverted(self) -> &'a mut W { - self.variant(CPOLW::INVERTED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCLK_INVW<'a> { - w: &'a mut W, - } - impl<'a> _SCLK_INVW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NUMBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NUMBITSW { - #[doc = "16 bits per character."] - _0, - } - impl NUMBITSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - NUMBITSW::_0 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _NUMBITSW<'a> { - w: &'a mut W, - } - impl<'a> _NUMBITSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NUMBITSW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "16 bits per character."] - #[inline] - pub fn _0(self) -> &'a mut W { - self.variant(NUMBITSW::_0) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DATA_WIDTH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DATA_WIDTHW { - #[doc = "1 data pin."] - MONO, - #[doc = "2 data pins."] - DUAL, - #[doc = "4 data pins."] - QUAD, - } - impl DATA_WIDTHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - DATA_WIDTHW::MONO => 0, - DATA_WIDTHW::DUAL => 1, - DATA_WIDTHW::QUAD => 2, - } - } - } - #[doc = r" Proxy"] - pub struct _DATA_WIDTHW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_WIDTHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DATA_WIDTHW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "1 data pin."] - #[inline] - pub fn mono(self) -> &'a mut W { - self.variant(DATA_WIDTHW::MONO) - } - #[doc = "2 data pins."] - #[inline] - pub fn dual(self) -> &'a mut W { - self.variant(DATA_WIDTHW::DUAL) - } - #[doc = "4 data pins."] - #[inline] - pub fn quad(self) -> &'a mut W { - self.variant(DATA_WIDTHW::QUAD) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `THREE_WIRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum THREE_WIREW { - #[doc = "Use four wire mode (Mono only)."] - DIS, - #[doc = "Use three wire mode."] - EN, - } - impl THREE_WIREW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - THREE_WIREW::DIS => false, - THREE_WIREW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _THREE_WIREW<'a> { - w: &'a mut W, - } - impl<'a> _THREE_WIREW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: THREE_WIREW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Use four wire mode (Mono only)."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(THREE_WIREW::DIS) - } - #[doc = "Use three wire mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(THREE_WIREW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SS_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SS_POLW { - #[doc = "SS0 active high."] - SS0_HIGH, - #[doc = "SS1 active high."] - SS1_HIGH, - #[doc = "SS2 active high."] - SS2_HIGH, - #[doc = "SS3 active high."] - SS3_HIGH, - } - impl SS_POLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SS_POLW::SS0_HIGH => 1, - SS_POLW::SS1_HIGH => 2, - SS_POLW::SS2_HIGH => 4, - SS_POLW::SS3_HIGH => 8, - } - } - } - #[doc = r" Proxy"] - pub struct _SS_POLW<'a> { - w: &'a mut W, - } - impl<'a> _SS_POLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SS_POLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SS0 active high."] - #[inline] - pub fn ss0_high(self) -> &'a mut W { - self.variant(SS_POLW::SS0_HIGH) - } - #[doc = "SS1 active high."] - #[inline] - pub fn ss1_high(self) -> &'a mut W { - self.variant(SS_POLW::SS1_HIGH) - } - #[doc = "SS2 active high."] - #[inline] - pub fn ss2_high(self) -> &'a mut W { - self.variant(SS_POLW::SS2_HIGH) - } - #[doc = "SS3 active high."] - #[inline] - pub fn ss3_high(self) -> &'a mut W { - self.variant(SS_POLW::SS3_HIGH) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SRPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRPOLW { - #[doc = "SR0 active high."] - SR0_HIGH, - #[doc = "SR1 active high."] - SR1_HIGH, - #[doc = "SR2 active high."] - SR2_HIGH, - #[doc = "SR3 active high."] - SR3_HIGH, - #[doc = "SR4 active high."] - SR4_HIGH, - #[doc = "SR5 active high."] - SR5_HIGH, - #[doc = "SR6 active high."] - SR6_HIGH, - #[doc = "SR7 active high."] - SR7_HIGH, - } - impl SRPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - SRPOLW::SR0_HIGH => 1, - SRPOLW::SR1_HIGH => 2, - SRPOLW::SR2_HIGH => 4, - SRPOLW::SR3_HIGH => 8, - SRPOLW::SR4_HIGH => 16, - SRPOLW::SR5_HIGH => 32, - SRPOLW::SR6_HIGH => 64, - SRPOLW::SR7_HIGH => 128, - } - } - } - #[doc = r" Proxy"] - pub struct _SRPOLW<'a> { - w: &'a mut W, - } - impl<'a> _SRPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SRPOLW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "SR0 active high."] - #[inline] - pub fn sr0_high(self) -> &'a mut W { - self.variant(SRPOLW::SR0_HIGH) - } - #[doc = "SR1 active high."] - #[inline] - pub fn sr1_high(self) -> &'a mut W { - self.variant(SRPOLW::SR1_HIGH) - } - #[doc = "SR2 active high."] - #[inline] - pub fn sr2_high(self) -> &'a mut W { - self.variant(SRPOLW::SR2_HIGH) - } - #[doc = "SR3 active high."] - #[inline] - pub fn sr3_high(self) -> &'a mut W { - self.variant(SRPOLW::SR3_HIGH) - } - #[doc = "SR4 active high."] - #[inline] - pub fn sr4_high(self) -> &'a mut W { - self.variant(SRPOLW::SR4_HIGH) - } - #[doc = "SR5 active high."] - #[inline] - pub fn sr5_high(self) -> &'a mut W { - self.variant(SRPOLW::SR5_HIGH) - } - #[doc = "SR6 active high."] - #[inline] - pub fn sr6_high(self) -> &'a mut W { - self.variant(SRPOLW::SR6_HIGH) - } - #[doc = "SR7 active high."] - #[inline] - pub fn sr7_high(self) -> &'a mut W { - self.variant(SRPOLW::SR7_HIGH) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Clock Phase."] - #[inline] - pub fn cpha(&self) -> CPHAR { - CPHAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Clock Polarity."] - #[inline] - pub fn cpol(&self) -> CPOLR { - CPOLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Reserved - Must Always Be Cleared to 0."] - #[inline] - pub fn sclk_inv(&self) -> SCLK_INVR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SCLK_INVR { bits } - } - #[doc = "Bits 8:11 - Number of Bits per character."] - #[inline] - pub fn numbits(&self) -> NUMBITSR { - NUMBITSR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 12:13 - SPI Data width."] - #[inline] - pub fn data_width(&self) -> DATA_WIDTHR { - DATA_WIDTHR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 15 - Three Wire mode. MOSI/MISO pin(s) shared. Only Mono mode suports Four-Wire."] - #[inline] - pub fn three_wire(&self) -> THREE_WIRER { - THREE_WIRER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:23 - Slave Select Polarity, each Slave Select can have unique polarity."] - #[inline] - pub fn ss_pol(&self) -> SS_POLR { - SS_POLR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 24:31 - Slave Ready Polarity, each Slave Ready can have unique polarity."] - #[inline] - pub fn srpol(&self) -> SRPOLR { - SRPOLR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Clock Phase."] - #[inline] - pub fn cpha(&mut self) -> _CPHAW { - _CPHAW { w: self } - } - #[doc = "Bit 1 - Clock Polarity."] - #[inline] - pub fn cpol(&mut self) -> _CPOLW { - _CPOLW { w: self } - } - #[doc = "Bit 4 - Reserved - Must Always Be Cleared to 0."] - #[inline] - pub fn sclk_inv(&mut self) -> _SCLK_INVW { - _SCLK_INVW { w: self } - } - #[doc = "Bits 8:11 - Number of Bits per character."] - #[inline] - pub fn numbits(&mut self) -> _NUMBITSW { - _NUMBITSW { w: self } - } - #[doc = "Bits 12:13 - SPI Data width."] - #[inline] - pub fn data_width(&mut self) -> _DATA_WIDTHW { - _DATA_WIDTHW { w: self } - } - #[doc = "Bit 15 - Three Wire mode. MOSI/MISO pin(s) shared. Only Mono mode suports Four-Wire."] - #[inline] - pub fn three_wire(&mut self) -> _THREE_WIREW { - _THREE_WIREW { w: self } - } - #[doc = "Bits 16:23 - Slave Select Polarity, each Slave Select can have unique polarity."] - #[inline] - pub fn ss_pol(&mut self) -> _SS_POLW { - _SS_POLW { w: self } - } - #[doc = "Bits 24:31 - Slave Ready Polarity, each Slave Ready can have unique polarity."] - #[inline] - pub fn srpol(&mut self) -> _SRPOLW { - _SRPOLW { w: self } - } - } - } - #[doc = "Register for controlling SPI peripheral/Slave Select Timing."] - pub struct SS_TIME { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI peripheral/Slave Select Timing."] - pub mod ss_time { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::SS_TIME { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `PRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PRER { - #[doc = "256 system clocks between SS active and first serial clock edge."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl PRER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PRER::_256 => 0, - PRER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PRER { - match value { - 0 => PRER::_256, - i => PRER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == PRER::_256 - } - } - #[doc = "Possible values of the field `POST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum POSTR { - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl POSTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - POSTR::_256 => 0, - POSTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> POSTR { - match value { - 0 => POSTR::_256, - i => POSTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == POSTR::_256 - } - } - #[doc = "Possible values of the field `INACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INACTR { - #[doc = "256 system clocks between transactions."] - _256, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl INACTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - INACTR::_256 => 0, - INACTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> INACTR { - match value { - 0 => INACTR::_256, - i => INACTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `_256`"] - #[inline] - pub fn is_256(&self) -> bool { - *self == INACTR::_256 - } - } - #[doc = "Values that can be written to the field `PRE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PREW { - #[doc = "256 system clocks between SS active and first serial clock edge."] - _256, - } - impl PREW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PREW::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _PREW<'a> { - w: &'a mut W, - } - impl<'a> _PREW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PREW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between SS active and first serial clock edge."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(PREW::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `POST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum POSTW { - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - _256, - } - impl POSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - POSTW::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _POSTW<'a> { - w: &'a mut W, - } - impl<'a> _POSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: POSTW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between last serial clock edge and SS inactive."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(POSTW::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `INACT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INACTW { - #[doc = "256 system clocks between transactions."] - _256, - } - impl INACTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - INACTW::_256 => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _INACTW<'a> { - w: &'a mut W, - } - impl<'a> _INACTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INACTW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "256 system clocks between transactions."] - #[inline] - pub fn _256(self) -> &'a mut W { - self.variant(INACTW::_256) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Slave Select Pre delay 1."] - #[inline] - pub fn pre(&self) -> PRER { - PRER::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:15 - Slave Select Post delay 2."] - #[inline] - pub fn post(&self) -> POSTR { - POSTR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:23 - Slave Select Inactive delay."] - #[inline] - pub fn inact(&self) -> INACTR { - INACTR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Slave Select Pre delay 1."] - #[inline] - pub fn pre(&mut self) -> _PREW { - _PREW { w: self } - } - #[doc = "Bits 8:15 - Slave Select Post delay 2."] - #[inline] - pub fn post(&mut self) -> _POSTW { - _POSTW { w: self } - } - #[doc = "Bits 16:23 - Slave Select Inactive delay."] - #[inline] - pub fn inact(&mut self) -> _INACTW { - _INACTW { w: self } - } - } - } - #[doc = "Register for controlling SPI clock rate."] - pub struct CLK_CFG { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling SPI clock rate."] - pub mod clk_cfg { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CLK_CFG { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `LO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOR { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl LOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - LOR::DIS => 0, - LOR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> LOR { - match value { - 0 => LOR::DIS, - i => LOR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == LOR::DIS - } - } - #[doc = "Possible values of the field `HI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIR { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - #[doc = r" Reserved"] - _Reserved(u8), - } - impl HIR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - HIR::DIS => 0, - HIR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> HIR { - match value { - 0 => HIR::DIS, - i => HIR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == HIR::DIS - } - } - #[doc = r" Value of the field"] - pub struct SCALER { - bits: u8, - } - impl SCALER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `LO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum LOW { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - } - impl LOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - LOW::DIS => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _LOW<'a> { - w: &'a mut W, - } - impl<'a> _LOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: LOW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Duty cycle control of serial clock generation is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(LOW::DIS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `HI`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HIW { - #[doc = "Duty cycle control of serial clock generation is disabled."] - DIS, - } - impl HIW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - HIW::DIS => 0, - } - } - } - #[doc = r" Proxy"] - pub struct _HIW<'a> { - w: &'a mut W, - } - impl<'a> _HIW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: HIW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "Duty cycle control of serial clock generation is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(HIW::DIS) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SCALEW<'a> { - w: &'a mut W, - } - impl<'a> _SCALEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn lo(&self) -> LOR { - LOR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 8:15 - High duty cycle control. In timer mode, reload\\[15:8\\]."] - #[inline] - pub fn hi(&self) -> HIR { - HIR::_from({ - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 16:19 - System Clock scale factor. Scales the AMBA clock by 2^SCALE before generating serial clock."] - #[inline] - pub fn scale(&self) -> SCALER { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - SCALER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Low duty cycle control. In timer mode, reload\\[7:0\\]."] - #[inline] - pub fn lo(&mut self) -> _LOW { - _LOW { w: self } - } - #[doc = "Bits 8:15 - High duty cycle control. In timer mode, reload\\[15:8\\]."] - #[inline] - pub fn hi(&mut self) -> _HIW { - _HIW { w: self } - } - #[doc = "Bits 16:19 - System Clock scale factor. Scales the AMBA clock by 2^SCALE before generating serial clock."] - #[inline] - pub fn scale(&mut self) -> _SCALEW { - _SCALEW { w: self } - } - } - } - #[doc = "Register for controlling DMA."] - pub struct DMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for controlling DMA."] - pub mod dma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_LEVELR { - bits: u8, - } - impl TX_FIFO_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENR { - #[doc = "Transmit FIFO is not enabled."] - DIS, - #[doc = "Transmit FIFO is enabled."] - EN, - } - impl TX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_ENR::DIS => false, - TX_FIFO_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_ENR { - match value { - false => TX_FIFO_ENR::DIS, - true => TX_FIFO_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_FIFO_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_FIFO_ENR::EN - } - } - #[doc = "Possible values of the field `TX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_CLEARR { - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_FIFO_CLEARR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_FIFO_CLEARR::CLEAR => true, - TX_FIFO_CLEARR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_FIFO_CLEARR { - match value { - true => TX_FIFO_CLEARR::CLEAR, - i => TX_FIFO_CLEARR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_FIFO_CLEARR::CLEAR - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_CNTR { - bits: u8, - } - impl TX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `TX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_DMA_ENR { - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - DIS, - #[doc = "TX DMA requests are enabled."] - EN, - } - impl TX_DMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_DMA_ENR::DIS => false, - TX_DMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_DMA_ENR { - match value { - false => TX_DMA_ENR::DIS, - true => TX_DMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_DMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_DMA_ENR::EN - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_LEVELR { - bits: u8, - } - impl RX_FIFO_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENR { - #[doc = "Receive FIFO is not enabled."] - DIS, - #[doc = "Receive FIFO is enabled."] - EN, - } - impl RX_FIFO_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_ENR::DIS => false, - RX_FIFO_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_ENR { - match value { - false => RX_FIFO_ENR::DIS, - true => RX_FIFO_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FIFO_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FIFO_ENR::EN - } - } - #[doc = "Possible values of the field `RX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_CLEARR { - #[doc = "Clear the Receive FIFO, clears any pending RX FIFO status."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FIFO_CLEARR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FIFO_CLEARR::CLEAR => true, - RX_FIFO_CLEARR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FIFO_CLEARR { - match value { - true => RX_FIFO_CLEARR::CLEAR, - i => RX_FIFO_CLEARR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FIFO_CLEARR::CLEAR - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_CNTR { - bits: u8, - } - impl RX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Possible values of the field `RX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DMA_ENR { - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - DIS, - #[doc = "RX DMA requests are enabled."] - EN, - } - impl RX_DMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_DMA_ENR::DIS => false, - RX_DMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_DMA_ENR { - match value { - false => RX_DMA_ENR::DIS, - true => RX_DMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_DMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_DMA_ENR::EN - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_ENW { - #[doc = "Transmit FIFO is not enabled."] - DIS, - #[doc = "Transmit FIFO is enabled."] - EN, - } - impl TX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_ENW::DIS => false, - TX_FIFO_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Transmit FIFO is not enabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::DIS) - } - #[doc = "Transmit FIFO is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_FIFO_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_FIFO_CLEARW { - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - CLEAR, - } - impl TX_FIFO_CLEARW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_FIFO_CLEARW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_CLEARW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_CLEARW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_FIFO_CLEARW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clear the Transmit FIFO, clears any pending TX FIFO status."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_FIFO_CLEARW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_DMA_ENW { - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - DIS, - #[doc = "TX DMA requests are enabled."] - EN, - } - impl TX_DMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_DMA_ENW::DIS => false, - TX_DMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_DMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TX_DMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_DMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "TX DMA requests are disabled, andy pending DMA requests are cleared."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_DMA_ENW::DIS) - } - #[doc = "TX DMA requests are enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_DMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_ENW { - #[doc = "Receive FIFO is not enabled."] - DIS, - #[doc = "Receive FIFO is enabled."] - EN, - } - impl RX_FIFO_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_ENW::DIS => false, - RX_FIFO_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Receive FIFO is not enabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::DIS) - } - #[doc = "Receive FIFO is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FIFO_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 22; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FIFO_CLEAR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FIFO_CLEARW { - #[doc = "Clear the Receive FIFO, clears any pending RX FIFO status."] - CLEAR, - } - impl RX_FIFO_CLEARW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FIFO_CLEARW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_CLEARW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_CLEARW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FIFO_CLEARW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Clear the Receive FIFO, clears any pending RX FIFO status."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FIFO_CLEARW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 23; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_DMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_DMA_ENW { - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - DIS, - #[doc = "RX DMA requests are enabled."] - EN, - } - impl RX_DMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_DMA_ENW::DIS => false, - RX_DMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_DMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RX_DMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_DMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "RX DMA requests are disabled, any pending DMA requests are cleared."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_DMA_ENW::DIS) - } - #[doc = "RX DMA requests are enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_DMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:4 - Transmit FIFO level that will trigger a DMA request, also level for threshold status. When TX FIFO has fewer than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn tx_fifo_level(&self) -> TX_FIFO_LEVELR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_LEVELR { bits } - } - #[doc = "Bit 6 - Transmit FIFO enabled for SPI transactions."] - #[inline] - pub fn tx_fifo_en(&self) -> TX_FIFO_ENR { - TX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Clear TX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side. ."] - #[inline] - pub fn tx_fifo_clear(&self) -> TX_FIFO_CLEARR { - TX_FIFO_CLEARR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:13 - Count of entries in TX FIFO."] - #[inline] - pub fn tx_fifo_cnt(&self) -> TX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_CNTR { bits } - } - #[doc = "Bit 15 - TX DMA Enable."] - #[inline] - pub fn tx_dma_en(&self) -> TX_DMA_ENR { - TX_DMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:20 - Receive FIFO level that will trigger a DMA request, also level for threshold status. When RX FIFO has more than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn rx_fifo_level(&self) -> RX_FIFO_LEVELR { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_LEVELR { bits } - } - #[doc = "Bit 22 - Receive FIFO enabled for SPI transactions."] - #[inline] - pub fn rx_fifo_en(&self) -> RX_FIFO_ENR { - RX_FIFO_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 22; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 23 - Clear RX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn rx_fifo_clear(&self) -> RX_FIFO_CLEARR { - RX_FIFO_CLEARR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 23; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 24:29 - Count of entries in RX FIFO."] - #[inline] - pub fn rx_fifo_cnt(&self) -> RX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_CNTR { bits } - } - #[doc = "Bit 31 - RX DMA Enable."] - #[inline] - pub fn rx_dma_en(&self) -> RX_DMA_ENR { - RX_DMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:4 - Transmit FIFO level that will trigger a DMA request, also level for threshold status. When TX FIFO has fewer than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn tx_fifo_level(&mut self) -> _TX_FIFO_LEVELW { - _TX_FIFO_LEVELW { w: self } - } - #[doc = "Bit 6 - Transmit FIFO enabled for SPI transactions."] - #[inline] - pub fn tx_fifo_en(&mut self) -> _TX_FIFO_ENW { - _TX_FIFO_ENW { w: self } - } - #[doc = "Bit 7 - Clear TX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side. ."] - #[inline] - pub fn tx_fifo_clear(&mut self) -> _TX_FIFO_CLEARW { - _TX_FIFO_CLEARW { w: self } - } - #[doc = "Bit 15 - TX DMA Enable."] - #[inline] - pub fn tx_dma_en(&mut self) -> _TX_DMA_ENW { - _TX_DMA_ENW { w: self } - } - #[doc = "Bits 16:20 - Receive FIFO level that will trigger a DMA request, also level for threshold status. When RX FIFO has more than this many bytes, the associated events and conditions are triggered."] - #[inline] - pub fn rx_fifo_level(&mut self) -> _RX_FIFO_LEVELW { - _RX_FIFO_LEVELW { w: self } - } - #[doc = "Bit 22 - Receive FIFO enabled for SPI transactions."] - #[inline] - pub fn rx_fifo_en(&mut self) -> _RX_FIFO_ENW { - _RX_FIFO_ENW { w: self } - } - #[doc = "Bit 23 - Clear RX FIFO, clear is accomplished by resetting the read and write pointers. This should be done when FIFO is not being accessed on the SPI side."] - #[inline] - pub fn rx_fifo_clear(&mut self) -> _RX_FIFO_CLEARW { - _RX_FIFO_CLEARW { w: self } - } - #[doc = "Bit 31 - RX DMA Enable."] - #[inline] - pub fn rx_dma_en(&mut self) -> _RX_DMA_ENW { - _RX_DMA_ENW { w: self } - } - } - } - #[doc = "Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub struct INT_FL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for reading and clearing interrupt flags. All bits are write 1 to clear."] - pub mod int_fl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_FL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::CLEAR => true, - TX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - true => TX_THRESHR::CLEAR, - i => TX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::CLEAR => true, - TX_EMPTYR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - true => TX_EMPTYR::CLEAR, - i => TX_EMPTYR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_EMPTYR::CLEAR - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::CLEAR => true, - RX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - true => RX_THRESHR::CLEAR, - i => RX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::CLEAR => true, - RX_FULLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - true => RX_FULLR::CLEAR, - i => RX_FULLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FULLR::CLEAR - } - } - #[doc = "Possible values of the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SSAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSAR::CLEAR => true, - SSAR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSAR { - match value { - true => SSAR::CLEAR, - i => SSAR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SSAR::CLEAR - } - } - #[doc = "Possible values of the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl SSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSDR::CLEAR => true, - SSDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSDR { - match value { - true => SSDR::CLEAR, - i => SSDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == SSDR::CLEAR - } - } - #[doc = "Possible values of the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl FAULTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FAULTR::CLEAR => true, - FAULTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FAULTR { - match value { - true => FAULTR::CLEAR, - i => FAULTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == FAULTR::CLEAR - } - } - #[doc = "Possible values of the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl ABORTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ABORTR::CLEAR => true, - ABORTR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ABORTR { - match value { - true => ABORTR::CLEAR, - i => ABORTR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == ABORTR::CLEAR - } - } - #[doc = "Possible values of the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONER { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl M_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - M_DONER::CLEAR => true, - M_DONER::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> M_DONER { - match value { - true => M_DONER::CLEAR, - i => M_DONER::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == M_DONER::CLEAR - } - } - #[doc = "Possible values of the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_OVRR::CLEAR => true, - TX_OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_OVRR { - match value { - true => TX_OVRR::CLEAR, - i => TX_OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_OVRR::CLEAR - } - } - #[doc = "Possible values of the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDR::CLEAR => true, - TX_UNDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDR { - match value { - true => TX_UNDR::CLEAR, - i => TX_UNDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_UNDR::CLEAR - } - } - #[doc = "Possible values of the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVRR::CLEAR => true, - RX_OVRR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVRR { - match value { - true => RX_OVRR::CLEAR, - i => RX_OVRR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_OVRR::CLEAR - } - } - #[doc = "Possible values of the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_UNDR::CLEAR => true, - RX_UNDR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_UNDR { - match value { - true => RX_UNDR::CLEAR, - i => RX_UNDR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_UNDR::CLEAR - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_EMPTYW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FULLW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SSAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSAW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSAW<'a> { - w: &'a mut W, - } - impl<'a> _SSAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SSAW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl SSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSDW<'a> { - w: &'a mut W, - } - impl<'a> _SSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(SSDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl FAULTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FAULTW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FAULTW<'a> { - w: &'a mut W, - } - impl<'a> _FAULTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FAULTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(FAULTW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl ABORTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ABORTW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ABORTW<'a> { - w: &'a mut W, - } - impl<'a> _ABORTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ABORTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(ABORTW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONEW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl M_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - M_DONEW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _M_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _M_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: M_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(M_DONEW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_OVRW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _TX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_OVRW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_UNDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVRW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_OVRW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_UNDW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_UNDW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - TX FIFO Empty."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - RX FIFO FULL."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select Asserted."] - #[inline] - pub fn ssa(&self) -> SSAR { - SSAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Slave Select Deasserted."] - #[inline] - pub fn ssd(&self) -> SSDR { - SSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Multi-Master Mode Fault."] - #[inline] - pub fn fault(&self) -> FAULTR { - FAULTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Slave Abort Detected."] - #[inline] - pub fn abort(&self) -> ABORTR { - ABORTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Master Done, set when SPI Master has completed any transactions."] - #[inline] - pub fn m_done(&self) -> M_DONER { - M_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Transmit FIFO Overrun, set when the AMBA side attempts to write data to a full transmit FIFO."] - #[inline] - pub fn tx_ovr(&self) -> TX_OVRR { - TX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Transmit FIFO Underrun, set when the SPI side attempts to read data from an empty transmit FIFO."] - #[inline] - pub fn tx_und(&self) -> TX_UNDR { - TX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Receive FIFO Overrun, set when the SPI side attempts to write to a full receive FIFO."] - #[inline] - pub fn rx_ovr(&self) -> RX_OVRR { - RX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Receive FIFO Underrun, set when the AMBA side attempts to read data from an empty receive FIFO."] - #[inline] - pub fn rx_und(&self) -> RX_UNDR { - RX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - TX FIFO Empty."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - RX FIFO FULL."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - #[doc = "Bit 4 - Slave Select Asserted."] - #[inline] - pub fn ssa(&mut self) -> _SSAW { - _SSAW { w: self } - } - #[doc = "Bit 5 - Slave Select Deasserted."] - #[inline] - pub fn ssd(&mut self) -> _SSDW { - _SSDW { w: self } - } - #[doc = "Bit 8 - Multi-Master Mode Fault."] - #[inline] - pub fn fault(&mut self) -> _FAULTW { - _FAULTW { w: self } - } - #[doc = "Bit 9 - Slave Abort Detected."] - #[inline] - pub fn abort(&mut self) -> _ABORTW { - _ABORTW { w: self } - } - #[doc = "Bit 11 - Master Done, set when SPI Master has completed any transactions."] - #[inline] - pub fn m_done(&mut self) -> _M_DONEW { - _M_DONEW { w: self } - } - #[doc = "Bit 12 - Transmit FIFO Overrun, set when the AMBA side attempts to write data to a full transmit FIFO."] - #[inline] - pub fn tx_ovr(&mut self) -> _TX_OVRW { - _TX_OVRW { w: self } - } - #[doc = "Bit 13 - Transmit FIFO Underrun, set when the SPI side attempts to read data from an empty transmit FIFO."] - #[inline] - pub fn tx_und(&mut self) -> _TX_UNDW { - _TX_UNDW { w: self } - } - #[doc = "Bit 14 - Receive FIFO Overrun, set when the SPI side attempts to write to a full receive FIFO."] - #[inline] - pub fn rx_ovr(&mut self) -> _RX_OVRW { - _RX_OVRW { w: self } - } - #[doc = "Bit 15 - Receive FIFO Underrun, set when the AMBA side attempts to read data from an empty receive FIFO."] - #[inline] - pub fn rx_und(&mut self) -> _RX_UNDW { - _RX_UNDW { w: self } - } - } - } - #[doc = "Register for enabling interrupts."] - pub struct INT_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for enabling interrupts."] - pub mod int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::DIS => false, - TX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::DIS, - true => TX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_THRESHR::EN - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::DIS => false, - TX_EMPTYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - false => TX_EMPTYR::DIS, - true => TX_EMPTYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_EMPTYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_EMPTYR::EN - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::DIS => false, - RX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::DIS, - true => RX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_THRESHR::EN - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::DIS => false, - RX_FULLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - false => RX_FULLR::DIS, - true => RX_FULLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FULLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FULLR::EN - } - } - #[doc = "Possible values of the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSAR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSAR::DIS => false, - SSAR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSAR { - match value { - false => SSAR::DIS, - true => SSAR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SSAR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SSAR::EN - } - } - #[doc = "Possible values of the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SSDR::DIS => false, - SSDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SSDR { - match value { - false => SSDR::DIS, - true => SSDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == SSDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == SSDR::EN - } - } - #[doc = "Possible values of the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl FAULTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FAULTR::DIS => false, - FAULTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FAULTR { - match value { - false => FAULTR::DIS, - true => FAULTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FAULTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FAULTR::EN - } - } - #[doc = "Possible values of the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl ABORTR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ABORTR::DIS => false, - ABORTR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ABORTR { - match value { - false => ABORTR::DIS, - true => ABORTR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ABORTR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ABORTR::EN - } - } - #[doc = "Possible values of the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONER { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl M_DONER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - M_DONER::DIS => false, - M_DONER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> M_DONER { - match value { - false => M_DONER::DIS, - true => M_DONER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == M_DONER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == M_DONER::EN - } - } - #[doc = "Possible values of the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_OVRR::DIS => false, - TX_OVRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_OVRR { - match value { - false => TX_OVRR::DIS, - true => TX_OVRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_OVRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_OVRR::EN - } - } - #[doc = "Possible values of the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_UNDR::DIS => false, - TX_UNDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_UNDR { - match value { - false => TX_UNDR::DIS, - true => TX_UNDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_UNDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_UNDR::EN - } - } - #[doc = "Possible values of the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_OVRR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_OVRR::DIS => false, - RX_OVRR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_OVRR { - match value { - false => RX_OVRR::DIS, - true => RX_OVRR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_OVRR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_OVRR::EN - } - } - #[doc = "Possible values of the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDR { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_UNDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_UNDR::DIS => false, - RX_UNDR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_UNDR { - match value { - false => RX_UNDR::DIS, - true => RX_UNDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_UNDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_UNDR::EN - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::DIS => false, - TX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_THRESHW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::DIS => false, - TX_EMPTYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_EMPTYW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_EMPTYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::DIS => false, - RX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_THRESHW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::DIS => false, - RX_FULLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FULLW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FULLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSA`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSAW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSAW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSAW::DIS => false, - SSAW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSAW<'a> { - w: &'a mut W, - } - impl<'a> _SSAW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSAW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SSAW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SSAW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `SSD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SSDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl SSDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - SSDW::DIS => false, - SSDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _SSDW<'a> { - w: &'a mut W, - } - impl<'a> _SSDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: SSDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(SSDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(SSDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FAULT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FAULTW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl FAULTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FAULTW::DIS => false, - FAULTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FAULTW<'a> { - w: &'a mut W, - } - impl<'a> _FAULTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FAULTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FAULTW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FAULTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ABORT`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ABORTW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl ABORTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ABORTW::DIS => false, - ABORTW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ABORTW<'a> { - w: &'a mut W, - } - impl<'a> _ABORTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ABORTW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ABORTW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ABORTW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `M_DONE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum M_DONEW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl M_DONEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - M_DONEW::DIS => false, - M_DONEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _M_DONEW<'a> { - w: &'a mut W, - } - impl<'a> _M_DONEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: M_DONEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(M_DONEW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(M_DONEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_OVRW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_OVRW::DIS => false, - TX_OVRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _TX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_OVRW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_OVRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_UNDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl TX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_UNDW::DIS => false, - TX_UNDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _TX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_UNDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_UNDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_OVR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_OVRW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_OVRW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_OVRW::DIS => false, - RX_OVRW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_OVRW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVRW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_OVRW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_OVRW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_OVRW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_UND`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_UNDW { - #[doc = "Interrupt is disabled."] - DIS, - #[doc = "Interrupt is enabled."] - EN, - } - impl RX_UNDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_UNDW::DIS => false, - RX_UNDW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_UNDW<'a> { - w: &'a mut W, - } - impl<'a> _RX_UNDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_UNDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Interrupt is disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_UNDW::DIS) - } - #[doc = "Interrupt is enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_UNDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX FIFO Threshold interrupt enable."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - TX FIFO Empty interrupt enable."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed interrupt enable."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - RX FIFO FULL interrupt enable."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Slave Select Asserted interrupt enable."] - #[inline] - pub fn ssa(&self) -> SSAR { - SSAR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Slave Select Deasserted interrupt enable."] - #[inline] - pub fn ssd(&self) -> SSDR { - SSDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - Multi-Master Mode Fault interrupt enable."] - #[inline] - pub fn fault(&self) -> FAULTR { - FAULTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Slave Abort Detected interrupt enable."] - #[inline] - pub fn abort(&self) -> ABORTR { - ABORTR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Master Done interrupt enable."] - #[inline] - pub fn m_done(&self) -> M_DONER { - M_DONER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Transmit FIFO Overrun interrupt enable."] - #[inline] - pub fn tx_ovr(&self) -> TX_OVRR { - TX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - Transmit FIFO Underrun interrupt enable."] - #[inline] - pub fn tx_und(&self) -> TX_UNDR { - TX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Receive FIFO Overrun interrupt enable."] - #[inline] - pub fn rx_ovr(&self) -> RX_OVRR { - RX_OVRR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Receive FIFO Underrun interrupt enable."] - #[inline] - pub fn rx_und(&self) -> RX_UNDR { - RX_UNDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX FIFO Threshold interrupt enable."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - TX FIFO Empty interrupt enable."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - RX FIFO Threshold Crossed interrupt enable."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - RX FIFO FULL interrupt enable."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - #[doc = "Bit 4 - Slave Select Asserted interrupt enable."] - #[inline] - pub fn ssa(&mut self) -> _SSAW { - _SSAW { w: self } - } - #[doc = "Bit 5 - Slave Select Deasserted interrupt enable."] - #[inline] - pub fn ssd(&mut self) -> _SSDW { - _SSDW { w: self } - } - #[doc = "Bit 8 - Multi-Master Mode Fault interrupt enable."] - #[inline] - pub fn fault(&mut self) -> _FAULTW { - _FAULTW { w: self } - } - #[doc = "Bit 9 - Slave Abort Detected interrupt enable."] - #[inline] - pub fn abort(&mut self) -> _ABORTW { - _ABORTW { w: self } - } - #[doc = "Bit 11 - Master Done interrupt enable."] - #[inline] - pub fn m_done(&mut self) -> _M_DONEW { - _M_DONEW { w: self } - } - #[doc = "Bit 12 - Transmit FIFO Overrun interrupt enable."] - #[inline] - pub fn tx_ovr(&mut self) -> _TX_OVRW { - _TX_OVRW { w: self } - } - #[doc = "Bit 13 - Transmit FIFO Underrun interrupt enable."] - #[inline] - pub fn tx_und(&mut self) -> _TX_UNDW { - _TX_UNDW { w: self } - } - #[doc = "Bit 14 - Receive FIFO Overrun interrupt enable."] - #[inline] - pub fn rx_ovr(&mut self) -> _RX_OVRW { - _RX_OVRW { w: self } - } - #[doc = "Bit 15 - Receive FIFO Underrun interrupt enable."] - #[inline] - pub fn rx_und(&mut self) -> _RX_UNDW { - _RX_UNDW { w: self } - } - } - } - #[doc = "Register for wake up flags. All bits in this register are write 1 to clear."] - pub struct WAKE_FL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for wake up flags. All bits in this register are write 1 to clear."] - pub mod wake_fl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE_FL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::CLEAR => true, - TX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - true => TX_THRESHR::CLEAR, - i => TX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::CLEAR => true, - TX_EMPTYR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - true => TX_EMPTYR::CLEAR, - i => TX_EMPTYR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == TX_EMPTYR::CLEAR - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::CLEAR => true, - RX_THRESHR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - true => RX_THRESHR::CLEAR, - i => RX_THRESHR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_THRESHR::CLEAR - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - #[doc = r" Reserved"] - _Reserved(bool), - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::CLEAR => true, - RX_FULLR::_Reserved(bits) => bits, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - true => RX_FULLR::CLEAR, - i => RX_FULLR::_Reserved(i), - } - } - #[doc = "Checks if the value of the field is `CLEAR`"] - #[inline] - pub fn is_clear(&self) -> bool { - *self == RX_FULLR::CLEAR - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(TX_EMPTYW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_THRESHW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - CLEAR, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::CLEAR => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Flag is set when value read is 1. Write 1 to clear this flag."] - #[inline] - pub fn clear(self) -> &'a mut W { - self.variant(RX_FULLW::CLEAR) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Wake on TX FIFO Empty."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Wake on RX FIFO Full."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - Wake on TX FIFO Empty."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - Wake on RX FIFO Full."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - } - } - #[doc = "Register for wake up enable."] - pub struct WAKE_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Register for wake up enable."] - pub mod wake_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::WAKE_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_THRESHR::DIS => false, - TX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_THRESHR { - match value { - false => TX_THRESHR::DIS, - true => TX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_THRESHR::EN - } - } - #[doc = "Possible values of the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_EMPTYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TX_EMPTYR::DIS => false, - TX_EMPTYR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TX_EMPTYR { - match value { - false => TX_EMPTYR::DIS, - true => TX_EMPTYR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TX_EMPTYR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TX_EMPTYR::EN - } - } - #[doc = "Possible values of the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_THRESHR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_THRESHR::DIS => false, - RX_THRESHR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_THRESHR { - match value { - false => RX_THRESHR::DIS, - true => RX_THRESHR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_THRESHR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_THRESHR::EN - } - } - #[doc = "Possible values of the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLR { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_FULLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RX_FULLR::DIS => false, - RX_FULLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RX_FULLR { - match value { - false => RX_FULLR::DIS, - true => RX_FULLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RX_FULLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RX_FULLR::EN - } - } - #[doc = "Values that can be written to the field `TX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_THRESHW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_THRESHW::DIS => false, - TX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_THRESHW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TX_EMPTY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TX_EMPTYW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl TX_EMPTYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TX_EMPTYW::DIS => false, - TX_EMPTYW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TX_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_EMPTYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TX_EMPTYW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TX_EMPTYW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TX_EMPTYW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_THRESH`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_THRESHW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_THRESHW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_THRESHW::DIS => false, - RX_THRESHW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_THRESHW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_THRESHW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_THRESHW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_THRESHW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RX_FULL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RX_FULLW { - #[doc = "Wakeup source disabled."] - DIS, - #[doc = "Wakeup source enabled."] - EN, - } - impl RX_FULLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RX_FULLW::DIS => false, - RX_FULLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RX_FULLW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FULLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RX_FULLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Wakeup source disabled."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RX_FULLW::DIS) - } - #[doc = "Wakeup source enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RX_FULLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed Enable."] - #[inline] - pub fn tx_thresh(&self) -> TX_THRESHR { - TX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Wake on TX FIFO Empty Enable."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - TX_EMPTYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed Enable."] - #[inline] - pub fn rx_thresh(&self) -> RX_THRESHR { - RX_THRESHR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Wake on RX FIFO Full Enable."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - RX_FULLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Wake on TX FIFO Threshold Crossed Enable."] - #[inline] - pub fn tx_thresh(&mut self) -> _TX_THRESHW { - _TX_THRESHW { w: self } - } - #[doc = "Bit 1 - Wake on TX FIFO Empty Enable."] - #[inline] - pub fn tx_empty(&mut self) -> _TX_EMPTYW { - _TX_EMPTYW { w: self } - } - #[doc = "Bit 2 - Wake on RX FIFO Threshold Crossed Enable."] - #[inline] - pub fn rx_thresh(&mut self) -> _RX_THRESHW { - _RX_THRESHW { w: self } - } - #[doc = "Bit 3 - Wake on RX FIFO Full Enable."] - #[inline] - pub fn rx_full(&mut self) -> _RX_FULLW { - _RX_FULLW { w: self } - } - } - } - #[doc = "SPI Status register."] - pub struct STAT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "SPI Status register."] - pub mod stat { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::STAT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `BUSY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BUSYR { - #[doc = "SPI not active."] - NOT, - #[doc = "SPI active."] - ACTIVE, - } - impl BUSYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BUSYR::NOT => false, - BUSYR::ACTIVE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BUSYR { - match value { - false => BUSYR::NOT, - true => BUSYR::ACTIVE, - } - } - #[doc = "Checks if the value of the field is `NOT`"] - #[inline] - pub fn is_not(&self) -> bool { - *self == BUSYR::NOT - } - #[doc = "Checks if the value of the field is `ACTIVE`"] - #[inline] - pub fn is_active(&self) -> bool { - *self == BUSYR::ACTIVE - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - SPI active status. In Master mode, set when transaction starts, cleared when last bit of last character is acted upon and Slave Select de-assertion would occur. In Slave mode, set when Slave Select is asserted, cleared when Slave Select is de-asserted. Not used in Timer mode."] - #[inline] - pub fn busy(&self) -> BUSYR { - BUSYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - } -} -#[doc = "SPI peripheral. 1"] -pub struct SPI17Y1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPI17Y1 {} -impl SPI17Y1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spi17y::RegisterBlock { - 0x4004_6000 as *const _ - } -} -impl Deref for SPI17Y1 { - type Target = spi17y::RegisterBlock; - fn deref(&self) -> &spi17y::RegisterBlock { - unsafe { &*SPI17Y1::ptr() } - } -} -#[doc = "SPI peripheral. 2"] -pub struct SPI17Y2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for SPI17Y2 {} -impl SPI17Y2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const spi17y::RegisterBlock { - 0x4004_7000 as *const _ - } -} -impl Deref for SPI17Y2 { - type Target = spi17y::RegisterBlock; - fn deref(&self) -> &spi17y::RegisterBlock { - unsafe { &*SPI17Y2::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting."] -pub struct TMR0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR0 {} -impl TMR0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_0000 as *const _ - } -} -impl Deref for TMR0 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR0::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting."] -pub mod tmr0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Count. This register stores the current timer count."] - pub cnt: CNT, - #[doc = "0x04 - Compare. This register stores the compare value, which is used to set the maximum count value to initiate a reload of the timer to 0x0001."] - pub cmp: CMP, - #[doc = "0x08 - PWM. This register stores the value that is compared to the current timer count."] - pub pwm: PWM, - #[doc = "0x0c - Clear Interrupt. Writing a value (0 or 1) to a bit in this register clears the associated interrupt."] - pub intr: INTR, - #[doc = "0x10 - Timer Control Register."] - pub cn: CN, - #[doc = "0x14 - Timer Non-Overlapping Compare Register."] - pub nolcmp: NOLCMP, - } - #[doc = "Count. This register stores the current timer count."] - pub struct CNT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Count. This register stores the current timer count."] - pub mod cnt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CNT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x01 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Compare. This register stores the compare value, which is used to set the maximum count value to initiate a reload of the timer to 0x0001."] - pub struct CMP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Compare. This register stores the compare value, which is used to set the maximum count value to initiate a reload of the timer to 0x0001."] - pub mod cmp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CMP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0xffff } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "PWM. This register stores the value that is compared to the current timer count."] - pub struct PWM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "PWM. This register stores the value that is compared to the current timer count."] - pub mod pwm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::PWM { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "Clear Interrupt. Writing a value (0 or 1) to a bit in this register clears the associated interrupt."] - pub struct INTR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Clear Interrupt. Writing a value (0 or 1) to a bit in this register clears the associated interrupt."] - pub mod intr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INTR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IRQ_CLRR { - bits: bool, - } - impl IRQ_CLRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _IRQ_CLRW<'a> { - w: &'a mut W, - } - impl<'a> _IRQ_CLRW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Clear Interrupt."] - #[inline] - pub fn irq_clr(&self) -> IRQ_CLRR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - IRQ_CLRR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Clear Interrupt."] - #[inline] - pub fn irq_clr(&mut self) -> _IRQ_CLRW { - _IRQ_CLRW { w: self } - } - } - } - #[doc = "Timer Control Register."] - pub struct CN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Timer Control Register."] - pub mod cn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TMODER { - #[doc = "One Shot Mode."] - ONESHOT, - #[doc = "Continuous Mode."] - CONTINUOUS, - #[doc = "Counter Mode."] - COUNTER, - #[doc = "PWM Mode."] - PWM, - #[doc = "Capture Mode."] - CAPTURE, - #[doc = "Compare Mode."] - COMPARE, - #[doc = "Gated Mode."] - GATED, - #[doc = "Capture/Compare Mode."] - CAPTURECOMPARE, - } - impl TMODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - TMODER::ONESHOT => 0, - TMODER::CONTINUOUS => 0x01, - TMODER::COUNTER => 0x02, - TMODER::PWM => 0x03, - TMODER::CAPTURE => 0x04, - TMODER::COMPARE => 0x05, - TMODER::GATED => 0x06, - TMODER::CAPTURECOMPARE => 0x07, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> TMODER { - match value { - 0 => TMODER::ONESHOT, - 1 => TMODER::CONTINUOUS, - 2 => TMODER::COUNTER, - 3 => TMODER::PWM, - 4 => TMODER::CAPTURE, - 5 => TMODER::COMPARE, - 6 => TMODER::GATED, - 7 => TMODER::CAPTURECOMPARE, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `ONESHOT`"] - #[inline] - pub fn is_one_shot(&self) -> bool { - *self == TMODER::ONESHOT - } - #[doc = "Checks if the value of the field is `CONTINUOUS`"] - #[inline] - pub fn is_continuous(&self) -> bool { - *self == TMODER::CONTINUOUS - } - #[doc = "Checks if the value of the field is `COUNTER`"] - #[inline] - pub fn is_counter(&self) -> bool { - *self == TMODER::COUNTER - } - #[doc = "Checks if the value of the field is `PWM`"] - #[inline] - pub fn is_pwm(&self) -> bool { - *self == TMODER::PWM - } - #[doc = "Checks if the value of the field is `CAPTURE`"] - #[inline] - pub fn is_capture(&self) -> bool { - *self == TMODER::CAPTURE - } - #[doc = "Checks if the value of the field is `COMPARE`"] - #[inline] - pub fn is_compare(&self) -> bool { - *self == TMODER::COMPARE - } - #[doc = "Checks if the value of the field is `GATED`"] - #[inline] - pub fn is_gated(&self) -> bool { - *self == TMODER::GATED - } - #[doc = "Checks if the value of the field is `CAPTURECOMPARE`"] - #[inline] - pub fn is_capture_compare(&self) -> bool { - *self == TMODER::CAPTURECOMPARE - } - } - #[doc = "Possible values of the field `PRES`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PRESR { - #[doc = "Divide by 1."] - DIV1, - #[doc = "Divide by 2."] - DIV2, - #[doc = "Divide by 4."] - DIV4, - #[doc = "Divide by 8."] - DIV8, - #[doc = "Divide by 16."] - DIV16, - #[doc = "Divide by 32."] - DIV32, - #[doc = "Divide by 64."] - DIV64, - #[doc = "Divide by 128."] - DIV128, - } - impl PRESR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PRESR::DIV1 => 0, - PRESR::DIV2 => 0x01, - PRESR::DIV4 => 0x02, - PRESR::DIV8 => 0x03, - PRESR::DIV16 => 0x04, - PRESR::DIV32 => 0x05, - PRESR::DIV64 => 0x06, - PRESR::DIV128 => 0x07, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PRESR { - match value { - 0 => PRESR::DIV1, - 1 => PRESR::DIV2, - 2 => PRESR::DIV4, - 3 => PRESR::DIV8, - 4 => PRESR::DIV16, - 5 => PRESR::DIV32, - 6 => PRESR::DIV64, - 7 => PRESR::DIV128, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `DIV1`"] - #[inline] - pub fn is_div1(&self) -> bool { - *self == PRESR::DIV1 - } - #[doc = "Checks if the value of the field is `DIV2`"] - #[inline] - pub fn is_div2(&self) -> bool { - *self == PRESR::DIV2 - } - #[doc = "Checks if the value of the field is `DIV4`"] - #[inline] - pub fn is_div4(&self) -> bool { - *self == PRESR::DIV4 - } - #[doc = "Checks if the value of the field is `DIV8`"] - #[inline] - pub fn is_div8(&self) -> bool { - *self == PRESR::DIV8 - } - #[doc = "Checks if the value of the field is `DIV16`"] - #[inline] - pub fn is_div16(&self) -> bool { - *self == PRESR::DIV16 - } - #[doc = "Checks if the value of the field is `DIV32`"] - #[inline] - pub fn is_div32(&self) -> bool { - *self == PRESR::DIV32 - } - #[doc = "Checks if the value of the field is `DIV64`"] - #[inline] - pub fn is_div64(&self) -> bool { - *self == PRESR::DIV64 - } - #[doc = "Checks if the value of the field is `DIV128`"] - #[inline] - pub fn is_div128(&self) -> bool { - *self == PRESR::DIV128 - } - } - #[doc = "Possible values of the field `TPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TPOLR { - #[doc = "Active High."] - ACTIVEHI, - #[doc = "Active Low."] - ACTIVELO, - } - impl TPOLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TPOLR::ACTIVEHI => false, - TPOLR::ACTIVELO => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TPOLR { - match value { - false => TPOLR::ACTIVEHI, - true => TPOLR::ACTIVELO, - } - } - #[doc = "Checks if the value of the field is `ACTIVEHI`"] - #[inline] - pub fn is_active_hi(&self) -> bool { - *self == TPOLR::ACTIVEHI - } - #[doc = "Checks if the value of the field is `ACTIVELO`"] - #[inline] - pub fn is_active_lo(&self) -> bool { - *self == TPOLR::ACTIVELO - } - } - #[doc = "Possible values of the field `TEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TENR::DIS => false, - TENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TENR { - match value { - false => TENR::DIS, - true => TENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TENR::EN - } - } - #[doc = r" Value of the field"] - pub struct PRES3R { - bits: bool, - } - impl PRES3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `PWMSYNC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PWMSYNCR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl PWMSYNCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PWMSYNCR::DIS => false, - PWMSYNCR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PWMSYNCR { - match value { - false => PWMSYNCR::DIS, - true => PWMSYNCR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PWMSYNCR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PWMSYNCR::EN - } - } - #[doc = "Possible values of the field `NOLHPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NOLHPOLR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl NOLHPOLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - NOLHPOLR::DIS => false, - NOLHPOLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> NOLHPOLR { - match value { - false => NOLHPOLR::DIS, - true => NOLHPOLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == NOLHPOLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == NOLHPOLR::EN - } - } - #[doc = "Possible values of the field `NOLLPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NOLLPOLR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl NOLLPOLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - NOLLPOLR::DIS => false, - NOLLPOLR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> NOLLPOLR { - match value { - false => NOLLPOLR::DIS, - true => NOLLPOLR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == NOLLPOLR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == NOLLPOLR::EN - } - } - #[doc = "Possible values of the field `PWMCKBD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PWMCKBDR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl PWMCKBDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PWMCKBDR::DIS => true, - PWMCKBDR::EN => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PWMCKBDR { - match value { - true => PWMCKBDR::DIS, - false => PWMCKBDR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PWMCKBDR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PWMCKBDR::EN - } - } - #[doc = "Values that can be written to the field `TMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TMODEW { - #[doc = "One Shot Mode."] - ONESHOT, - #[doc = "Continuous Mode."] - CONTINUOUS, - #[doc = "Counter Mode."] - COUNTER, - #[doc = "PWM Mode."] - PWM, - #[doc = "Capture Mode."] - CAPTURE, - #[doc = "Compare Mode."] - COMPARE, - #[doc = "Gated Mode."] - GATED, - #[doc = "Capture/Compare Mode."] - CAPTURECOMPARE, - } - impl TMODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - TMODEW::ONESHOT => 0, - TMODEW::CONTINUOUS => 1, - TMODEW::COUNTER => 2, - TMODEW::PWM => 3, - TMODEW::CAPTURE => 4, - TMODEW::COMPARE => 5, - TMODEW::GATED => 6, - TMODEW::CAPTURECOMPARE => 7, - } - } - } - #[doc = r" Proxy"] - pub struct _TMODEW<'a> { - w: &'a mut W, - } - impl<'a> _TMODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TMODEW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "One Shot Mode."] - #[inline] - pub fn one_shot(self) -> &'a mut W { - self.variant(TMODEW::ONESHOT) - } - #[doc = "Continuous Mode."] - #[inline] - pub fn continuous(self) -> &'a mut W { - self.variant(TMODEW::CONTINUOUS) - } - #[doc = "Counter Mode."] - #[inline] - pub fn counter(self) -> &'a mut W { - self.variant(TMODEW::COUNTER) - } - #[doc = "PWM Mode."] - #[inline] - pub fn pwm(self) -> &'a mut W { - self.variant(TMODEW::PWM) - } - #[doc = "Capture Mode."] - #[inline] - pub fn capture(self) -> &'a mut W { - self.variant(TMODEW::CAPTURE) - } - #[doc = "Compare Mode."] - #[inline] - pub fn compare(self) -> &'a mut W { - self.variant(TMODEW::COMPARE) - } - #[doc = "Gated Mode."] - #[inline] - pub fn gated(self) -> &'a mut W { - self.variant(TMODEW::GATED) - } - #[doc = "Capture/Compare Mode."] - #[inline] - pub fn capture_compare(self) -> &'a mut W { - self.variant(TMODEW::CAPTURECOMPARE) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PRES`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PRESW { - #[doc = "Divide by 1."] - DIV1, - #[doc = "Divide by 2."] - DIV2, - #[doc = "Divide by 4."] - DIV4, - #[doc = "Divide by 8."] - DIV8, - #[doc = "Divide by 16."] - DIV16, - #[doc = "Divide by 32."] - DIV32, - #[doc = "Divide by 64."] - DIV64, - #[doc = "Divide by 128."] - DIV128, - } - impl PRESW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PRESW::DIV1 => 0, - PRESW::DIV2 => 1, - PRESW::DIV4 => 2, - PRESW::DIV8 => 3, - PRESW::DIV16 => 4, - PRESW::DIV32 => 5, - PRESW::DIV64 => 6, - PRESW::DIV128 => 7, - } - } - } - #[doc = r" Proxy"] - pub struct _PRESW<'a> { - w: &'a mut W, - } - impl<'a> _PRESW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PRESW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Divide by 1."] - #[inline] - pub fn div1(self) -> &'a mut W { - self.variant(PRESW::DIV1) - } - #[doc = "Divide by 2."] - #[inline] - pub fn div2(self) -> &'a mut W { - self.variant(PRESW::DIV2) - } - #[doc = "Divide by 4."] - #[inline] - pub fn div4(self) -> &'a mut W { - self.variant(PRESW::DIV4) - } - #[doc = "Divide by 8."] - #[inline] - pub fn div8(self) -> &'a mut W { - self.variant(PRESW::DIV8) - } - #[doc = "Divide by 16."] - #[inline] - pub fn div16(self) -> &'a mut W { - self.variant(PRESW::DIV16) - } - #[doc = "Divide by 32."] - #[inline] - pub fn div32(self) -> &'a mut W { - self.variant(PRESW::DIV32) - } - #[doc = "Divide by 64."] - #[inline] - pub fn div64(self) -> &'a mut W { - self.variant(PRESW::DIV64) - } - #[doc = "Divide by 128."] - #[inline] - pub fn div128(self) -> &'a mut W { - self.variant(PRESW::DIV128) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x07; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TPOLW { - #[doc = "Active High."] - ACTIVEHI, - #[doc = "Active Low."] - ACTIVELO, - } - impl TPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TPOLW::ACTIVEHI => false, - TPOLW::ACTIVELO => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TPOLW<'a> { - w: &'a mut W, - } - impl<'a> _TPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TPOLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Active High."] - #[inline] - pub fn active_hi(self) -> &'a mut W { - self.variant(TPOLW::ACTIVEHI) - } - #[doc = "Active Low."] - #[inline] - pub fn active_lo(self) -> &'a mut W { - self.variant(TPOLW::ACTIVELO) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `TEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl TENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TENW::DIS => false, - TENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TENW<'a> { - w: &'a mut W, - } - impl<'a> _TENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _PRES3W<'a> { - w: &'a mut W, - } - impl<'a> _PRES3W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PWMSYNC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PWMSYNCW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl PWMSYNCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PWMSYNCW::DIS => false, - PWMSYNCW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PWMSYNCW<'a> { - w: &'a mut W, - } - impl<'a> _PWMSYNCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PWMSYNCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PWMSYNCW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PWMSYNCW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NOLHPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NOLHPOLW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl NOLHPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - NOLHPOLW::DIS => false, - NOLHPOLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _NOLHPOLW<'a> { - w: &'a mut W, - } - impl<'a> _NOLHPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NOLHPOLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(NOLHPOLW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(NOLHPOLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NOLLPOL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NOLLPOLW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl NOLLPOLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - NOLLPOLW::DIS => false, - NOLLPOLW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _NOLLPOLW<'a> { - w: &'a mut W, - } - impl<'a> _NOLLPOLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NOLLPOLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(NOLLPOLW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(NOLLPOLW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PWMCKBD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PWMCKBDW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl PWMCKBDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PWMCKBDW::DIS => true, - PWMCKBDW::EN => false, - } - } - } - #[doc = r" Proxy"] - pub struct _PWMCKBDW<'a> { - w: &'a mut W, - } - impl<'a> _PWMCKBDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PWMCKBDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PWMCKBDW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PWMCKBDW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:2 - Timer Mode."] - #[inline] - pub fn tmode(&self) -> TMODER { - TMODER::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 3:5 - Prescaler. Set the Timer's prescaler value. The prescaler divides the PCLK input to the timer and sets the Timer's Count Clock, F_CNT_CLK = PCLK(HZ)/prescaler. The Timer's prescaler setting is a 4-bit value with pres3:pres\\[2:0\\]."] - #[inline] - pub fn pres(&self) -> PRESR { - PRESR::_from({ - const MASK: u8 = 0x07; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 6 - Timer input/output polarity bit."] - #[inline] - pub fn tpol(&self) -> TPOLR { - TPOLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 7 - Timer Enable."] - #[inline] - pub fn ten(&self) -> TENR { - TENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 8 - MSB of prescaler value."] - #[inline] - pub fn pres3(&self) -> PRES3R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PRES3R { bits } - } - #[doc = "Bit 9 - Timer PWM Synchronization Mode Enable."] - #[inline] - pub fn pwmsync(&self) -> PWMSYNCR { - PWMSYNCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Timer PWM output 0A polarity bit."] - #[inline] - pub fn nolhpol(&self) -> NOLHPOLR { - NOLHPOLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Timer PWM output 0A' polarity bit."] - #[inline] - pub fn nollpol(&self) -> NOLLPOLR { - NOLLPOLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - Timer PWM output 0A Mode Disable."] - #[inline] - pub fn pwmckbd(&self) -> PWMCKBDR { - PWMCKBDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:2 - Timer Mode."] - #[inline] - pub fn tmode(&mut self) -> _TMODEW { - _TMODEW { w: self } - } - #[doc = "Bits 3:5 - Prescaler. Set the Timer's prescaler value. The prescaler divides the PCLK input to the timer and sets the Timer's Count Clock, F_CNT_CLK = PCLK(HZ)/prescaler. The Timer's prescaler setting is a 4-bit value with pres3:pres\\[2:0\\]."] - #[inline] - pub fn pres(&mut self) -> _PRESW { - _PRESW { w: self } - } - #[doc = "Bit 6 - Timer input/output polarity bit."] - #[inline] - pub fn tpol(&mut self) -> _TPOLW { - _TPOLW { w: self } - } - #[doc = "Bit 7 - Timer Enable."] - #[inline] - pub fn ten(&mut self) -> _TENW { - _TENW { w: self } - } - #[doc = "Bit 8 - MSB of prescaler value."] - #[inline] - pub fn pres3(&mut self) -> _PRES3W { - _PRES3W { w: self } - } - #[doc = "Bit 9 - Timer PWM Synchronization Mode Enable."] - #[inline] - pub fn pwmsync(&mut self) -> _PWMSYNCW { - _PWMSYNCW { w: self } - } - #[doc = "Bit 10 - Timer PWM output 0A polarity bit."] - #[inline] - pub fn nolhpol(&mut self) -> _NOLHPOLW { - _NOLHPOLW { w: self } - } - #[doc = "Bit 11 - Timer PWM output 0A' polarity bit."] - #[inline] - pub fn nollpol(&mut self) -> _NOLLPOLW { - _NOLLPOLW { w: self } - } - #[doc = "Bit 12 - Timer PWM output 0A Mode Disable."] - #[inline] - pub fn pwmckbd(&mut self) -> _PWMCKBDW { - _PWMCKBDW { w: self } - } - } - } - #[doc = "Timer Non-Overlapping Compare Register."] - pub struct NOLCMP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Timer Non-Overlapping Compare Register."] - pub mod nolcmp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::NOLCMP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct NOLLCMPR { - bits: u8, - } - impl NOLLCMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct NOLHCMPR { - bits: u8, - } - impl NOLHCMPR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _NOLLCMPW<'a> { - w: &'a mut W, - } - impl<'a> _NOLLCMPW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NOLHCMPW<'a> { - w: &'a mut W, - } - impl<'a> _NOLHCMPW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Non-overlapping Low Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A and next rising edge of PWM output 0A'."] - #[inline] - pub fn nollcmp(&self) -> NOLLCMPR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - NOLLCMPR { bits } - } - #[doc = "Bits 8:15 - Non-overlapping High Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A' and next rising edge of PWM output 0A."] - #[inline] - pub fn nolhcmp(&self) -> NOLHCMPR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - NOLHCMPR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Non-overlapping Low Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A and next rising edge of PWM output 0A'."] - #[inline] - pub fn nollcmp(&mut self) -> _NOLLCMPW { - _NOLLCMPW { w: self } - } - #[doc = "Bits 8:15 - Non-overlapping High Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A' and next rising edge of PWM output 0A."] - #[inline] - pub fn nolhcmp(&mut self) -> _NOLHCMPW { - _NOLHCMPW { w: self } - } - } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting. 1"] -pub struct TMR1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR1 {} -impl TMR1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_1000 as *const _ - } -} -impl Deref for TMR1 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR1::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting. 2"] -pub struct TMR2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR2 {} -impl TMR2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_2000 as *const _ - } -} -impl Deref for TMR2 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR2::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting. 3"] -pub struct TMR3 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR3 {} -impl TMR3 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_3000 as *const _ - } -} -impl Deref for TMR3 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR3::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting. 4"] -pub struct TMR4 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR4 {} -impl TMR4 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_4000 as *const _ - } -} -impl Deref for TMR4 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR4::ptr() } - } -} -#[doc = "32-bit reloadable timer that can be used for timing and event counting. 5"] -pub struct TMR5 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TMR5 {} -impl TMR5 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const tmr0::RegisterBlock { - 0x4001_5000 as *const _ - } -} -impl Deref for TMR5 { - type Target = tmr0::RegisterBlock; - fn deref(&self) -> &tmr0::RegisterBlock { - unsafe { &*TMR5::ptr() } - } -} -#[doc = "Random Number Generator."] -pub struct TRNG { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for TRNG {} -impl TRNG { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const trng::RegisterBlock { - 0x400b_5000 as *const _ - } -} -impl Deref for TRNG { - type Target = trng::RegisterBlock; - fn deref(&self) -> &trng::RegisterBlock { - unsafe { &*TRNG::ptr() } - } -} -#[doc = "Random Number Generator."] -pub mod trng { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - TRNG Control Register."] - pub cn: CN, - #[doc = "0x04 - Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub st: ST, - #[doc = "0x08 - Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub data: DATA, - } - #[doc = "TRNG Control Register."] - pub struct CN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "TRNG Control Register."] - pub mod cn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ODHTR { - bits: bool, - } - impl ODHTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `RND_IRQ_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RND_IRQ_ENR { - #[doc = "Disable"] - DISABLE, - #[doc = "Enable"] - ENABLE, - } - impl RND_IRQ_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RND_IRQ_ENR::DISABLE => false, - RND_IRQ_ENR::ENABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RND_IRQ_ENR { - match value { - false => RND_IRQ_ENR::DISABLE, - true => RND_IRQ_ENR::ENABLE, - } - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == RND_IRQ_ENR::DISABLE - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == RND_IRQ_ENR::ENABLE - } - } - #[doc = "Possible values of the field `HEALTH_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HEALTH_ENR { - #[doc = "disable"] - DISABLE, - #[doc = "enable"] - ENABLE, - } - impl HEALTH_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HEALTH_ENR::DISABLE => false, - HEALTH_ENR::ENABLE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HEALTH_ENR { - match value { - false => HEALTH_ENR::DISABLE, - true => HEALTH_ENR::ENABLE, - } - } - #[doc = "Checks if the value of the field is `DISABLE`"] - #[inline] - pub fn is_disable(&self) -> bool { - *self == HEALTH_ENR::DISABLE - } - #[doc = "Checks if the value of the field is `ENABLE`"] - #[inline] - pub fn is_enable(&self) -> bool { - *self == HEALTH_ENR::ENABLE - } - } - #[doc = r" Value of the field"] - pub struct AESKG_MEUR { - bits: bool, - } - impl AESKG_MEUR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AESKG_MEMPROTER { - bits: bool, - } - impl AESKG_MEMPROTER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct AESKG_MEMPROTAR { - bits: bool, - } - impl AESKG_MEMPROTAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RSV16R { - bits: bool, - } - impl RSV16R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RSV17R { - bits: bool, - } - impl RSV17R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _ODHTW<'a> { - w: &'a mut W, - } - impl<'a> _ODHTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RND_IRQ_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RND_IRQ_ENW { - #[doc = "Disable"] - DISABLE, - #[doc = "Enable"] - ENABLE, - } - impl RND_IRQ_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RND_IRQ_ENW::DISABLE => false, - RND_IRQ_ENW::ENABLE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RND_IRQ_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RND_IRQ_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RND_IRQ_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable"] - #[inline] - pub fn disable(self) -> &'a mut W { - self.variant(RND_IRQ_ENW::DISABLE) - } - #[doc = "Enable"] - #[inline] - pub fn enable(self) -> &'a mut W { - self.variant(RND_IRQ_ENW::ENABLE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AESKG_MEUW<'a> { - w: &'a mut W, - } - impl<'a> _AESKG_MEUW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AESKG_MEMPROTEW<'a> { - w: &'a mut W, - } - impl<'a> _AESKG_MEMPROTEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _AESKG_MEMPROTAW<'a> { - w: &'a mut W, - } - impl<'a> _AESKG_MEMPROTAW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RSV16W<'a> { - w: &'a mut W, - } - impl<'a> _RSV16W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RSV17W<'a> { - w: &'a mut W, - } - impl<'a> _RSV17W<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 17; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Start On-Demand health test"] - #[inline] - pub fn odht(&self) -> ODHTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - ODHTR { bits } - } - #[doc = "Bit 1 - To enable IRQ generation when a new 32-bit Random number is ready."] - #[inline] - pub fn rnd_irq_en(&self) -> RND_IRQ_ENR { - RND_IRQ_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - To enable IRQ generation when a health test fails"] - #[inline] - pub fn health_en(&self) -> HEALTH_ENR { - HEALTH_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_meu(&self) -> AESKG_MEUR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AESKG_MEUR { bits } - } - #[doc = "Bit 4 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_memprote(&self) -> AESKG_MEMPROTER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AESKG_MEMPROTER { bits } - } - #[doc = "Bit 5 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_memprota(&self) -> AESKG_MEMPROTAR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AESKG_MEMPROTAR { bits } - } - #[doc = "Bit 16"] - #[inline] - pub fn rsv16(&self) -> RSV16R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RSV16R { bits } - } - #[doc = "Bit 17"] - #[inline] - pub fn rsv17(&self) -> RSV17R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 17; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RSV17R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0x03 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Start On-Demand health test"] - #[inline] - pub fn odht(&mut self) -> _ODHTW { - _ODHTW { w: self } - } - #[doc = "Bit 1 - To enable IRQ generation when a new 32-bit Random number is ready."] - #[inline] - pub fn rnd_irq_en(&mut self) -> _RND_IRQ_ENW { - _RND_IRQ_ENW { w: self } - } - #[doc = "Bit 3 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_meu(&mut self) -> _AESKG_MEUW { - _AESKG_MEUW { w: self } - } - #[doc = "Bit 4 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_memprote(&mut self) -> _AESKG_MEMPROTEW { - _AESKG_MEMPROTEW { w: self } - } - #[doc = "Bit 5 - AES Key Generate. When enabled, the key for securing NVSRAM is generated and transferred to the secure key register automatically without user visibility or intervention. This bit is cleared by hardware once the key has been transferred to the secure key register."] - #[inline] - pub fn aeskg_memprota(&mut self) -> _AESKG_MEMPROTAW { - _AESKG_MEMPROTAW { w: self } - } - #[doc = "Bit 16"] - #[inline] - pub fn rsv16(&mut self) -> _RSV16W { - _RSV16W { w: self } - } - #[doc = "Bit 17"] - #[inline] - pub fn rsv17(&mut self) -> _RSV17W { - _RSV17W { w: self } - } - } - } - #[doc = "Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub struct ST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub mod st { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::ST { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = "Possible values of the field `RND_RDY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RND_RDYR { - #[doc = "TRNG Busy"] - BUSY, - #[doc = "32 bit random data is ready"] - READY, - } - impl RND_RDYR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RND_RDYR::BUSY => false, - RND_RDYR::READY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RND_RDYR { - match value { - false => RND_RDYR::BUSY, - true => RND_RDYR::READY, - } - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == RND_RDYR::BUSY - } - #[doc = "Checks if the value of the field is `READY`"] - #[inline] - pub fn is_ready(&self) -> bool { - *self == RND_RDYR::READY - } - } - #[doc = "Possible values of the field `ODHTS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ODHTSR { - #[doc = "On demand health test done"] - DONE, - #[doc = "On demand health test on going"] - BUSY, - } - impl ODHTSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ODHTSR::DONE => false, - ODHTSR::BUSY => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ODHTSR { - match value { - false => ODHTSR::DONE, - true => ODHTSR::BUSY, - } - } - #[doc = "Checks if the value of the field is `DONE`"] - #[inline] - pub fn is_done(&self) -> bool { - *self == ODHTSR::DONE - } - #[doc = "Checks if the value of the field is `BUSY`"] - #[inline] - pub fn is_busy(&self) -> bool { - *self == ODHTSR::BUSY - } - } - #[doc = "Possible values of the field `HTS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum HTSR { - #[doc = "Pass"] - PASS, - #[doc = "Fail"] - FAIL, - } - impl HTSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - HTSR::PASS => false, - HTSR::FAIL => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> HTSR { - match value { - false => HTSR::PASS, - true => HTSR::FAIL, - } - } - #[doc = "Checks if the value of the field is `PASS`"] - #[inline] - pub fn is_pass(&self) -> bool { - *self == HTSR::PASS - } - #[doc = "Checks if the value of the field is `FAIL`"] - #[inline] - pub fn is_fail(&self) -> bool { - *self == HTSR::FAIL - } - } - #[doc = "Possible values of the field `SRCFAIL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SRCFAILR { - #[doc = "Entopy source works correctly"] - WORKS, - #[doc = "Entropy Source has failed"] - FAIL, - } - impl SRCFAILR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SRCFAILR::WORKS => false, - SRCFAILR::FAIL => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SRCFAILR { - match value { - false => SRCFAILR::WORKS, - true => SRCFAILR::FAIL, - } - } - #[doc = "Checks if the value of the field is `WORKS`"] - #[inline] - pub fn is_works(&self) -> bool { - *self == SRCFAILR::WORKS - } - #[doc = "Checks if the value of the field is `FAIL`"] - #[inline] - pub fn is_fail(&self) -> bool { - *self == SRCFAILR::FAIL - } - } - #[doc = r" Value of the field"] - pub struct AESKGD_MEU_SR { - bits: bool, - } - impl AESKGD_MEU_SR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RSV16R { - bits: bool, - } - impl RSV16R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - 32-bit random data is ready to read from TRNG_DATA register. Reading TRNG_DATA when RND_RDY=0 will return all 0's. IRQ is generated when RND_RDY=1 if TRNG_CN.RND_IRQ_EN=1."] - #[inline] - pub fn rnd_rdy(&self) -> RND_RDYR { - RND_RDYR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - On-Demand health test status"] - #[inline] - pub fn odhts(&self) -> ODHTSR { - ODHTSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 2 - Health test status. This bit shall be read when On-demand health test is completed (ODHTS=0) to check the result. This bit is also set when a continuous health test reports an error, IRQ is generated if HEALTH_EN=1. Write 1 to clear this bit."] - #[inline] - pub fn hts(&self) -> HTSR { - HTSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 3 - Entropy source has failed. IRQ is generated if HEALTH_EN=1. Write 1 to clear this bit."] - #[inline] - pub fn srcfail(&self) -> SRCFAILR { - SRCFAILR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 4 - Automatically AES transfer on going"] - #[inline] - pub fn aeskgd_meu_s(&self) -> AESKGD_MEU_SR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - AESKGD_MEU_SR { bits } - } - #[doc = "Bit 16"] - #[inline] - pub fn rsv16(&self) -> RSV16R { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RSV16R { bits } - } - } - } - #[doc = "Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub struct DATA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Data. The content of this register is valid only when RNG_IS = 1. When TRNG is disabled, read returns 0x0000 0000."] - pub mod data { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::DATA { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u32, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - Data. The content of this register is valid only when RNG_IS =1. When TNRG is disabled, read returns 0x0000 0000."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - DATAR { bits } - } - } - } -} -#[doc = "UART"] -pub struct UART0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for UART0 {} -impl UART0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const uart0::RegisterBlock { - 0x4004_2000 as *const _ - } -} -impl Deref for UART0 { - type Target = uart0::RegisterBlock; - fn deref(&self) -> &uart0::RegisterBlock { - unsafe { &*UART0::ptr() } - } -} -#[doc = "UART"] -pub mod uart0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Control Register."] - pub ctrl: CTRL, - #[doc = "0x04 - Threshold Control register."] - pub thresh_ctrl: THRESH_CTRL, - #[doc = "0x08 - Status Register."] - pub status: STATUS, - #[doc = "0x0c - Interrupt Enable Register."] - pub int_en: INT_EN, - #[doc = "0x10 - Interrupt Status Flags."] - pub int_fl: INT_FL, - #[doc = "0x14 - Baud rate register. Integer portion."] - pub baud0: BAUD0, - #[doc = "0x18 - Baud rate register. Decimal Setting."] - pub baud1: BAUD1, - #[doc = "0x1c - FIFO Data buffer."] - pub fifo: FIFO, - #[doc = "0x20 - DMA Configuration."] - pub dma: DMA, - #[doc = "0x24 - Transmit FIFO Status register."] - pub tx_fifo: TX_FIFO, - } - #[doc = "Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `ENABLE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENABLER { - #[doc = "UART disabled. FIFOs are flushed. Clock is gated off for power savings. "] - DIS, - #[doc = "UART enabled. "] - EN, - } - impl ENABLER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ENABLER::DIS => false, - ENABLER::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ENABLER { - match value { - false => ENABLER::DIS, - true => ENABLER::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == ENABLER::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == ENABLER::EN - } - } - #[doc = "Possible values of the field `PARITY_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARITY_ENR { - #[doc = "No Parity "] - DIS, - #[doc = "Parity enabled as 9th bit"] - EN, - } - impl PARITY_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PARITY_ENR::DIS => false, - PARITY_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PARITY_ENR { - match value { - false => PARITY_ENR::DIS, - true => PARITY_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == PARITY_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == PARITY_ENR::EN - } - } - #[doc = "Possible values of the field `PARITY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARITYR { - #[doc = "Even parity selected."] - EVEN, - #[doc = "Odd parity selected."] - ODD, - #[doc = "Mark parity selected."] - MARK, - #[doc = "Space parity selected."] - SPACE, - } - impl PARITYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - PARITYR::EVEN => 0, - PARITYR::ODD => 0x01, - PARITYR::MARK => 0x02, - PARITYR::SPACE => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> PARITYR { - match value { - 0 => PARITYR::EVEN, - 1 => PARITYR::ODD, - 2 => PARITYR::MARK, - 3 => PARITYR::SPACE, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `EVEN`"] - #[inline] - pub fn is_even(&self) -> bool { - *self == PARITYR::EVEN - } - #[doc = "Checks if the value of the field is `ODD`"] - #[inline] - pub fn is_odd(&self) -> bool { - *self == PARITYR::ODD - } - #[doc = "Checks if the value of the field is `MARK`"] - #[inline] - pub fn is_mark(&self) -> bool { - *self == PARITYR::MARK - } - #[doc = "Checks if the value of the field is `SPACE`"] - #[inline] - pub fn is_space(&self) -> bool { - *self == PARITYR::SPACE - } - } - #[doc = "Possible values of the field `PARMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARMDR { - #[doc = "Parity calculation is based on number of 1s in frame."] - _1, - #[doc = "Parity calculation is based on number of 0s in frame."] - _0, - } - impl PARMDR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - PARMDR::_1 => false, - PARMDR::_0 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> PARMDR { - match value { - false => PARMDR::_1, - true => PARMDR::_0, - } - } - #[doc = "Checks if the value of the field is `_1`"] - #[inline] - pub fn is_1(&self) -> bool { - *self == PARMDR::_1 - } - #[doc = "Checks if the value of the field is `_0`"] - #[inline] - pub fn is_0(&self) -> bool { - *self == PARMDR::_0 - } - } - #[doc = r" Value of the field"] - pub struct TX_FLUSHR { - bits: bool, - } - impl TX_FLUSHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_FLUSHR { - bits: bool, - } - impl RX_FLUSHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `BITACC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BITACCR { - #[doc = "Frame accuracy."] - FRAME, - #[doc = "Bit accuracy."] - BIT, - } - impl BITACCR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BITACCR::FRAME => false, - BITACCR::BIT => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BITACCR { - match value { - false => BITACCR::FRAME, - true => BITACCR::BIT, - } - } - #[doc = "Checks if the value of the field is `FRAME`"] - #[inline] - pub fn is_frame(&self) -> bool { - *self == BITACCR::FRAME - } - #[doc = "Checks if the value of the field is `BIT`"] - #[inline] - pub fn is_bit_(&self) -> bool { - *self == BITACCR::BIT - } - } - #[doc = "Possible values of the field `CHAR_SIZE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHAR_SIZER { - #[doc = "5 bits."] - _5, - #[doc = "6 bits."] - _6, - #[doc = "7 bits."] - _7, - #[doc = "8 bits."] - _8, - } - impl CHAR_SIZER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - CHAR_SIZER::_5 => 0, - CHAR_SIZER::_6 => 0x01, - CHAR_SIZER::_7 => 0x02, - CHAR_SIZER::_8 => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> CHAR_SIZER { - match value { - 0 => CHAR_SIZER::_5, - 1 => CHAR_SIZER::_6, - 2 => CHAR_SIZER::_7, - 3 => CHAR_SIZER::_8, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_5`"] - #[inline] - pub fn is_5(&self) -> bool { - *self == CHAR_SIZER::_5 - } - #[doc = "Checks if the value of the field is `_6`"] - #[inline] - pub fn is_6(&self) -> bool { - *self == CHAR_SIZER::_6 - } - #[doc = "Checks if the value of the field is `_7`"] - #[inline] - pub fn is_7(&self) -> bool { - *self == CHAR_SIZER::_7 - } - #[doc = "Checks if the value of the field is `_8`"] - #[inline] - pub fn is_8(&self) -> bool { - *self == CHAR_SIZER::_8 - } - } - #[doc = "Possible values of the field `STOPBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPBITSR { - #[doc = "1 stop bit."] - _1, - #[doc = "1.5 stop bits."] - _1_5, - } - impl STOPBITSR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - STOPBITSR::_1 => false, - STOPBITSR::_1_5 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> STOPBITSR { - match value { - false => STOPBITSR::_1, - true => STOPBITSR::_1_5, - } - } - #[doc = "Checks if the value of the field is `_1`"] - #[inline] - pub fn is_1(&self) -> bool { - *self == STOPBITSR::_1 - } - #[doc = "Checks if the value of the field is `_1_5`"] - #[inline] - pub fn is_1_5(&self) -> bool { - *self == STOPBITSR::_1_5 - } - } - #[doc = "Possible values of the field `FLOW_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLOW_CTRLR { - #[doc = "HW Flow Control with RTS/CTS enabled"] - EN, - #[doc = "HW Flow Control disabled"] - DIS, - } - impl FLOW_CTRLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FLOW_CTRLR::EN => true, - FLOW_CTRLR::DIS => false, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FLOW_CTRLR { - match value { - true => FLOW_CTRLR::EN, - false => FLOW_CTRLR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == FLOW_CTRLR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == FLOW_CTRLR::DIS - } - } - #[doc = "Possible values of the field `FLOW_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLOW_POLR { - #[doc = "RTS/CTS asserted is logic 0."] - _0, - #[doc = "RTS/CTS asserted is logic 1."] - _1, - } - impl FLOW_POLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FLOW_POLR::_0 => false, - FLOW_POLR::_1 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FLOW_POLR { - match value { - false => FLOW_POLR::_0, - true => FLOW_POLR::_1, - } - } - #[doc = "Checks if the value of the field is `_0`"] - #[inline] - pub fn is_0(&self) -> bool { - *self == FLOW_POLR::_0 - } - #[doc = "Checks if the value of the field is `_1`"] - #[inline] - pub fn is_1(&self) -> bool { - *self == FLOW_POLR::_1 - } - } - #[doc = "Possible values of the field `NULL_MODEM`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NULL_MODEMR { - #[doc = "Direct convention."] - DIS, - #[doc = "Null Modem Mode."] - EN, - } - impl NULL_MODEMR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - NULL_MODEMR::DIS => false, - NULL_MODEMR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> NULL_MODEMR { - match value { - false => NULL_MODEMR::DIS, - true => NULL_MODEMR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == NULL_MODEMR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == NULL_MODEMR::EN - } - } - #[doc = "Possible values of the field `BREAK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BREAKR { - #[doc = "Break characters are not generated."] - DIS, - #[doc = "Break characters are sent(all the bits are at '0' including start/parity/stop)."] - EN, - } - impl BREAKR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - BREAKR::DIS => false, - BREAKR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> BREAKR { - match value { - false => BREAKR::DIS, - true => BREAKR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == BREAKR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == BREAKR::EN - } - } - #[doc = "Possible values of the field `CLKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLKSELR { - #[doc = "System clock."] - SYSTEM, - #[doc = "Alternate 7.3727MHz internal clock. Useful in low power modes when the system clock is slow."] - ALTERNATE, - } - impl CLKSELR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - CLKSELR::SYSTEM => false, - CLKSELR::ALTERNATE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> CLKSELR { - match value { - false => CLKSELR::SYSTEM, - true => CLKSELR::ALTERNATE, - } - } - #[doc = "Checks if the value of the field is `SYSTEM`"] - #[inline] - pub fn is_system(&self) -> bool { - *self == CLKSELR::SYSTEM - } - #[doc = "Checks if the value of the field is `ALTERNATE`"] - #[inline] - pub fn is_alternate(&self) -> bool { - *self == CLKSELR::ALTERNATE - } - } - #[doc = r" Value of the field"] - pub struct RX_TOR { - bits: u8, - } - impl RX_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `ENABLE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ENABLEW { - #[doc = "UART disabled. FIFOs are flushed. Clock is gated off for power savings. "] - DIS, - #[doc = "UART enabled. "] - EN, - } - impl ENABLEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ENABLEW::DIS => false, - ENABLEW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ENABLEW<'a> { - w: &'a mut W, - } - impl<'a> _ENABLEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ENABLEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "UART disabled. FIFOs are flushed. Clock is gated off for power savings."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(ENABLEW::DIS) - } - #[doc = "UART enabled."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(ENABLEW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PARITY_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARITY_ENW { - #[doc = "No Parity "] - DIS, - #[doc = "Parity enabled as 9th bit"] - EN, - } - impl PARITY_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PARITY_ENW::DIS => false, - PARITY_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PARITY_ENW<'a> { - w: &'a mut W, - } - impl<'a> _PARITY_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PARITY_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No Parity"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(PARITY_ENW::DIS) - } - #[doc = "Parity enabled as 9th bit"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(PARITY_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PARITY`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARITYW { - #[doc = "Even parity selected."] - EVEN, - #[doc = "Odd parity selected."] - ODD, - #[doc = "Mark parity selected."] - MARK, - #[doc = "Space parity selected."] - SPACE, - } - impl PARITYW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - PARITYW::EVEN => 0, - PARITYW::ODD => 1, - PARITYW::MARK => 2, - PARITYW::SPACE => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _PARITYW<'a> { - w: &'a mut W, - } - impl<'a> _PARITYW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PARITYW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Even parity selected."] - #[inline] - pub fn even(self) -> &'a mut W { - self.variant(PARITYW::EVEN) - } - #[doc = "Odd parity selected."] - #[inline] - pub fn odd(self) -> &'a mut W { - self.variant(PARITYW::ODD) - } - #[doc = "Mark parity selected."] - #[inline] - pub fn mark(self) -> &'a mut W { - self.variant(PARITYW::MARK) - } - #[doc = "Space parity selected."] - #[inline] - pub fn space(self) -> &'a mut W { - self.variant(PARITYW::SPACE) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `PARMD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum PARMDW { - #[doc = "Parity calculation is based on number of 1s in frame."] - _1, - #[doc = "Parity calculation is based on number of 0s in frame."] - _0, - } - impl PARMDW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - PARMDW::_1 => false, - PARMDW::_0 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _PARMDW<'a> { - w: &'a mut W, - } - impl<'a> _PARMDW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: PARMDW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Parity calculation is based on number of 1s in frame."] - #[inline] - pub fn _1(self) -> &'a mut W { - self.variant(PARMDW::_1) - } - #[doc = "Parity calculation is based on number of 0s in frame."] - #[inline] - pub fn _0(self) -> &'a mut W { - self.variant(PARMDW::_0) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FLUSHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FLUSHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FLUSHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BITACC`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BITACCW { - #[doc = "Frame accuracy."] - FRAME, - #[doc = "Bit accuracy."] - BIT, - } - impl BITACCW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BITACCW::FRAME => false, - BITACCW::BIT => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BITACCW<'a> { - w: &'a mut W, - } - impl<'a> _BITACCW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BITACCW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Frame accuracy."] - #[inline] - pub fn frame(self) -> &'a mut W { - self.variant(BITACCW::FRAME) - } - #[doc = "Bit accuracy."] - #[inline] - pub fn bit_(self) -> &'a mut W { - self.variant(BITACCW::BIT) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CHAR_SIZE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CHAR_SIZEW { - #[doc = "5 bits."] - _5, - #[doc = "6 bits."] - _6, - #[doc = "7 bits."] - _7, - #[doc = "8 bits."] - _8, - } - impl CHAR_SIZEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - CHAR_SIZEW::_5 => 0, - CHAR_SIZEW::_6 => 1, - CHAR_SIZEW::_7 => 2, - CHAR_SIZEW::_8 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _CHAR_SIZEW<'a> { - w: &'a mut W, - } - impl<'a> _CHAR_SIZEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CHAR_SIZEW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "5 bits."] - #[inline] - pub fn _5(self) -> &'a mut W { - self.variant(CHAR_SIZEW::_5) - } - #[doc = "6 bits."] - #[inline] - pub fn _6(self) -> &'a mut W { - self.variant(CHAR_SIZEW::_6) - } - #[doc = "7 bits."] - #[inline] - pub fn _7(self) -> &'a mut W { - self.variant(CHAR_SIZEW::_7) - } - #[doc = "8 bits."] - #[inline] - pub fn _8(self) -> &'a mut W { - self.variant(CHAR_SIZEW::_8) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `STOPBITS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum STOPBITSW { - #[doc = "1 stop bit."] - _1, - #[doc = "1.5 stop bits."] - _1_5, - } - impl STOPBITSW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - STOPBITSW::_1 => false, - STOPBITSW::_1_5 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _STOPBITSW<'a> { - w: &'a mut W, - } - impl<'a> _STOPBITSW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: STOPBITSW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "1 stop bit."] - #[inline] - pub fn _1(self) -> &'a mut W { - self.variant(STOPBITSW::_1) - } - #[doc = "1.5 stop bits."] - #[inline] - pub fn _1_5(self) -> &'a mut W { - self.variant(STOPBITSW::_1_5) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FLOW_CTRL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLOW_CTRLW { - #[doc = "HW Flow Control with RTS/CTS enabled"] - EN, - #[doc = "HW Flow Control disabled"] - DIS, - } - impl FLOW_CTRLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FLOW_CTRLW::EN => true, - FLOW_CTRLW::DIS => false, - } - } - } - #[doc = r" Proxy"] - pub struct _FLOW_CTRLW<'a> { - w: &'a mut W, - } - impl<'a> _FLOW_CTRLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FLOW_CTRLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "HW Flow Control with RTS/CTS enabled"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(FLOW_CTRLW::EN) - } - #[doc = "HW Flow Control disabled"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(FLOW_CTRLW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FLOW_POL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FLOW_POLW { - #[doc = "RTS/CTS asserted is logic 0."] - _0, - #[doc = "RTS/CTS asserted is logic 1."] - _1, - } - impl FLOW_POLW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FLOW_POLW::_0 => false, - FLOW_POLW::_1 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FLOW_POLW<'a> { - w: &'a mut W, - } - impl<'a> _FLOW_POLW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FLOW_POLW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "RTS/CTS asserted is logic 0."] - #[inline] - pub fn _0(self) -> &'a mut W { - self.variant(FLOW_POLW::_0) - } - #[doc = "RTS/CTS asserted is logic 1."] - #[inline] - pub fn _1(self) -> &'a mut W { - self.variant(FLOW_POLW::_1) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `NULL_MODEM`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum NULL_MODEMW { - #[doc = "Direct convention."] - DIS, - #[doc = "Null Modem Mode."] - EN, - } - impl NULL_MODEMW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - NULL_MODEMW::DIS => false, - NULL_MODEMW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _NULL_MODEMW<'a> { - w: &'a mut W, - } - impl<'a> _NULL_MODEMW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: NULL_MODEMW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Direct convention."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(NULL_MODEMW::DIS) - } - #[doc = "Null Modem Mode."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(NULL_MODEMW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `BREAK`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum BREAKW { - #[doc = "Break characters are not generated."] - DIS, - #[doc = "Break characters are sent(all the bits are at '0' including start/parity/stop)."] - EN, - } - impl BREAKW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - BREAKW::DIS => false, - BREAKW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _BREAKW<'a> { - w: &'a mut W, - } - impl<'a> _BREAKW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: BREAKW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Break characters are not generated."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(BREAKW::DIS) - } - #[doc = "Break characters are sent(all the bits are at '0' including start/parity/stop)."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(BREAKW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `CLKSEL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum CLKSELW { - #[doc = "System clock."] - SYSTEM, - #[doc = "Alternate 7.3727MHz internal clock. Useful in low power modes when the system clock is slow."] - ALTERNATE, - } - impl CLKSELW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - CLKSELW::SYSTEM => false, - CLKSELW::ALTERNATE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _CLKSELW<'a> { - w: &'a mut W, - } - impl<'a> _CLKSELW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: CLKSELW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "System clock."] - #[inline] - pub fn system(self) -> &'a mut W { - self.variant(CLKSELW::SYSTEM) - } - #[doc = "Alternate 7.3727MHz internal clock. Useful in low power modes when the system clock is slow."] - #[inline] - pub fn alternate(self) -> &'a mut W { - self.variant(CLKSELW::ALTERNATE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_TOW<'a> { - w: &'a mut W, - } - impl<'a> _RX_TOW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - UART enabled, to enable UART block, it is used to drive a gated clock in order to save power consumption when UART is not used. FIFOs are flushed when UART is disabled."] - #[inline] - pub fn enable(&self) -> ENABLER { - ENABLER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - Enable/disable Parity bit (9th character)."] - #[inline] - pub fn parity_en(&self) -> PARITY_ENR { - PARITY_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 2:3 - When PARITY_EN=1, selects odd, even, Mark or Space parity. Mark parity = always 1; Space parity = always 0."] - #[inline] - pub fn parity(&self) -> PARITYR { - PARITYR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 4 - Selects parity based on 1s or 0s count (when PARITY_EN=1)."] - #[inline] - pub fn parmd(&self) -> PARMDR { - PARMDR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 5 - Flushes the TX FIFO buffer."] - #[inline] - pub fn tx_flush(&self) -> TX_FLUSHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FLUSHR { bits } - } - #[doc = "Bit 6 - Flushes the RX FIFO buffer."] - #[inline] - pub fn rx_flush(&self) -> RX_FLUSHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FLUSHR { bits } - } - #[doc = "Bit 7 - If set, bit accuracy is selected, in this case the bit duration is the same for all the bits with the optimal accuracy. But the frame duration can have a significant deviation from the expected baudrate.If clear, frame accuracy is selected, therefore bits can have different duration in order to guarantee the minimum frame deviation."] - #[inline] - pub fn bitacc(&self) -> BITACCR { - BITACCR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:9 - Selects UART character size."] - #[inline] - pub fn char_size(&self) -> CHAR_SIZER { - CHAR_SIZER::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 10 - Selects the number of stop bits that will be generated."] - #[inline] - pub fn stopbits(&self) -> STOPBITSR { - STOPBITSR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Enables/disables hardware flow control."] - #[inline] - pub fn flow_ctrl(&self) -> FLOW_CTRLR { - FLOW_CTRLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 12 - RTS/CTS polarity."] - #[inline] - pub fn flow_pol(&self) -> FLOW_POLR { - FLOW_POLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 13 - NULL Modem Support (RTS/CTS and TXD/RXD swap)."] - #[inline] - pub fn null_modem(&self) -> NULL_MODEMR { - NULL_MODEMR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 14 - Break control bit. It causes a break condition to be transmitted to receiving UART."] - #[inline] - pub fn break_(&self) -> BREAKR { - BREAKR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 15 - Baud Rate Clock Source Select. Selects the baud rate clock."] - #[inline] - pub fn clksel(&self) -> CLKSELR { - CLKSELR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 16:23 - RX Time Out. RX time out interrupt will occur after RXTO Uart characters if RX-FIFO is not empty and RX FIFO has not been read."] - #[inline] - pub fn rx_to(&self) -> RX_TOR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_TOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - UART enabled, to enable UART block, it is used to drive a gated clock in order to save power consumption when UART is not used. FIFOs are flushed when UART is disabled."] - #[inline] - pub fn enable(&mut self) -> _ENABLEW { - _ENABLEW { w: self } - } - #[doc = "Bit 1 - Enable/disable Parity bit (9th character)."] - #[inline] - pub fn parity_en(&mut self) -> _PARITY_ENW { - _PARITY_ENW { w: self } - } - #[doc = "Bits 2:3 - When PARITY_EN=1, selects odd, even, Mark or Space parity. Mark parity = always 1; Space parity = always 0."] - #[inline] - pub fn parity(&mut self) -> _PARITYW { - _PARITYW { w: self } - } - #[doc = "Bit 4 - Selects parity based on 1s or 0s count (when PARITY_EN=1)."] - #[inline] - pub fn parmd(&mut self) -> _PARMDW { - _PARMDW { w: self } - } - #[doc = "Bit 5 - Flushes the TX FIFO buffer."] - #[inline] - pub fn tx_flush(&mut self) -> _TX_FLUSHW { - _TX_FLUSHW { w: self } - } - #[doc = "Bit 6 - Flushes the RX FIFO buffer."] - #[inline] - pub fn rx_flush(&mut self) -> _RX_FLUSHW { - _RX_FLUSHW { w: self } - } - #[doc = "Bit 7 - If set, bit accuracy is selected, in this case the bit duration is the same for all the bits with the optimal accuracy. But the frame duration can have a significant deviation from the expected baudrate.If clear, frame accuracy is selected, therefore bits can have different duration in order to guarantee the minimum frame deviation."] - #[inline] - pub fn bitacc(&mut self) -> _BITACCW { - _BITACCW { w: self } - } - #[doc = "Bits 8:9 - Selects UART character size."] - #[inline] - pub fn char_size(&mut self) -> _CHAR_SIZEW { - _CHAR_SIZEW { w: self } - } - #[doc = "Bit 10 - Selects the number of stop bits that will be generated."] - #[inline] - pub fn stopbits(&mut self) -> _STOPBITSW { - _STOPBITSW { w: self } - } - #[doc = "Bit 11 - Enables/disables hardware flow control."] - #[inline] - pub fn flow_ctrl(&mut self) -> _FLOW_CTRLW { - _FLOW_CTRLW { w: self } - } - #[doc = "Bit 12 - RTS/CTS polarity."] - #[inline] - pub fn flow_pol(&mut self) -> _FLOW_POLW { - _FLOW_POLW { w: self } - } - #[doc = "Bit 13 - NULL Modem Support (RTS/CTS and TXD/RXD swap)."] - #[inline] - pub fn null_modem(&mut self) -> _NULL_MODEMW { - _NULL_MODEMW { w: self } - } - #[doc = "Bit 14 - Break control bit. It causes a break condition to be transmitted to receiving UART."] - #[inline] - pub fn break_(&mut self) -> _BREAKW { - _BREAKW { w: self } - } - #[doc = "Bit 15 - Baud Rate Clock Source Select. Selects the baud rate clock."] - #[inline] - pub fn clksel(&mut self) -> _CLKSELW { - _CLKSELW { w: self } - } - #[doc = "Bits 16:23 - RX Time Out. RX time out interrupt will occur after RXTO Uart characters if RX-FIFO is not empty and RX FIFO has not been read."] - #[inline] - pub fn rx_to(&mut self) -> _RX_TOW { - _RX_TOW { w: self } - } - } - } - #[doc = "Threshold Control register."] - pub struct THRESH_CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Threshold Control register."] - pub mod thresh_ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::THRESH_CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_THRESHR { - bits: u8, - } - impl RX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_THRESHR { - bits: u8, - } - impl TX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RTS_FIFO_THRESHR { - bits: u8, - } - impl RTS_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_THRESHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_THRESHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RTS_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RTS_FIFO_THRESHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:5 - RX FIFO Threshold Level.When the RX FIFO reaches this many bytes or higher, UARTn_INFTL.rx_fifo_level is set."] - #[inline] - pub fn rx_fifo_thresh(&self) -> RX_FIFO_THRESHR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_THRESHR { bits } - } - #[doc = "Bits 8:13 - TX FIFO Threshold Level. When the TX FIFO reaches this many bytes or higher, UARTn_INTFL.tx_fifo_level is set."] - #[inline] - pub fn tx_fifo_thresh(&self) -> TX_FIFO_THRESHR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_THRESHR { bits } - } - #[doc = "Bits 16:21 - RTS threshold control. When the RX FIFO reaches this many bytes or higher, the RTS output signal is deasserted, informing the transmitting UART to stop sending data to this UART."] - #[inline] - pub fn rts_fifo_thresh(&self) -> RTS_FIFO_THRESHR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RTS_FIFO_THRESHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:5 - RX FIFO Threshold Level.When the RX FIFO reaches this many bytes or higher, UARTn_INFTL.rx_fifo_level is set."] - #[inline] - pub fn rx_fifo_thresh(&mut self) -> _RX_FIFO_THRESHW { - _RX_FIFO_THRESHW { w: self } - } - #[doc = "Bits 8:13 - TX FIFO Threshold Level. When the TX FIFO reaches this many bytes or higher, UARTn_INTFL.tx_fifo_level is set."] - #[inline] - pub fn tx_fifo_thresh(&mut self) -> _TX_FIFO_THRESHW { - _TX_FIFO_THRESHW { w: self } - } - #[doc = "Bits 16:21 - RTS threshold control. When the RX FIFO reaches this many bytes or higher, the RTS output signal is deasserted, informing the transmitting UART to stop sending data to this UART."] - #[inline] - pub fn rts_fifo_thresh(&mut self) -> _RTS_FIFO_THRESHW { - _RTS_FIFO_THRESHW { w: self } - } - } - } - #[doc = "Status Register."] - pub struct STATUS { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Status Register."] - pub mod status { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::STATUS { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct TX_BUSYR { - bits: bool, - } - impl TX_BUSYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_BUSYR { - bits: bool, - } - impl RX_BUSYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct PARITYR { - bits: bool, - } - impl PARITYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BREAKR { - bits: bool, - } - impl BREAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_EMPTYR { - bits: bool, - } - impl RX_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_FULLR { - bits: bool, - } - impl RX_FULLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_EMPTYR { - bits: bool, - } - impl TX_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_FULLR { - bits: bool, - } - impl TX_FULLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_CNTR { - bits: u8, - } - impl RX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_CNTR { - bits: u8, - } - impl TX_FIFO_CNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RX_TOR { - bits: bool, - } - impl RX_TOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Read-only flag indicating the UART transmit status."] - #[inline] - pub fn tx_busy(&self) -> TX_BUSYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_BUSYR { bits } - } - #[doc = "Bit 1 - Read-only flag indicating the UARTreceiver status."] - #[inline] - pub fn rx_busy(&self) -> RX_BUSYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_BUSYR { bits } - } - #[doc = "Bit 2 - 9th Received bit state. This bit identifies the state of the 9th bit of received data. Only available for UART_CTRL.SIZE\\[1:0\\]=3."] - #[inline] - pub fn parity(&self) -> PARITYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - PARITYR { bits } - } - #[doc = "Bit 3 - Received BREAK status. BREAKS is cleared when UART_STAT register is read. Received data input is held in spacing (logic 0) state for longer than a full word transmission time (that is, the total time of Start bit + data bits + Parity + Stop bits)."] - #[inline] - pub fn break_(&self) -> BREAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BREAKR { bits } - } - #[doc = "Bit 4 - Read-only flag indicating the RX FIFO state."] - #[inline] - pub fn rx_empty(&self) -> RX_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_EMPTYR { bits } - } - #[doc = "Bit 5 - Read-only flag indicating the RX FIFO state."] - #[inline] - pub fn rx_full(&self) -> RX_FULLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FULLR { bits } - } - #[doc = "Bit 6 - Read-only flag indicating the TX FIFO state."] - #[inline] - pub fn tx_empty(&self) -> TX_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_EMPTYR { bits } - } - #[doc = "Bit 7 - Read-only flag indicating the TX FIFO state."] - #[inline] - pub fn tx_full(&self) -> TX_FULLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FULLR { bits } - } - #[doc = "Bits 8:13 - Indicates the number of bytes currently in the RX FIFO."] - #[inline] - pub fn rx_fifo_cnt(&self) -> RX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RX_FIFO_CNTR { bits } - } - #[doc = "Bits 16:21 - Indicates the number of bytes currently in the TX FIFO."] - #[inline] - pub fn tx_fifo_cnt(&self) -> TX_FIFO_CNTR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TX_FIFO_CNTR { bits } - } - #[doc = "Bit 24 - RX Timeout status."] - #[inline] - pub fn rx_to(&self) -> RX_TOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 24; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_TOR { bits } - } - } - } - #[doc = "Interrupt Enable Register."] - pub struct INT_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Enable Register."] - pub mod int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RX_FRAME_ERRORR { - bits: bool, - } - impl RX_FRAME_ERRORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_PARITY_ERRORR { - bits: bool, - } - impl RX_PARITY_ERRORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CTS_CHANGER { - bits: bool, - } - impl CTS_CHANGER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_OVERRUNR { - bits: bool, - } - impl RX_OVERRUNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_THRESHR { - bits: bool, - } - impl RX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_ALMOST_EMPTYR { - bits: bool, - } - impl TX_FIFO_ALMOST_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_THRESHR { - bits: bool, - } - impl TX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BREAKR { - bits: bool, - } - impl BREAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_TIMEOUTR { - bits: bool, - } - impl RX_TIMEOUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LAST_BREAKR { - bits: bool, - } - impl LAST_BREAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _RX_FRAME_ERRORW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FRAME_ERRORW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_PARITY_ERRORW<'a> { - w: &'a mut W, - } - impl<'a> _RX_PARITY_ERRORW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CTS_CHANGEW<'a> { - w: &'a mut W, - } - impl<'a> _CTS_CHANGEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_OVERRUNW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVERRUNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_THRESHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_ALMOST_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_ALMOST_EMPTYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_THRESHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BREAKW<'a> { - w: &'a mut W, - } - impl<'a> _BREAKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_TIMEOUTW<'a> { - w: &'a mut W, - } - impl<'a> _RX_TIMEOUTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LAST_BREAKW<'a> { - w: &'a mut W, - } - impl<'a> _LAST_BREAKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Enable for RX Frame Error Interrupt."] - #[inline] - pub fn rx_frame_error(&self) -> RX_FRAME_ERRORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FRAME_ERRORR { bits } - } - #[doc = "Bit 1 - Enable for RX Parity Error interrupt."] - #[inline] - pub fn rx_parity_error(&self) -> RX_PARITY_ERRORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_PARITY_ERRORR { bits } - } - #[doc = "Bit 2 - Enable for CTS signal change interrupt."] - #[inline] - pub fn cts_change(&self) -> CTS_CHANGER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CTS_CHANGER { bits } - } - #[doc = "Bit 3 - Enable for RX FIFO OVerrun interrupt."] - #[inline] - pub fn rx_overrun(&self) -> RX_OVERRUNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_OVERRUNR { bits } - } - #[doc = "Bit 4 - Enable for interrupt when RX FIFO reaches the number of bytes configured by the RXTHD field."] - #[inline] - pub fn rx_fifo_thresh(&self) -> RX_FIFO_THRESHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FIFO_THRESHR { bits } - } - #[doc = "Bit 5 - Enable for interrupt when TX FIFO has only one byte remaining."] - #[inline] - pub fn tx_fifo_almost_empty(&self) -> TX_FIFO_ALMOST_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FIFO_ALMOST_EMPTYR { bits } - } - #[doc = "Bit 6 - Enable for interrupt when TX FIFO reaches the number of bytes configured by the TXTHD field."] - #[inline] - pub fn tx_fifo_thresh(&self) -> TX_FIFO_THRESHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FIFO_THRESHR { bits } - } - #[doc = "Bit 7 - Enable for received BREAK character interrupt."] - #[inline] - pub fn break_(&self) -> BREAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BREAKR { bits } - } - #[doc = "Bit 8 - Enable for RX Timeout Interrupt. Trigger if there is no RX communication during n UART characters (n=UART_CN.RXTO)."] - #[inline] - pub fn rx_timeout(&self) -> RX_TIMEOUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_TIMEOUTR { bits } - } - #[doc = "Bit 9 - Enable for Last break character interrupt."] - #[inline] - pub fn last_break(&self) -> LAST_BREAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LAST_BREAKR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable for RX Frame Error Interrupt."] - #[inline] - pub fn rx_frame_error(&mut self) -> _RX_FRAME_ERRORW { - _RX_FRAME_ERRORW { w: self } - } - #[doc = "Bit 1 - Enable for RX Parity Error interrupt."] - #[inline] - pub fn rx_parity_error(&mut self) -> _RX_PARITY_ERRORW { - _RX_PARITY_ERRORW { w: self } - } - #[doc = "Bit 2 - Enable for CTS signal change interrupt."] - #[inline] - pub fn cts_change(&mut self) -> _CTS_CHANGEW { - _CTS_CHANGEW { w: self } - } - #[doc = "Bit 3 - Enable for RX FIFO OVerrun interrupt."] - #[inline] - pub fn rx_overrun(&mut self) -> _RX_OVERRUNW { - _RX_OVERRUNW { w: self } - } - #[doc = "Bit 4 - Enable for interrupt when RX FIFO reaches the number of bytes configured by the RXTHD field."] - #[inline] - pub fn rx_fifo_thresh(&mut self) -> _RX_FIFO_THRESHW { - _RX_FIFO_THRESHW { w: self } - } - #[doc = "Bit 5 - Enable for interrupt when TX FIFO has only one byte remaining."] - #[inline] - pub fn tx_fifo_almost_empty(&mut self) -> _TX_FIFO_ALMOST_EMPTYW { - _TX_FIFO_ALMOST_EMPTYW { w: self } - } - #[doc = "Bit 6 - Enable for interrupt when TX FIFO reaches the number of bytes configured by the TXTHD field."] - #[inline] - pub fn tx_fifo_thresh(&mut self) -> _TX_FIFO_THRESHW { - _TX_FIFO_THRESHW { w: self } - } - #[doc = "Bit 7 - Enable for received BREAK character interrupt."] - #[inline] - pub fn break_(&mut self) -> _BREAKW { - _BREAKW { w: self } - } - #[doc = "Bit 8 - Enable for RX Timeout Interrupt. Trigger if there is no RX communication during n UART characters (n=UART_CN.RXTO)."] - #[inline] - pub fn rx_timeout(&mut self) -> _RX_TIMEOUTW { - _RX_TIMEOUTW { w: self } - } - #[doc = "Bit 9 - Enable for Last break character interrupt."] - #[inline] - pub fn last_break(&mut self) -> _LAST_BREAKW { - _LAST_BREAKW { w: self } - } - } - } - #[doc = "Interrupt Status Flags."] - pub struct INT_FL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Interrupt Status Flags."] - pub mod int_fl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::INT_FL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RX_FRAME_ERRORR { - bits: bool, - } - impl RX_FRAME_ERRORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_PARITY_ERRORR { - bits: bool, - } - impl RX_PARITY_ERRORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CTS_CHANGER { - bits: bool, - } - impl CTS_CHANGER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_OVERRUNR { - bits: bool, - } - impl RX_OVERRUNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_FIFO_THRESHR { - bits: bool, - } - impl RX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_ALMOST_EMPTYR { - bits: bool, - } - impl TX_FIFO_ALMOST_EMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TX_FIFO_THRESHR { - bits: bool, - } - impl TX_FIFO_THRESHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct BREAKR { - bits: bool, - } - impl BREAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RX_TIMEOUTR { - bits: bool, - } - impl RX_TIMEOUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct LAST_BREAKR { - bits: bool, - } - impl LAST_BREAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _RX_FRAME_ERRORW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FRAME_ERRORW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_PARITY_ERRORW<'a> { - w: &'a mut W, - } - impl<'a> _RX_PARITY_ERRORW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CTS_CHANGEW<'a> { - w: &'a mut W, - } - impl<'a> _CTS_CHANGEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_OVERRUNW<'a> { - w: &'a mut W, - } - impl<'a> _RX_OVERRUNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _RX_FIFO_THRESHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_ALMOST_EMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_ALMOST_EMPTYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TX_FIFO_THRESHW<'a> { - w: &'a mut W, - } - impl<'a> _TX_FIFO_THRESHW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _BREAKW<'a> { - w: &'a mut W, - } - impl<'a> _BREAKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RX_TIMEOUTW<'a> { - w: &'a mut W, - } - impl<'a> _RX_TIMEOUTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _LAST_BREAKW<'a> { - w: &'a mut W, - } - impl<'a> _LAST_BREAKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - FLAG for RX Frame Error Interrupt."] - #[inline] - pub fn rx_frame_error(&self) -> RX_FRAME_ERRORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FRAME_ERRORR { bits } - } - #[doc = "Bit 1 - FLAG for RX Parity Error interrupt."] - #[inline] - pub fn rx_parity_error(&self) -> RX_PARITY_ERRORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_PARITY_ERRORR { bits } - } - #[doc = "Bit 2 - FLAG for CTS signal change interrupt."] - #[inline] - pub fn cts_change(&self) -> CTS_CHANGER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - CTS_CHANGER { bits } - } - #[doc = "Bit 3 - FLAG for RX FIFO Overrun interrupt."] - #[inline] - pub fn rx_overrun(&self) -> RX_OVERRUNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_OVERRUNR { bits } - } - #[doc = "Bit 4 - FLAG for interrupt when RX FIFO reaches the number of bytes configured by the RXTHD field."] - #[inline] - pub fn rx_fifo_thresh(&self) -> RX_FIFO_THRESHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_FIFO_THRESHR { bits } - } - #[doc = "Bit 5 - FLAG for interrupt when TX FIFO has only one byte remaining."] - #[inline] - pub fn tx_fifo_almost_empty(&self) -> TX_FIFO_ALMOST_EMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FIFO_ALMOST_EMPTYR { bits } - } - #[doc = "Bit 6 - FLAG for interrupt when TX FIFO reaches the number of bytes configured by the TXTHD field."] - #[inline] - pub fn tx_fifo_thresh(&self) -> TX_FIFO_THRESHR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - TX_FIFO_THRESHR { bits } - } - #[doc = "Bit 7 - FLAG for received BREAK character interrupt."] - #[inline] - pub fn break_(&self) -> BREAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - BREAKR { bits } - } - #[doc = "Bit 8 - FLAG for RX Timeout Interrupt. Trigger if there is no RX communication during n UART characters (n=UART_CN.RXTO)."] - #[inline] - pub fn rx_timeout(&self) -> RX_TIMEOUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - RX_TIMEOUTR { bits } - } - #[doc = "Bit 9 - FLAG for Last break character interrupt."] - #[inline] - pub fn last_break(&self) -> LAST_BREAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - LAST_BREAKR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - FLAG for RX Frame Error Interrupt."] - #[inline] - pub fn rx_frame_error(&mut self) -> _RX_FRAME_ERRORW { - _RX_FRAME_ERRORW { w: self } - } - #[doc = "Bit 1 - FLAG for RX Parity Error interrupt."] - #[inline] - pub fn rx_parity_error(&mut self) -> _RX_PARITY_ERRORW { - _RX_PARITY_ERRORW { w: self } - } - #[doc = "Bit 2 - FLAG for CTS signal change interrupt."] - #[inline] - pub fn cts_change(&mut self) -> _CTS_CHANGEW { - _CTS_CHANGEW { w: self } - } - #[doc = "Bit 3 - FLAG for RX FIFO Overrun interrupt."] - #[inline] - pub fn rx_overrun(&mut self) -> _RX_OVERRUNW { - _RX_OVERRUNW { w: self } - } - #[doc = "Bit 4 - FLAG for interrupt when RX FIFO reaches the number of bytes configured by the RXTHD field."] - #[inline] - pub fn rx_fifo_thresh(&mut self) -> _RX_FIFO_THRESHW { - _RX_FIFO_THRESHW { w: self } - } - #[doc = "Bit 5 - FLAG for interrupt when TX FIFO has only one byte remaining."] - #[inline] - pub fn tx_fifo_almost_empty(&mut self) -> _TX_FIFO_ALMOST_EMPTYW { - _TX_FIFO_ALMOST_EMPTYW { w: self } - } - #[doc = "Bit 6 - FLAG for interrupt when TX FIFO reaches the number of bytes configured by the TXTHD field."] - #[inline] - pub fn tx_fifo_thresh(&mut self) -> _TX_FIFO_THRESHW { - _TX_FIFO_THRESHW { w: self } - } - #[doc = "Bit 7 - FLAG for received BREAK character interrupt."] - #[inline] - pub fn break_(&mut self) -> _BREAKW { - _BREAKW { w: self } - } - #[doc = "Bit 8 - FLAG for RX Timeout Interrupt. Trigger if there is no RX communication during n UART characters (n=UART_CN.RXTO)."] - #[inline] - pub fn rx_timeout(&mut self) -> _RX_TIMEOUTW { - _RX_TIMEOUTW { w: self } - } - #[doc = "Bit 9 - FLAG for Last break character interrupt."] - #[inline] - pub fn last_break(&mut self) -> _LAST_BREAKW { - _LAST_BREAKW { w: self } - } - } - } - #[doc = "Baud rate register. Integer portion."] - pub struct BAUD0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Baud rate register. Integer portion."] - pub mod baud0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BAUD0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct IBAUDR { - bits: u16, - } - impl IBAUDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = "Possible values of the field `FACTOR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FACTORR { - #[doc = "Baud Factor 128"] - _128, - #[doc = "Baud Factor 64"] - _64, - #[doc = "Baud Factor 32"] - _32, - #[doc = "Baud Factor 16"] - _16, - } - impl FACTORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - FACTORR::_128 => 0, - FACTORR::_64 => 0x01, - FACTORR::_32 => 0x02, - FACTORR::_16 => 0x03, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> FACTORR { - match value { - 0 => FACTORR::_128, - 1 => FACTORR::_64, - 2 => FACTORR::_32, - 3 => FACTORR::_16, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `_128`"] - #[inline] - pub fn is_128(&self) -> bool { - *self == FACTORR::_128 - } - #[doc = "Checks if the value of the field is `_64`"] - #[inline] - pub fn is_64(&self) -> bool { - *self == FACTORR::_64 - } - #[doc = "Checks if the value of the field is `_32`"] - #[inline] - pub fn is_32(&self) -> bool { - *self == FACTORR::_32 - } - #[doc = "Checks if the value of the field is `_16`"] - #[inline] - pub fn is_16(&self) -> bool { - *self == FACTORR::_16 - } - } - #[doc = r" Proxy"] - pub struct _IBAUDW<'a> { - w: &'a mut W, - } - impl<'a> _IBAUDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FACTOR`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FACTORW { - #[doc = "Baud Factor 128"] - _128, - #[doc = "Baud Factor 64"] - _64, - #[doc = "Baud Factor 32"] - _32, - #[doc = "Baud Factor 16"] - _16, - } - impl FACTORW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - FACTORW::_128 => 0, - FACTORW::_64 => 1, - FACTORW::_32 => 2, - FACTORW::_16 => 3, - } - } - } - #[doc = r" Proxy"] - pub struct _FACTORW<'a> { - w: &'a mut W, - } - impl<'a> _FACTORW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FACTORW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "Baud Factor 128"] - #[inline] - pub fn _128(self) -> &'a mut W { - self.variant(FACTORW::_128) - } - #[doc = "Baud Factor 64"] - #[inline] - pub fn _64(self) -> &'a mut W { - self.variant(FACTORW::_64) - } - #[doc = "Baud Factor 32"] - #[inline] - pub fn _32(self) -> &'a mut W { - self.variant(FACTORW::_32) - } - #[doc = "Baud Factor 16"] - #[inline] - pub fn _16(self) -> &'a mut W { - self.variant(FACTORW::_16) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:11 - Integer portion of baud rate divisor value. IBAUD = InputClock / (factor * Baud Rate Frequency)."] - #[inline] - pub fn ibaud(&self) -> IBAUDR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - IBAUDR { bits } - } - #[doc = "Bits 16:17 - FACTOR must be chosen to have IDIV>0. factor used in calculation = 128 >> FACTOR."] - #[inline] - pub fn factor(&self) -> FACTORR { - FACTORR::_from({ - const MASK: u8 = 0x03; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:11 - Integer portion of baud rate divisor value. IBAUD = InputClock / (factor * Baud Rate Frequency)."] - #[inline] - pub fn ibaud(&mut self) -> _IBAUDW { - _IBAUDW { w: self } - } - #[doc = "Bits 16:17 - FACTOR must be chosen to have IDIV>0. factor used in calculation = 128 >> FACTOR."] - #[inline] - pub fn factor(&mut self) -> _FACTORW { - _FACTORW { w: self } - } - } - } - #[doc = "Baud rate register. Decimal Setting."] - pub struct BAUD1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Baud rate register. Decimal Setting."] - pub mod baud1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::BAUD1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DBAUDR { - bits: u16, - } - impl DBAUDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DBAUDW<'a> { - w: &'a mut W, - } - impl<'a> _DBAUDW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:11 - Decimal portion of baud rate divisor value. DIV = InputClock/(factor*Baud Rate Frequency). DDIV=(DIV-IDIV)*128."] - #[inline] - pub fn dbaud(&self) -> DBAUDR { - let bits = { - const MASK: u16 = 0x0fff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u16 - }; - DBAUDR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:11 - Decimal portion of baud rate divisor value. DIV = InputClock/(factor*Baud Rate Frequency). DDIV=(DIV-IDIV)*128."] - #[inline] - pub fn dbaud(&mut self) -> _DBAUDW { - _DBAUDW { w: self } - } - } - } - #[doc = "FIFO Data buffer."] - pub struct FIFO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "FIFO Data buffer."] - pub mod fifo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct FIFOR { - bits: u8, - } - impl FIFOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _FIFOW<'a> { - w: &'a mut W, - } - impl<'a> _FIFOW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:7 - Load/unload location for TX and RX FIFO buffers."] - #[inline] - pub fn fifo(&self) -> FIFOR { - let bits = { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - FIFOR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Load/unload location for TX and RX FIFO buffers."] - #[inline] - pub fn fifo(&mut self) -> _FIFOW { - _FIFOW { w: self } - } - } - } - #[doc = "DMA Configuration."] - pub struct DMA { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "DMA Configuration."] - pub mod dma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::DMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `TDMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TDMA_ENR { - #[doc = "DMA is disabled "] - DIS, - #[doc = "DMA is enabled "] - EN, - } - impl TDMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - TDMA_ENR::DIS => false, - TDMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> TDMA_ENR { - match value { - false => TDMA_ENR::DIS, - true => TDMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == TDMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == TDMA_ENR::EN - } - } - #[doc = "Possible values of the field `RXDMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RXDMA_ENR { - #[doc = "DMA is disabled "] - DIS, - #[doc = "DMA is enabled "] - EN, - } - impl RXDMA_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RXDMA_ENR::DIS => false, - RXDMA_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RXDMA_ENR { - match value { - false => RXDMA_ENR::DIS, - true => RXDMA_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RXDMA_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RXDMA_ENR::EN - } - } - #[doc = r" Value of the field"] - pub struct TXDMA_LEVELR { - bits: u8, - } - impl TXDMA_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RXDMA_LEVELR { - bits: u8, - } - impl RXDMA_LEVELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = "Values that can be written to the field `TDMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum TDMA_ENW { - #[doc = "DMA is disabled "] - DIS, - #[doc = "DMA is enabled "] - EN, - } - impl TDMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - TDMA_ENW::DIS => false, - TDMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _TDMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _TDMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: TDMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "DMA is disabled"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(TDMA_ENW::DIS) - } - #[doc = "DMA is enabled"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(TDMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RXDMA_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RXDMA_ENW { - #[doc = "DMA is disabled "] - DIS, - #[doc = "DMA is enabled "] - EN, - } - impl RXDMA_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RXDMA_ENW::DIS => false, - RXDMA_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RXDMA_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RXDMA_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RXDMA_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "DMA is disabled"] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RXDMA_ENW::DIS) - } - #[doc = "DMA is enabled"] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RXDMA_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TXDMA_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _TXDMA_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RXDMA_LEVELW<'a> { - w: &'a mut W, - } - impl<'a> _RXDMA_LEVELW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - TX DMA channel enable."] - #[inline] - pub fn tdma_en(&self) -> TDMA_ENR { - TDMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 1 - RX DMA channel enable."] - #[inline] - pub fn rxdma_en(&self) -> RXDMA_ENR { - RXDMA_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bits 8:13 - TX threshold for DMA transmission."] - #[inline] - pub fn txdma_level(&self) -> TXDMA_LEVELR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - TXDMA_LEVELR { bits } - } - #[doc = "Bits 16:21 - RX threshold for DMA transmission."] - #[inline] - pub fn rxdma_level(&self) -> RXDMA_LEVELR { - let bits = { - const MASK: u8 = 0x3f; - const OFFSET: u8 = 16; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - RXDMA_LEVELR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - TX DMA channel enable."] - #[inline] - pub fn tdma_en(&mut self) -> _TDMA_ENW { - _TDMA_ENW { w: self } - } - #[doc = "Bit 1 - RX DMA channel enable."] - #[inline] - pub fn rxdma_en(&mut self) -> _RXDMA_ENW { - _RXDMA_ENW { w: self } - } - #[doc = "Bits 8:13 - TX threshold for DMA transmission."] - #[inline] - pub fn txdma_level(&mut self) -> _TXDMA_LEVELW { - _TXDMA_LEVELW { w: self } - } - #[doc = "Bits 16:21 - RX threshold for DMA transmission."] - #[inline] - pub fn rxdma_level(&mut self) -> _RXDMA_LEVELW { - _RXDMA_LEVELW { w: self } - } - } - } - #[doc = "Transmit FIFO Status register."] - pub struct TX_FIFO { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Transmit FIFO Status register."] - pub mod tx_fifo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::TX_FIFO { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct DATAR { - bits: u8, - } - impl DATAR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _DATAW<'a> { - w: &'a mut W, - } - impl<'a> _DATAW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:6 - Reading from this field returns the next character available at the output of the TX FIFO (if one is available, otherwise 00h is returned)."] - #[inline] - pub fn data(&self) -> DATAR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }; - DATAR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Reading from this field returns the next character available at the output of the TX FIFO (if one is available, otherwise 00h is returned)."] - #[inline] - pub fn data(&mut self) -> _DATAW { - _DATAW { w: self } - } - } - } -} -#[doc = "UART 1"] -pub struct UART1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for UART1 {} -impl UART1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const uart0::RegisterBlock { - 0x4004_3000 as *const _ - } -} -impl Deref for UART1 { - type Target = uart0::RegisterBlock; - fn deref(&self) -> &uart0::RegisterBlock { - unsafe { &*UART1::ptr() } - } -} -#[doc = "UART 2"] -pub struct UART2 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for UART2 {} -impl UART2 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const uart0::RegisterBlock { - 0x4004_4000 as *const _ - } -} -impl Deref for UART2 { - type Target = uart0::RegisterBlock; - fn deref(&self) -> &uart0::RegisterBlock { - unsafe { &*UART2::ptr() } - } -} -#[doc = "USB 2.0 High-speed Controller."] -pub struct USBHS { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for USBHS {} -impl USBHS { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const usbhs::RegisterBlock { - 0x400b_1000 as *const _ - } -} -impl Deref for USBHS { - type Target = usbhs::RegisterBlock; - fn deref(&self) -> &usbhs::RegisterBlock { - unsafe { &*USBHS::ptr() } - } -} -#[doc = "USB 2.0 High-speed Controller."] -pub mod usbhs { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Function address register."] - pub faddr: FADDR, - #[doc = "0x01 - Power management register."] - pub power: POWER, - #[doc = "0x02 - Interrupt register for EP0 and IN EP1-15."] - pub intrin: INTRIN, - #[doc = "0x04 - Interrupt register for OUT EP 1-15."] - pub introut: INTROUT, - #[doc = "0x06 - Interrupt enable for EP 0 and IN EP 1-15."] - pub intrinen: INTRINEN, - #[doc = "0x08 - Interrupt enable for OUT EP 1-15."] - pub introuten: INTROUTEN, - #[doc = "0x0a - Interrupt register for common USB interrupts."] - pub intrusb: INTRUSB, - #[doc = "0x0b - Interrupt enable for common USB interrupts."] - pub intrusben: INTRUSBEN, - #[doc = "0x0c - Frame number."] - pub frame: FRAME, - #[doc = "0x0e - Index for banked registers."] - pub index: INDEX, - #[doc = "0x0f - USB 2.0 test mode enable register."] - pub testmode: TESTMODE, - #[doc = "0x10 - Maximum packet size for INx endpoint (x == INDEX)."] - pub inmaxp: INMAXP, - #[doc = "0x12 - Control status register for EP 0 (when INDEX == 0)."] - pub csr0: CSR0, - #[doc = "0x13 - Control status upper register for INx endpoint (x == INDEX)."] - pub incsru: INCSRU, - #[doc = "0x14 - Maximum packet size for OUTx endpoint (x == INDEX)."] - pub outmaxp: OUTMAXP, - #[doc = "0x16 - Control status lower register for OUTx endpoint (x == INDEX)."] - pub outcsrl: OUTCSRL, - #[doc = "0x17 - Control status upper register for OUTx endpoint (x == INDEX)."] - pub outcsru: OUTCSRU, - #[doc = "0x18 - Number of received bytes in EP 0 FIFO (INDEX == 0)."] - pub count0: COUNT0, - _reserved0: [u8; 6usize], - #[doc = "0x20 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo0: FIFO0, - #[doc = "0x24 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo1: FIFO1, - #[doc = "0x28 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo2: FIFO2, - #[doc = "0x2c - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo3: FIFO3, - #[doc = "0x30 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo4: FIFO4, - #[doc = "0x34 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo5: FIFO5, - #[doc = "0x38 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo6: FIFO6, - #[doc = "0x3c - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo7: FIFO7, - #[doc = "0x40 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo8: FIFO8, - #[doc = "0x44 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo9: FIFO9, - #[doc = "0x48 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo10: FIFO10, - #[doc = "0x4c - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo11: FIFO11, - #[doc = "0x50 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo12: FIFO12, - #[doc = "0x54 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo13: FIFO13, - #[doc = "0x58 - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo14: FIFO14, - #[doc = "0x5c - Read for OUT data FIFO, write for IN data FIFO."] - pub fifo15: FIFO15, - _reserved1: [u8; 12usize], - #[doc = "0x6c - HWVERS"] - pub hwvers: HWVERS, - _reserved2: [u8; 10usize], - #[doc = "0x78 - Endpoint hardware information."] - pub epinfo: EPINFO, - #[doc = "0x79 - RAM width and DMA hardware information."] - pub raminfo: RAMINFO, - #[doc = "0x7a - Software reset register."] - pub softreset: SOFTRESET, - #[doc = "0x7b - DMA timing control register."] - pub earlydma: EARLYDMA, - _reserved3: [u8; 4usize], - #[doc = "0x80 - Chirp timeout timer setting."] - pub ctuch: CTUCH, - #[doc = "0x82 - Sets delay between HS resume to UTM normal operating mode."] - pub cthsrtn: CTHSRTN, - _reserved4: [u8; 908usize], - #[doc = "0x410 - M31_PHY_PONRST"] - pub m31_phy_ponrst: M31_PHY_PONRST, - #[doc = "0x414 - M31_PHY_NONCRY_RSTB"] - pub m31_phy_noncry_rstb: M31_PHY_NONCRY_RSTB, - #[doc = "0x418 - M31_PHY_NONCRY_EN"] - pub m31_phy_noncry_en: M31_PHY_NONCRY_EN, - _reserved5: [u8; 20usize], - #[doc = "0x430 - M31_PHY_PLL_EN"] - pub m31_phy_pll_en: M31_PHY_PLL_EN, - _reserved6: [u8; 8usize], - #[doc = "0x43c - M31_PHY_OSCOUTEN"] - pub m31_phy_oscouten: M31_PHY_OSCOUTEN, - _reserved7: [u8; 8usize], - #[doc = "0x448 - M31_PHY_CORECLKIN"] - pub m31_phy_coreclkin: M31_PHY_CORECLKIN, - #[doc = "0x44c - M31_PHY_XTLSEL"] - pub m31_phy_xtlsel: M31_PHY_XTLSEL, - _reserved8: [u8; 12usize], - #[doc = "0x45c - M31_PHY_OUTCLKSEL"] - pub m31_phy_outclksel: M31_PHY_OUTCLKSEL, - _reserved9: [u8; 56usize], - #[doc = "0x498 - USB Added Maxim Interrupt Flag Register."] - pub mxm_int: MXM_INT, - #[doc = "0x49c - USB Added Maxim Interrupt Enable Register."] - pub mxm_int_en: MXM_INT_EN, - #[doc = "0x4a0 - USB Added Maxim Suspend Register."] - pub mxm_suspend: MXM_SUSPEND, - #[doc = "0x4a4 - USB Added Maxim Power Status Register"] - pub mxm_reg_a4: MXM_REG_A4, - } - #[doc = "Function address register."] - pub struct FADDR { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Function address register."] - pub mod faddr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::FADDR { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct ADDRR { - bits: u8, - } - impl ADDRR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct UPDATER { - bits: bool, - } - impl UPDATER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _ADDRW<'a> { - w: &'a mut W, - } - impl<'a> _ADDRW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:6 - Function address for this controller."] - #[inline] - pub fn addr(&self) -> ADDRR { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - ADDRR { bits } - } - #[doc = "Bit 7 - Set when ADDR is written, cleared when new address takes effect."] - #[inline] - pub fn update(&self) -> UPDATER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - UPDATER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:6 - Function address for this controller."] - #[inline] - pub fn addr(&mut self) -> _ADDRW { - _ADDRW { w: self } - } - } - } - #[doc = "Power management register."] - pub struct POWER { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Power management register."] - pub mod power { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::POWER { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct EN_SUSPENDMR { - bits: bool, - } - impl EN_SUSPENDMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SUSPENDR { - bits: bool, - } - impl SUSPENDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESUMER { - bits: bool, - } - impl RESUMER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESETR { - bits: bool, - } - impl RESETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HS_MODER { - bits: bool, - } - impl HS_MODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct HS_ENABLER { - bits: bool, - } - impl HS_ENABLER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SOFTCONNR { - bits: bool, - } - impl SOFTCONNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ISO_UPDATER { - bits: bool, - } - impl ISO_UPDATER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _EN_SUSPENDMW<'a> { - w: &'a mut W, - } - impl<'a> _EN_SUSPENDMW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESUMEW<'a> { - w: &'a mut W, - } - impl<'a> _RESUMEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _HS_ENABLEW<'a> { - w: &'a mut W, - } - impl<'a> _HS_ENABLEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SOFTCONNW<'a> { - w: &'a mut W, - } - impl<'a> _SOFTCONNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ISO_UPDATEW<'a> { - w: &'a mut W, - } - impl<'a> _ISO_UPDATEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 0 - Enable SUSPENDM signal."] - #[inline] - pub fn en_suspendm(&self) -> EN_SUSPENDMR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - EN_SUSPENDMR { bits } - } - #[doc = "Bit 1 - Suspend mode detected."] - #[inline] - pub fn suspend(&self) -> SUSPENDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SUSPENDR { bits } - } - #[doc = "Bit 2 - Generate resume signaling."] - #[inline] - pub fn resume(&self) -> RESUMER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESUMER { bits } - } - #[doc = "Bit 3 - Bus reset detected."] - #[inline] - pub fn reset(&self) -> RESETR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESETR { bits } - } - #[doc = "Bit 4 - High-speed mode detected."] - #[inline] - pub fn hs_mode(&self) -> HS_MODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - HS_MODER { bits } - } - #[doc = "Bit 5 - High-speed mode enable."] - #[inline] - pub fn hs_enable(&self) -> HS_ENABLER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - HS_ENABLER { bits } - } - #[doc = "Bit 6 - Softconn."] - #[inline] - pub fn softconn(&self) -> SOFTCONNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SOFTCONNR { bits } - } - #[doc = "Bit 7 - Wait for SOF during Isochronous xfers."] - #[inline] - pub fn iso_update(&self) -> ISO_UPDATER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - ISO_UPDATER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Enable SUSPENDM signal."] - #[inline] - pub fn en_suspendm(&mut self) -> _EN_SUSPENDMW { - _EN_SUSPENDMW { w: self } - } - #[doc = "Bit 2 - Generate resume signaling."] - #[inline] - pub fn resume(&mut self) -> _RESUMEW { - _RESUMEW { w: self } - } - #[doc = "Bit 5 - High-speed mode enable."] - #[inline] - pub fn hs_enable(&mut self) -> _HS_ENABLEW { - _HS_ENABLEW { w: self } - } - #[doc = "Bit 6 - Softconn."] - #[inline] - pub fn softconn(&mut self) -> _SOFTCONNW { - _SOFTCONNW { w: self } - } - #[doc = "Bit 7 - Wait for SOF during Isochronous xfers."] - #[inline] - pub fn iso_update(&mut self) -> _ISO_UPDATEW { - _ISO_UPDATEW { w: self } - } - } - } - #[doc = "Interrupt register for EP0 and IN EP1-15."] - pub struct INTRIN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Interrupt register for EP0 and IN EP1-15."] - pub mod intrin { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::INTRIN { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct EP15_IN_INTR { - bits: bool, - } - impl EP15_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP14_IN_INTR { - bits: bool, - } - impl EP14_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP13_IN_INTR { - bits: bool, - } - impl EP13_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP12_IN_INTR { - bits: bool, - } - impl EP12_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP11_IN_INTR { - bits: bool, - } - impl EP11_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP10_IN_INTR { - bits: bool, - } - impl EP10_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP9_IN_INTR { - bits: bool, - } - impl EP9_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP8_IN_INTR { - bits: bool, - } - impl EP8_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP7_IN_INTR { - bits: bool, - } - impl EP7_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP6_IN_INTR { - bits: bool, - } - impl EP6_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP5_IN_INTR { - bits: bool, - } - impl EP5_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP4_IN_INTR { - bits: bool, - } - impl EP4_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP3_IN_INTR { - bits: bool, - } - impl EP3_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP2_IN_INTR { - bits: bool, - } - impl EP2_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP1_IN_INTR { - bits: bool, - } - impl EP1_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP0_IN_INTR { - bits: bool, - } - impl EP0_IN_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 15 - Endpoint 15 interrupt."] - #[inline] - pub fn ep15_in_int(&self) -> EP15_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP15_IN_INTR { bits } - } - #[doc = "Bit 14 - Endpoint 14 interrupt."] - #[inline] - pub fn ep14_in_int(&self) -> EP14_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP14_IN_INTR { bits } - } - #[doc = "Bit 13 - Endpoint 13 interrupt."] - #[inline] - pub fn ep13_in_int(&self) -> EP13_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP13_IN_INTR { bits } - } - #[doc = "Bit 12 - Endpoint 12 interrupt."] - #[inline] - pub fn ep12_in_int(&self) -> EP12_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP12_IN_INTR { bits } - } - #[doc = "Bit 11 - Endpoint 11 interrupt."] - #[inline] - pub fn ep11_in_int(&self) -> EP11_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP11_IN_INTR { bits } - } - #[doc = "Bit 10 - Endpoint 10 interrupt."] - #[inline] - pub fn ep10_in_int(&self) -> EP10_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP10_IN_INTR { bits } - } - #[doc = "Bit 9 - Endpoint 9 interrupt."] - #[inline] - pub fn ep9_in_int(&self) -> EP9_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP9_IN_INTR { bits } - } - #[doc = "Bit 8 - Endpoint 8 interrupt."] - #[inline] - pub fn ep8_in_int(&self) -> EP8_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP8_IN_INTR { bits } - } - #[doc = "Bit 7 - Endpoint 7 interrupt."] - #[inline] - pub fn ep7_in_int(&self) -> EP7_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP7_IN_INTR { bits } - } - #[doc = "Bit 6 - Endpoint 6 interrupt."] - #[inline] - pub fn ep6_in_int(&self) -> EP6_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP6_IN_INTR { bits } - } - #[doc = "Bit 5 - Endpoint 5 interrupt."] - #[inline] - pub fn ep5_in_int(&self) -> EP5_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP5_IN_INTR { bits } - } - #[doc = "Bit 4 - Endpoint 4 interrupt."] - #[inline] - pub fn ep4_in_int(&self) -> EP4_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP4_IN_INTR { bits } - } - #[doc = "Bit 3 - Endpoint 3 interrupt."] - #[inline] - pub fn ep3_in_int(&self) -> EP3_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP3_IN_INTR { bits } - } - #[doc = "Bit 2 - Endpoint 2 interrupt."] - #[inline] - pub fn ep2_in_int(&self) -> EP2_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP2_IN_INTR { bits } - } - #[doc = "Bit 1 - Endpoint 1 interrupt."] - #[inline] - pub fn ep1_in_int(&self) -> EP1_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP1_IN_INTR { bits } - } - #[doc = "Bit 0 - Endpoint 0 interrupt."] - #[inline] - pub fn ep0_in_int(&self) -> EP0_IN_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP0_IN_INTR { bits } - } - } - } - #[doc = "Interrupt register for OUT EP 1-15."] - pub struct INTROUT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Interrupt register for OUT EP 1-15."] - pub mod introut { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::INTROUT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct EP15_OUT_INTR { - bits: bool, - } - impl EP15_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP14_OUT_INTR { - bits: bool, - } - impl EP14_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP13_OUT_INTR { - bits: bool, - } - impl EP13_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP12_OUT_INTR { - bits: bool, - } - impl EP12_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP11_OUT_INTR { - bits: bool, - } - impl EP11_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP10_OUT_INTR { - bits: bool, - } - impl EP10_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP9_OUT_INTR { - bits: bool, - } - impl EP9_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP8_OUT_INTR { - bits: bool, - } - impl EP8_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP7_OUT_INTR { - bits: bool, - } - impl EP7_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP6_OUT_INTR { - bits: bool, - } - impl EP6_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP5_OUT_INTR { - bits: bool, - } - impl EP5_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP4_OUT_INTR { - bits: bool, - } - impl EP4_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP3_OUT_INTR { - bits: bool, - } - impl EP3_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP2_OUT_INTR { - bits: bool, - } - impl EP2_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP1_OUT_INTR { - bits: bool, - } - impl EP1_OUT_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 15 - Endpoint 15 interrupt."] - #[inline] - pub fn ep15_out_int(&self) -> EP15_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP15_OUT_INTR { bits } - } - #[doc = "Bit 14 - Endpoint 14 interrupt."] - #[inline] - pub fn ep14_out_int(&self) -> EP14_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP14_OUT_INTR { bits } - } - #[doc = "Bit 13 - Endpoint 13 interrupt."] - #[inline] - pub fn ep13_out_int(&self) -> EP13_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP13_OUT_INTR { bits } - } - #[doc = "Bit 12 - Endpoint 12 interrupt."] - #[inline] - pub fn ep12_out_int(&self) -> EP12_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP12_OUT_INTR { bits } - } - #[doc = "Bit 11 - Endpoint 11 interrupt."] - #[inline] - pub fn ep11_out_int(&self) -> EP11_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP11_OUT_INTR { bits } - } - #[doc = "Bit 10 - Endpoint 10 interrupt."] - #[inline] - pub fn ep10_out_int(&self) -> EP10_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP10_OUT_INTR { bits } - } - #[doc = "Bit 9 - Endpoint 9 interrupt."] - #[inline] - pub fn ep9_out_int(&self) -> EP9_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP9_OUT_INTR { bits } - } - #[doc = "Bit 8 - Endpoint 8 interrupt."] - #[inline] - pub fn ep8_out_int(&self) -> EP8_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP8_OUT_INTR { bits } - } - #[doc = "Bit 7 - Endpoint 7 interrupt."] - #[inline] - pub fn ep7_out_int(&self) -> EP7_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP7_OUT_INTR { bits } - } - #[doc = "Bit 6 - Endpoint 6 interrupt."] - #[inline] - pub fn ep6_out_int(&self) -> EP6_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP6_OUT_INTR { bits } - } - #[doc = "Bit 5 - Endpoint 5 interrupt."] - #[inline] - pub fn ep5_out_int(&self) -> EP5_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP5_OUT_INTR { bits } - } - #[doc = "Bit 4 - Endpoint 4 interrupt."] - #[inline] - pub fn ep4_out_int(&self) -> EP4_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP4_OUT_INTR { bits } - } - #[doc = "Bit 3 - Endpoint 3 interrupt."] - #[inline] - pub fn ep3_out_int(&self) -> EP3_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP3_OUT_INTR { bits } - } - #[doc = "Bit 2 - Endpoint 2 interrupt."] - #[inline] - pub fn ep2_out_int(&self) -> EP2_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP2_OUT_INTR { bits } - } - #[doc = "Bit 1 - Endpoint 1 interrupt."] - #[inline] - pub fn ep1_out_int(&self) -> EP1_OUT_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP1_OUT_INTR { bits } - } - } - } - #[doc = "Interrupt enable for EP 0 and IN EP 1-15."] - pub struct INTRINEN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Interrupt enable for EP 0 and IN EP 1-15."] - pub mod intrinen { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INTRINEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct EP15_IN_INT_ENR { - bits: bool, - } - impl EP15_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP14_IN_INT_ENR { - bits: bool, - } - impl EP14_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP13_IN_INT_ENR { - bits: bool, - } - impl EP13_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP12_IN_INT_ENR { - bits: bool, - } - impl EP12_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP11_IN_INT_ENR { - bits: bool, - } - impl EP11_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP10_IN_INT_ENR { - bits: bool, - } - impl EP10_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP9_IN_INT_ENR { - bits: bool, - } - impl EP9_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP8_IN_INT_ENR { - bits: bool, - } - impl EP8_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP7_IN_INT_ENR { - bits: bool, - } - impl EP7_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP6_IN_INT_ENR { - bits: bool, - } - impl EP6_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP5_IN_INT_ENR { - bits: bool, - } - impl EP5_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP4_IN_INT_ENR { - bits: bool, - } - impl EP4_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP3_IN_INT_ENR { - bits: bool, - } - impl EP3_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP2_IN_INT_ENR { - bits: bool, - } - impl EP2_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP1_IN_INT_ENR { - bits: bool, - } - impl EP1_IN_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP0_INT_ENR { - bits: bool, - } - impl EP0_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _EP15_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP15_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP14_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP14_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP13_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP13_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP12_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP12_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP11_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP11_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP10_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP10_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP9_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP9_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP8_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP8_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP7_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP7_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP6_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP6_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP5_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP5_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP4_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP4_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP3_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP3_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP2_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP2_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP1_IN_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP1_IN_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP0_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP0_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 15 - Endpoint 15 interrupt enable."] - #[inline] - pub fn ep15_in_int_en(&self) -> EP15_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP15_IN_INT_ENR { bits } - } - #[doc = "Bit 14 - Endpoint 14 interrupt enable."] - #[inline] - pub fn ep14_in_int_en(&self) -> EP14_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP14_IN_INT_ENR { bits } - } - #[doc = "Bit 13 - Endpoint 13 interrupt enable."] - #[inline] - pub fn ep13_in_int_en(&self) -> EP13_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP13_IN_INT_ENR { bits } - } - #[doc = "Bit 12 - Endpoint 12 interrupt enable."] - #[inline] - pub fn ep12_in_int_en(&self) -> EP12_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP12_IN_INT_ENR { bits } - } - #[doc = "Bit 11 - Endpoint 11 interrupt enable."] - #[inline] - pub fn ep11_in_int_en(&self) -> EP11_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP11_IN_INT_ENR { bits } - } - #[doc = "Bit 10 - Endpoint 10 interrupt enable."] - #[inline] - pub fn ep10_in_int_en(&self) -> EP10_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP10_IN_INT_ENR { bits } - } - #[doc = "Bit 9 - Endpoint 9 interrupt enable."] - #[inline] - pub fn ep9_in_int_en(&self) -> EP9_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP9_IN_INT_ENR { bits } - } - #[doc = "Bit 8 - Endpoint 8 interrupt enable."] - #[inline] - pub fn ep8_in_int_en(&self) -> EP8_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP8_IN_INT_ENR { bits } - } - #[doc = "Bit 7 - Endpoint 7 interrupt enable."] - #[inline] - pub fn ep7_in_int_en(&self) -> EP7_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP7_IN_INT_ENR { bits } - } - #[doc = "Bit 6 - Endpoint 6 interrupt enable."] - #[inline] - pub fn ep6_in_int_en(&self) -> EP6_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP6_IN_INT_ENR { bits } - } - #[doc = "Bit 5 - Endpoint 5 interrupt enable."] - #[inline] - pub fn ep5_in_int_en(&self) -> EP5_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP5_IN_INT_ENR { bits } - } - #[doc = "Bit 4 - Endpoint 4 interrupt enable."] - #[inline] - pub fn ep4_in_int_en(&self) -> EP4_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP4_IN_INT_ENR { bits } - } - #[doc = "Bit 3 - Endpoint 3 interrupt enable."] - #[inline] - pub fn ep3_in_int_en(&self) -> EP3_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP3_IN_INT_ENR { bits } - } - #[doc = "Bit 2 - Endpoint 2 interrupt enable."] - #[inline] - pub fn ep2_in_int_en(&self) -> EP2_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP2_IN_INT_ENR { bits } - } - #[doc = "Bit 1 - Endpoint 1 interrupt enable."] - #[inline] - pub fn ep1_in_int_en(&self) -> EP1_IN_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP1_IN_INT_ENR { bits } - } - #[doc = "Bit 0 - Endpoint 0 interrupt enable."] - #[inline] - pub fn ep0_int_en(&self) -> EP0_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP0_INT_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 15 - Endpoint 15 interrupt enable."] - #[inline] - pub fn ep15_in_int_en(&mut self) -> _EP15_IN_INT_ENW { - _EP15_IN_INT_ENW { w: self } - } - #[doc = "Bit 14 - Endpoint 14 interrupt enable."] - #[inline] - pub fn ep14_in_int_en(&mut self) -> _EP14_IN_INT_ENW { - _EP14_IN_INT_ENW { w: self } - } - #[doc = "Bit 13 - Endpoint 13 interrupt enable."] - #[inline] - pub fn ep13_in_int_en(&mut self) -> _EP13_IN_INT_ENW { - _EP13_IN_INT_ENW { w: self } - } - #[doc = "Bit 12 - Endpoint 12 interrupt enable."] - #[inline] - pub fn ep12_in_int_en(&mut self) -> _EP12_IN_INT_ENW { - _EP12_IN_INT_ENW { w: self } - } - #[doc = "Bit 11 - Endpoint 11 interrupt enable."] - #[inline] - pub fn ep11_in_int_en(&mut self) -> _EP11_IN_INT_ENW { - _EP11_IN_INT_ENW { w: self } - } - #[doc = "Bit 10 - Endpoint 10 interrupt enable."] - #[inline] - pub fn ep10_in_int_en(&mut self) -> _EP10_IN_INT_ENW { - _EP10_IN_INT_ENW { w: self } - } - #[doc = "Bit 9 - Endpoint 9 interrupt enable."] - #[inline] - pub fn ep9_in_int_en(&mut self) -> _EP9_IN_INT_ENW { - _EP9_IN_INT_ENW { w: self } - } - #[doc = "Bit 8 - Endpoint 8 interrupt enable."] - #[inline] - pub fn ep8_in_int_en(&mut self) -> _EP8_IN_INT_ENW { - _EP8_IN_INT_ENW { w: self } - } - #[doc = "Bit 7 - Endpoint 7 interrupt enable."] - #[inline] - pub fn ep7_in_int_en(&mut self) -> _EP7_IN_INT_ENW { - _EP7_IN_INT_ENW { w: self } - } - #[doc = "Bit 6 - Endpoint 6 interrupt enable."] - #[inline] - pub fn ep6_in_int_en(&mut self) -> _EP6_IN_INT_ENW { - _EP6_IN_INT_ENW { w: self } - } - #[doc = "Bit 5 - Endpoint 5 interrupt enable."] - #[inline] - pub fn ep5_in_int_en(&mut self) -> _EP5_IN_INT_ENW { - _EP5_IN_INT_ENW { w: self } - } - #[doc = "Bit 4 - Endpoint 4 interrupt enable."] - #[inline] - pub fn ep4_in_int_en(&mut self) -> _EP4_IN_INT_ENW { - _EP4_IN_INT_ENW { w: self } - } - #[doc = "Bit 3 - Endpoint 3 interrupt enable."] - #[inline] - pub fn ep3_in_int_en(&mut self) -> _EP3_IN_INT_ENW { - _EP3_IN_INT_ENW { w: self } - } - #[doc = "Bit 2 - Endpoint 2 interrupt enable."] - #[inline] - pub fn ep2_in_int_en(&mut self) -> _EP2_IN_INT_ENW { - _EP2_IN_INT_ENW { w: self } - } - #[doc = "Bit 1 - Endpoint 1 interrupt enable."] - #[inline] - pub fn ep1_in_int_en(&mut self) -> _EP1_IN_INT_ENW { - _EP1_IN_INT_ENW { w: self } - } - #[doc = "Bit 0 - Endpoint 0 interrupt enable."] - #[inline] - pub fn ep0_int_en(&mut self) -> _EP0_INT_ENW { - _EP0_INT_ENW { w: self } - } - } - } - #[doc = "Interrupt enable for OUT EP 1-15."] - pub struct INTROUTEN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Interrupt enable for OUT EP 1-15."] - pub mod introuten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INTROUTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct EP15_OUT_INT_ENR { - bits: bool, - } - impl EP15_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP14_OUT_INT_ENR { - bits: bool, - } - impl EP14_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP13_OUT_INT_ENR { - bits: bool, - } - impl EP13_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP12_OUT_INT_ENR { - bits: bool, - } - impl EP12_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP11_OUT_INT_ENR { - bits: bool, - } - impl EP11_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP10_OUT_INT_ENR { - bits: bool, - } - impl EP10_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP9_OUT_INT_ENR { - bits: bool, - } - impl EP9_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP8_OUT_INT_ENR { - bits: bool, - } - impl EP8_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP7_OUT_INT_ENR { - bits: bool, - } - impl EP7_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP6_OUT_INT_ENR { - bits: bool, - } - impl EP6_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP5_OUT_INT_ENR { - bits: bool, - } - impl EP5_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP4_OUT_INT_ENR { - bits: bool, - } - impl EP4_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP3_OUT_INT_ENR { - bits: bool, - } - impl EP3_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP2_OUT_INT_ENR { - bits: bool, - } - impl EP2_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EP1_OUT_INT_ENR { - bits: bool, - } - impl EP1_OUT_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _EP15_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP15_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 15; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP14_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP14_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 14; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP13_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP13_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 13; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP12_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP12_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 12; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP11_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP11_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP10_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP10_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP9_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP9_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP8_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP8_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP7_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP7_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP6_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP6_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP5_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP5_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP4_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP4_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP3_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP3_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP2_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP2_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EP1_OUT_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _EP1_OUT_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bit 15 - Endpoint 15 interrupt."] - #[inline] - pub fn ep15_out_int_en(&self) -> EP15_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 15; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP15_OUT_INT_ENR { bits } - } - #[doc = "Bit 14 - Endpoint 14 interrupt."] - #[inline] - pub fn ep14_out_int_en(&self) -> EP14_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 14; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP14_OUT_INT_ENR { bits } - } - #[doc = "Bit 13 - Endpoint 13 interrupt."] - #[inline] - pub fn ep13_out_int_en(&self) -> EP13_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 13; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP13_OUT_INT_ENR { bits } - } - #[doc = "Bit 12 - Endpoint 12 interrupt."] - #[inline] - pub fn ep12_out_int_en(&self) -> EP12_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 12; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP12_OUT_INT_ENR { bits } - } - #[doc = "Bit 11 - Endpoint 11 interrupt."] - #[inline] - pub fn ep11_out_int_en(&self) -> EP11_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP11_OUT_INT_ENR { bits } - } - #[doc = "Bit 10 - Endpoint 10 interrupt."] - #[inline] - pub fn ep10_out_int_en(&self) -> EP10_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP10_OUT_INT_ENR { bits } - } - #[doc = "Bit 9 - Endpoint 9 interrupt."] - #[inline] - pub fn ep9_out_int_en(&self) -> EP9_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP9_OUT_INT_ENR { bits } - } - #[doc = "Bit 8 - Endpoint 8 interrupt."] - #[inline] - pub fn ep8_out_int_en(&self) -> EP8_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP8_OUT_INT_ENR { bits } - } - #[doc = "Bit 7 - Endpoint 7 interrupt."] - #[inline] - pub fn ep7_out_int_en(&self) -> EP7_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP7_OUT_INT_ENR { bits } - } - #[doc = "Bit 6 - Endpoint 6 interrupt."] - #[inline] - pub fn ep6_out_int_en(&self) -> EP6_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP6_OUT_INT_ENR { bits } - } - #[doc = "Bit 5 - Endpoint 5 interrupt."] - #[inline] - pub fn ep5_out_int_en(&self) -> EP5_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP5_OUT_INT_ENR { bits } - } - #[doc = "Bit 4 - Endpoint 4 interrupt."] - #[inline] - pub fn ep4_out_int_en(&self) -> EP4_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP4_OUT_INT_ENR { bits } - } - #[doc = "Bit 3 - Endpoint 3 interrupt."] - #[inline] - pub fn ep3_out_int_en(&self) -> EP3_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP3_OUT_INT_ENR { bits } - } - #[doc = "Bit 2 - Endpoint 2 interrupt."] - #[inline] - pub fn ep2_out_int_en(&self) -> EP2_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP2_OUT_INT_ENR { bits } - } - #[doc = "Bit 1 - Endpoint 1 interrupt."] - #[inline] - pub fn ep1_out_int_en(&self) -> EP1_OUT_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u16) != 0 - }; - EP1_OUT_INT_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 15 - Endpoint 15 interrupt."] - #[inline] - pub fn ep15_out_int_en(&mut self) -> _EP15_OUT_INT_ENW { - _EP15_OUT_INT_ENW { w: self } - } - #[doc = "Bit 14 - Endpoint 14 interrupt."] - #[inline] - pub fn ep14_out_int_en(&mut self) -> _EP14_OUT_INT_ENW { - _EP14_OUT_INT_ENW { w: self } - } - #[doc = "Bit 13 - Endpoint 13 interrupt."] - #[inline] - pub fn ep13_out_int_en(&mut self) -> _EP13_OUT_INT_ENW { - _EP13_OUT_INT_ENW { w: self } - } - #[doc = "Bit 12 - Endpoint 12 interrupt."] - #[inline] - pub fn ep12_out_int_en(&mut self) -> _EP12_OUT_INT_ENW { - _EP12_OUT_INT_ENW { w: self } - } - #[doc = "Bit 11 - Endpoint 11 interrupt."] - #[inline] - pub fn ep11_out_int_en(&mut self) -> _EP11_OUT_INT_ENW { - _EP11_OUT_INT_ENW { w: self } - } - #[doc = "Bit 10 - Endpoint 10 interrupt."] - #[inline] - pub fn ep10_out_int_en(&mut self) -> _EP10_OUT_INT_ENW { - _EP10_OUT_INT_ENW { w: self } - } - #[doc = "Bit 9 - Endpoint 9 interrupt."] - #[inline] - pub fn ep9_out_int_en(&mut self) -> _EP9_OUT_INT_ENW { - _EP9_OUT_INT_ENW { w: self } - } - #[doc = "Bit 8 - Endpoint 8 interrupt."] - #[inline] - pub fn ep8_out_int_en(&mut self) -> _EP8_OUT_INT_ENW { - _EP8_OUT_INT_ENW { w: self } - } - #[doc = "Bit 7 - Endpoint 7 interrupt."] - #[inline] - pub fn ep7_out_int_en(&mut self) -> _EP7_OUT_INT_ENW { - _EP7_OUT_INT_ENW { w: self } - } - #[doc = "Bit 6 - Endpoint 6 interrupt."] - #[inline] - pub fn ep6_out_int_en(&mut self) -> _EP6_OUT_INT_ENW { - _EP6_OUT_INT_ENW { w: self } - } - #[doc = "Bit 5 - Endpoint 5 interrupt."] - #[inline] - pub fn ep5_out_int_en(&mut self) -> _EP5_OUT_INT_ENW { - _EP5_OUT_INT_ENW { w: self } - } - #[doc = "Bit 4 - Endpoint 4 interrupt."] - #[inline] - pub fn ep4_out_int_en(&mut self) -> _EP4_OUT_INT_ENW { - _EP4_OUT_INT_ENW { w: self } - } - #[doc = "Bit 3 - Endpoint 3 interrupt."] - #[inline] - pub fn ep3_out_int_en(&mut self) -> _EP3_OUT_INT_ENW { - _EP3_OUT_INT_ENW { w: self } - } - #[doc = "Bit 2 - Endpoint 2 interrupt."] - #[inline] - pub fn ep2_out_int_en(&mut self) -> _EP2_OUT_INT_ENW { - _EP2_OUT_INT_ENW { w: self } - } - #[doc = "Bit 1 - Endpoint 1 interrupt."] - #[inline] - pub fn ep1_out_int_en(&mut self) -> _EP1_OUT_INT_ENW { - _EP1_OUT_INT_ENW { w: self } - } - } - } - #[doc = "Interrupt register for common USB interrupts."] - pub struct INTRUSB { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Interrupt register for common USB interrupts."] - pub mod intrusb { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - impl super::INTRUSB { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct SOF_INTR { - bits: bool, - } - impl SOF_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESET_INTR { - bits: bool, - } - impl RESET_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESUME_INTR { - bits: bool, - } - impl RESUME_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SUSPEND_INTR { - bits: bool, - } - impl SUSPEND_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 3 - Start of Frame."] - #[inline] - pub fn sof_int(&self) -> SOF_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SOF_INTR { bits } - } - #[doc = "Bit 2 - Bus reset detected."] - #[inline] - pub fn reset_int(&self) -> RESET_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESET_INTR { bits } - } - #[doc = "Bit 1 - Resume detected."] - #[inline] - pub fn resume_int(&self) -> RESUME_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESUME_INTR { bits } - } - #[doc = "Bit 0 - Suspend detected."] - #[inline] - pub fn suspend_int(&self) -> SUSPEND_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SUSPEND_INTR { bits } - } - } - } - #[doc = "Interrupt enable for common USB interrupts."] - pub struct INTRUSBEN { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Interrupt enable for common USB interrupts."] - pub mod intrusben { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::INTRUSBEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SOF_INT_ENR { - bits: bool, - } - impl SOF_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESET_INT_ENR { - bits: bool, - } - impl RESET_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RESUME_INT_ENR { - bits: bool, - } - impl RESUME_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SUSPEND_INT_ENR { - bits: bool, - } - impl SUSPEND_INT_ENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SOF_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _SOF_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESET_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RESET_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RESUME_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RESUME_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SUSPEND_INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _SUSPEND_INT_ENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 3 - Start of Frame."] - #[inline] - pub fn sof_int_en(&self) -> SOF_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SOF_INT_ENR { bits } - } - #[doc = "Bit 2 - Bus reset detected."] - #[inline] - pub fn reset_int_en(&self) -> RESET_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESET_INT_ENR { bits } - } - #[doc = "Bit 1 - Resume detected."] - #[inline] - pub fn resume_int_en(&self) -> RESUME_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RESUME_INT_ENR { bits } - } - #[doc = "Bit 0 - Suspend detected."] - #[inline] - pub fn suspend_int_en(&self) -> SUSPEND_INT_ENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SUSPEND_INT_ENR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 3 - Start of Frame."] - #[inline] - pub fn sof_int_en(&mut self) -> _SOF_INT_ENW { - _SOF_INT_ENW { w: self } - } - #[doc = "Bit 2 - Bus reset detected."] - #[inline] - pub fn reset_int_en(&mut self) -> _RESET_INT_ENW { - _RESET_INT_ENW { w: self } - } - #[doc = "Bit 1 - Resume detected."] - #[inline] - pub fn resume_int_en(&mut self) -> _RESUME_INT_ENW { - _RESUME_INT_ENW { w: self } - } - #[doc = "Bit 0 - Suspend detected."] - #[inline] - pub fn suspend_int_en(&mut self) -> _SUSPEND_INT_ENW { - _SUSPEND_INT_ENW { w: self } - } - } - } - #[doc = "Frame number."] - pub struct FRAME { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Frame number."] - pub mod frame { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::FRAME { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct FRAMENUMR { - bits: u16, - } - impl FRAMENUMR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:10 - Read the last received frame number, that is the 11-bit frame number received in the SOF packet."] - #[inline] - pub fn framenum(&self) -> FRAMENUMR { - let bits = { - const MASK: u16 = 0x07ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - FRAMENUMR { bits } - } - } - } - #[doc = "Index for banked registers."] - pub struct INDEX { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Index for banked registers."] - pub mod index { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::INDEX { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INDEXR { - bits: u8, - } - impl INDEXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _INDEXW<'a> { - w: &'a mut W, - } - impl<'a> _INDEXW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 0:3 - Index Register Access Selector."] - #[inline] - pub fn index(&self) -> INDEXR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - INDEXR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Index Register Access Selector."] - #[inline] - pub fn index(&mut self) -> _INDEXW { - _INDEXW { w: self } - } - } - } - #[doc = "USB 2.0 test mode enable register."] - pub struct TESTMODE { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "USB 2.0 test mode enable register."] - pub mod testmode { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::TESTMODE { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct FORCE_FSR { - bits: bool, - } - impl FORCE_FSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FORCE_HSR { - bits: bool, - } - impl FORCE_HSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TEST_PKTR { - bits: bool, - } - impl TEST_PKTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TEST_KR { - bits: bool, - } - impl TEST_KR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TEST_JR { - bits: bool, - } - impl TEST_JR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct TEST_SE0_NAKR { - bits: bool, - } - impl TEST_SE0_NAKR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _FORCE_FSW<'a> { - w: &'a mut W, - } - impl<'a> _FORCE_FSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FORCE_HSW<'a> { - w: &'a mut W, - } - impl<'a> _FORCE_HSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TEST_PKTW<'a> { - w: &'a mut W, - } - impl<'a> _TEST_PKTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TEST_KW<'a> { - w: &'a mut W, - } - impl<'a> _TEST_KW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TEST_JW<'a> { - w: &'a mut W, - } - impl<'a> _TEST_JW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _TEST_SE0_NAKW<'a> { - w: &'a mut W, - } - impl<'a> _TEST_SE0_NAKW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 5 - Force USB to Full-speed after reset."] - #[inline] - pub fn force_fs(&self) -> FORCE_FSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FORCE_FSR { bits } - } - #[doc = "Bit 4 - Force USB to High-speed after reset."] - #[inline] - pub fn force_hs(&self) -> FORCE_HSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FORCE_HSR { bits } - } - #[doc = "Bit 3 - Transmit fixed test packet."] - #[inline] - pub fn test_pkt(&self) -> TEST_PKTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - TEST_PKTR { bits } - } - #[doc = "Bit 2 - Force USB to continuous K state."] - #[inline] - pub fn test_k(&self) -> TEST_KR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - TEST_KR { bits } - } - #[doc = "Bit 1 - Force USB to continuous J state."] - #[inline] - pub fn test_j(&self) -> TEST_JR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - TEST_JR { bits } - } - #[doc = "Bit 0 - Respond to any valid IN token with NAK."] - #[inline] - pub fn test_se0_nak(&self) -> TEST_SE0_NAKR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - TEST_SE0_NAKR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 5 - Force USB to Full-speed after reset."] - #[inline] - pub fn force_fs(&mut self) -> _FORCE_FSW { - _FORCE_FSW { w: self } - } - #[doc = "Bit 4 - Force USB to High-speed after reset."] - #[inline] - pub fn force_hs(&mut self) -> _FORCE_HSW { - _FORCE_HSW { w: self } - } - #[doc = "Bit 3 - Transmit fixed test packet."] - #[inline] - pub fn test_pkt(&mut self) -> _TEST_PKTW { - _TEST_PKTW { w: self } - } - #[doc = "Bit 2 - Force USB to continuous K state."] - #[inline] - pub fn test_k(&mut self) -> _TEST_KW { - _TEST_KW { w: self } - } - #[doc = "Bit 1 - Force USB to continuous J state."] - #[inline] - pub fn test_j(&mut self) -> _TEST_JW { - _TEST_JW { w: self } - } - #[doc = "Bit 0 - Respond to any valid IN token with NAK."] - #[inline] - pub fn test_se0_nak(&mut self) -> _TEST_SE0_NAKW { - _TEST_SE0_NAKW { w: self } - } - } - } - #[doc = "Maximum packet size for INx endpoint (x == INDEX)."] - pub struct INMAXP { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Maximum packet size for INx endpoint (x == INDEX)."] - pub mod inmaxp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::INMAXP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct MAXPACKETSIZER { - bits: u16, - } - impl MAXPACKETSIZER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct NUMPACKMINUS1R { - bits: u8, - } - impl NUMPACKMINUS1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _MAXPACKETSIZEW<'a> { - w: &'a mut W, - } - impl<'a> _MAXPACKETSIZEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x07ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NUMPACKMINUS1W<'a> { - w: &'a mut W, - } - impl<'a> _NUMPACKMINUS1W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:10 - Maximum Packet Size in a Single Transaction. That is the maximum packet size in bytes, that is transmitted for each microframe. The maximum value is 1024, subject to the limitations of the endpoint type set in USB 2.0 Specification, Chapter 9"] - #[inline] - pub fn maxpacketsize(&self) -> MAXPACKETSIZER { - let bits = { - const MASK: u16 = 0x07ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - MAXPACKETSIZER { bits } - } - #[doc = "Bits 11:15 - Number of Split Packets - 1. Defines the maximum number of packets minus 1 that a USB payload can be split into. THis must be an exact multiple of maxpacketsize. Only applicable for HS High-Bandwidth isochronous endpoints and Bulk endpoints. Ignored in all other cases."] - #[inline] - pub fn numpackminus1(&self) -> NUMPACKMINUS1R { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - NUMPACKMINUS1R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:10 - Maximum Packet Size in a Single Transaction. That is the maximum packet size in bytes, that is transmitted for each microframe. The maximum value is 1024, subject to the limitations of the endpoint type set in USB 2.0 Specification, Chapter 9"] - #[inline] - pub fn maxpacketsize(&mut self) -> _MAXPACKETSIZEW { - _MAXPACKETSIZEW { w: self } - } - #[doc = "Bits 11:15 - Number of Split Packets - 1. Defines the maximum number of packets minus 1 that a USB payload can be split into. THis must be an exact multiple of maxpacketsize. Only applicable for HS High-Bandwidth isochronous endpoints and Bulk endpoints. Ignored in all other cases."] - #[inline] - pub fn numpackminus1(&mut self) -> _NUMPACKMINUS1W { - _NUMPACKMINUS1W { w: self } - } - } - } - #[doc = "Control status register for EP 0 (when INDEX == 0)."] - pub struct CSR0 { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Control status register for EP 0 (when INDEX == 0)."] - pub mod csr0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::CSR0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SERV_SETUP_ENDR { - bits: bool, - } - impl SERV_SETUP_ENDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SERV_OUTPKTRDYR { - bits: bool, - } - impl SERV_OUTPKTRDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SEND_STALLR { - bits: bool, - } - impl SEND_STALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SETUP_ENDR { - bits: bool, - } - impl SETUP_ENDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATA_ENDR { - bits: bool, - } - impl DATA_ENDR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SENT_STALLR { - bits: bool, - } - impl SENT_STALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INPKTRDYR { - bits: bool, - } - impl INPKTRDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OUTPKTRDYR { - bits: bool, - } - impl OUTPKTRDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SERV_SETUP_ENDW<'a> { - w: &'a mut W, - } - impl<'a> _SERV_SETUP_ENDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SERV_OUTPKTRDYW<'a> { - w: &'a mut W, - } - impl<'a> _SERV_OUTPKTRDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SEND_STALLW<'a> { - w: &'a mut W, - } - impl<'a> _SEND_STALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DATA_ENDW<'a> { - w: &'a mut W, - } - impl<'a> _DATA_ENDW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SENT_STALLW<'a> { - w: &'a mut W, - } - impl<'a> _SENT_STALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _INPKTRDYW<'a> { - w: &'a mut W, - } - impl<'a> _INPKTRDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 7 - Clear EP0 Setup End Bit. Write a 1 to clear the setupend bit. Automatically cleared after being set"] - #[inline] - pub fn serv_setup_end(&self) -> SERV_SETUP_ENDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SERV_SETUP_ENDR { bits } - } - #[doc = "Bit 6 - Clear EP0 Out Packet Ready Bit. Write a 1 to clear the outpktrdy bit. Automatically cleared after being set."] - #[inline] - pub fn serv_outpktrdy(&self) -> SERV_OUTPKTRDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SERV_OUTPKTRDYR { bits } - } - #[doc = "Bit 5 - Send EP0 STALL Handshake. Write a 1 to this bit to terminate the current control transaction by sneding a STALL handshake. Automatically cleared after being set."] - #[inline] - pub fn send_stall(&self) -> SEND_STALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SEND_STALLR { bits } - } - #[doc = "Bit 4 - Read Setup End Status. Automatically set when a contorl transaction ends before the dataend bit has been set by fimrware. An interrupt is generated when this bit is set. Write 1 to servicedsetupend to clear."] - #[inline] - pub fn setup_end(&self) -> SETUP_ENDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SETUP_ENDR { bits } - } - #[doc = "Bit 3 - Control Transaction Data End. Write a 1 to this bit after firmware completes any of the following three transactions: 1. set inpktrdy = 1 for the last data packet. 2. Set inpktrdy =1 for a zero-length data packet. 3. Clear outpktrdy = 0 after unloading the last data packet."] - #[inline] - pub fn data_end(&self) -> DATA_ENDR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DATA_ENDR { bits } - } - #[doc = "Bit 2 - Read EP0 STALL Handshake Sent Status Automatically set when a STALL handshake is transmitted. Write a 0 to clear."] - #[inline] - pub fn sent_stall(&self) -> SENT_STALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SENT_STALLR { bits } - } - #[doc = "Bit 1 - EP0 IN Packet Ready 1: Write a 1 after writing a data packet to the IN FIFO. Automatically cleared when the data packet is transmitted. An interrupt is generated when this bit is cleared."] - #[inline] - pub fn inpktrdy(&self) -> INPKTRDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - INPKTRDYR { bits } - } - #[doc = "Bit 0 - EP0 OUT Packet Ready Status Automatically set when a data packet is received in the OUT FIFO. An interrupt is generated when this bit is set. Write a 1 to the servicedoutpktrdy bit (above) to clear after the packet is unloaded from the OUT FIFO."] - #[inline] - pub fn outpktrdy(&self) -> OUTPKTRDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - OUTPKTRDYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 7 - Clear EP0 Setup End Bit. Write a 1 to clear the setupend bit. Automatically cleared after being set"] - #[inline] - pub fn serv_setup_end(&mut self) -> _SERV_SETUP_ENDW { - _SERV_SETUP_ENDW { w: self } - } - #[doc = "Bit 6 - Clear EP0 Out Packet Ready Bit. Write a 1 to clear the outpktrdy bit. Automatically cleared after being set."] - #[inline] - pub fn serv_outpktrdy(&mut self) -> _SERV_OUTPKTRDYW { - _SERV_OUTPKTRDYW { w: self } - } - #[doc = "Bit 5 - Send EP0 STALL Handshake. Write a 1 to this bit to terminate the current control transaction by sneding a STALL handshake. Automatically cleared after being set."] - #[inline] - pub fn send_stall(&mut self) -> _SEND_STALLW { - _SEND_STALLW { w: self } - } - #[doc = "Bit 3 - Control Transaction Data End. Write a 1 to this bit after firmware completes any of the following three transactions: 1. set inpktrdy = 1 for the last data packet. 2. Set inpktrdy =1 for a zero-length data packet. 3. Clear outpktrdy = 0 after unloading the last data packet."] - #[inline] - pub fn data_end(&mut self) -> _DATA_ENDW { - _DATA_ENDW { w: self } - } - #[doc = "Bit 2 - Read EP0 STALL Handshake Sent Status Automatically set when a STALL handshake is transmitted. Write a 0 to clear."] - #[inline] - pub fn sent_stall(&mut self) -> _SENT_STALLW { - _SENT_STALLW { w: self } - } - #[doc = "Bit 1 - EP0 IN Packet Ready 1: Write a 1 after writing a data packet to the IN FIFO. Automatically cleared when the data packet is transmitted. An interrupt is generated when this bit is cleared."] - #[inline] - pub fn inpktrdy(&mut self) -> _INPKTRDYW { - _INPKTRDYW { w: self } - } - } - } - #[doc = "Control status lower register for INx endpoint (x == INDEX)."] - pub struct INCSRL { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Control status lower register for INx endpoint (x == INDEX)."] - pub mod incsrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::INCSRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct INCOMPTXR { - bits: bool, - } - impl INCOMPTXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct CLRDATATOGR { - bits: bool, - } - impl CLRDATATOGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SENTSTALLR { - bits: bool, - } - impl SENTSTALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = "Possible values of the field `SENDSTALL`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum SENDSTALLR { - #[doc = "Terminate STALL handhsake"] - TERMINATE, - #[doc = "Respond to an IN token with a STALL handshake"] - RESPOND, - } - impl SENDSTALLR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - SENDSTALLR::TERMINATE => false, - SENDSTALLR::RESPOND => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> SENDSTALLR { - match value { - false => SENDSTALLR::TERMINATE, - true => SENDSTALLR::RESPOND, - } - } - #[doc = "Checks if the value of the field is `TERMINATE`"] - #[inline] - pub fn is_terminate(&self) -> bool { - *self == SENDSTALLR::TERMINATE - } - #[doc = "Checks if the value of the field is `RESPOND`"] - #[inline] - pub fn is_respond(&self) -> bool { - *self == SENDSTALLR::RESPOND - } - } - #[doc = r" Value of the field"] - pub struct FLUSHFIFOR { - bits: bool, - } - impl FLUSHFIFOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct UNDERRUNR { - bits: bool, - } - impl UNDERRUNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FIFONOTEMPTYR { - bits: bool, - } - impl FIFONOTEMPTYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INPKTRDYR { - bits: bool, - } - impl INPKTRDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _INCOMPTXW<'a> { - w: &'a mut W, - } - impl<'a> _INCOMPTXW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _CLRDATATOGW<'a> { - w: &'a mut W, - } - impl<'a> _CLRDATATOGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SENTSTALLW<'a> { - w: &'a mut W, - } - impl<'a> _SENTSTALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FLUSHFIFOW<'a> { - w: &'a mut W, - } - impl<'a> _FLUSHFIFOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _UNDERRUNW<'a> { - w: &'a mut W, - } - impl<'a> _UNDERRUNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FIFONOTEMPTYW<'a> { - w: &'a mut W, - } - impl<'a> _FIFONOTEMPTYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 7 - Read Incomplete Split Transfer Error Status High-bandwidth isochronous transfers: Automatically set when a payload is split into multiple packets but insufficient IN tokens were received to send all packets. The current packets is flushed from the IN FIFO. Write 0 to clear."] - #[inline] - pub fn incomptx(&self) -> INCOMPTXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - INCOMPTXR { bits } - } - #[doc = "Bit 6 - Write 1 to clear IN endpoint data-toggle to 0."] - #[inline] - pub fn clrdatatog(&self) -> CLRDATATOGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CLRDATATOGR { bits } - } - #[doc = "Bit 5 - Read STALL Handshake Sent Status Automatically set when a STALL handshake is transmitted, at which time the IN FIFO is flushed, and inpktrdy is cleared. Write 0 to clear."] - #[inline] - pub fn sentstall(&self) -> SENTSTALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SENTSTALLR { bits } - } - #[doc = "Bit 4 - Send STALL Handshake."] - #[inline] - pub fn sendstall(&self) -> SENDSTALLR { - SENDSTALLR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 3 - Flush Next Packet from IN FIFO. Write 1 to clear"] - #[inline] - pub fn flushfifo(&self) -> FLUSHFIFOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FLUSHFIFOR { bits } - } - #[doc = "Bit 2 - Read IN FIFO Underrun Error Status Isochronous Mode: Automatically set if the IN FIFO is empty. Write 0 to clear"] - #[inline] - pub fn underrun(&self) -> UNDERRUNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - UNDERRUNR { bits } - } - #[doc = "Bit 1 - Read FIFO Not Empty Status. Automatically set when there is at least one packet in the IN FIFO. Write a 0 to clear."] - #[inline] - pub fn fifonotempty(&self) -> FIFONOTEMPTYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FIFONOTEMPTYR { bits } - } - #[doc = "Bit 0 - IN Packet Ready. Write a 1 to clear"] - #[inline] - pub fn inpktrdy(&self) -> INPKTRDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - INPKTRDYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 7 - Read Incomplete Split Transfer Error Status High-bandwidth isochronous transfers: Automatically set when a payload is split into multiple packets but insufficient IN tokens were received to send all packets. The current packets is flushed from the IN FIFO. Write 0 to clear."] - #[inline] - pub fn incomptx(&mut self) -> _INCOMPTXW { - _INCOMPTXW { w: self } - } - #[doc = "Bit 6 - Write 1 to clear IN endpoint data-toggle to 0."] - #[inline] - pub fn clrdatatog(&mut self) -> _CLRDATATOGW { - _CLRDATATOGW { w: self } - } - #[doc = "Bit 5 - Read STALL Handshake Sent Status Automatically set when a STALL handshake is transmitted, at which time the IN FIFO is flushed, and inpktrdy is cleared. Write 0 to clear."] - #[inline] - pub fn sentstall(&mut self) -> _SENTSTALLW { - _SENTSTALLW { w: self } - } - #[doc = "Bit 3 - Flush Next Packet from IN FIFO. Write 1 to clear"] - #[inline] - pub fn flushfifo(&mut self) -> _FLUSHFIFOW { - _FLUSHFIFOW { w: self } - } - #[doc = "Bit 2 - Read IN FIFO Underrun Error Status Isochronous Mode: Automatically set if the IN FIFO is empty. Write 0 to clear"] - #[inline] - pub fn underrun(&mut self) -> _UNDERRUNW { - _UNDERRUNW { w: self } - } - #[doc = "Bit 1 - Read FIFO Not Empty Status. Automatically set when there is at least one packet in the IN FIFO. Write a 0 to clear."] - #[inline] - pub fn fifonotempty(&mut self) -> _FIFONOTEMPTYW { - _FIFONOTEMPTYW { w: self } - } - } - } - #[doc = "Control status upper register for INx endpoint (x == INDEX)."] - pub struct INCSRU { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Control status upper register for INx endpoint (x == INDEX)."] - pub mod incsru { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::INCSRU { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `AUTOSET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AUTOSETR { - #[doc = "USBHS_INCSRL_inpktrdy must be set by firmware."] - SET, - #[doc = "USBHS_INCSRL_inpktrdy is automatically set. "] - AUTO, - } - impl AUTOSETR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - AUTOSETR::SET => false, - AUTOSETR::AUTO => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> AUTOSETR { - match value { - false => AUTOSETR::SET, - true => AUTOSETR::AUTO, - } - } - #[doc = "Checks if the value of the field is `SET`"] - #[inline] - pub fn is_set(&self) -> bool { - *self == AUTOSETR::SET - } - #[doc = "Checks if the value of the field is `AUTO`"] - #[inline] - pub fn is_auto(&self) -> bool { - *self == AUTOSETR::AUTO - } - } - #[doc = "Possible values of the field `ISO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ISOR { - #[doc = "Enable IN Bulk and IN interrupt transfers."] - INTERRUPT, - #[doc = "Enable IN Isochronous transfers. "] - ISOCHRONOUS, - } - impl ISOR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - ISOR::INTERRUPT => false, - ISOR::ISOCHRONOUS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> ISOR { - match value { - false => ISOR::INTERRUPT, - true => ISOR::ISOCHRONOUS, - } - } - #[doc = "Checks if the value of the field is `INTERRUPT`"] - #[inline] - pub fn is_interrupt(&self) -> bool { - *self == ISOR::INTERRUPT - } - #[doc = "Checks if the value of the field is `ISOCHRONOUS`"] - #[inline] - pub fn is_isochronous(&self) -> bool { - *self == ISOR::ISOCHRONOUS - } - } - #[doc = "Possible values of the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODER { - #[doc = "Endpoint direction is OUT."] - OUT, - #[doc = "Endpoint direction is IN. "] - IN, - } - impl MODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - MODER::OUT => false, - MODER::IN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> MODER { - match value { - false => MODER::OUT, - true => MODER::IN, - } - } - #[doc = "Checks if the value of the field is `OUT`"] - #[inline] - pub fn is_out(&self) -> bool { - *self == MODER::OUT - } - #[doc = "Checks if the value of the field is `IN`"] - #[inline] - pub fn is_in_(&self) -> bool { - *self == MODER::IN - } - } - #[doc = "Possible values of the field `DMAREQEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAREQENR { - #[doc = "Disable DMA for this IN endpoint."] - DIS, - #[doc = "Enable DMA for this IN endpoint."] - EN, - } - impl DMAREQENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMAREQENR::DIS => false, - DMAREQENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMAREQENR { - match value { - false => DMAREQENR::DIS, - true => DMAREQENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DMAREQENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DMAREQENR::EN - } - } - #[doc = "Possible values of the field `FRCDATATOG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FRCDATATOGR { - #[doc = "Toggle data-toglge only when an ACK is received."] - RECEIVED, - #[doc = "Toggle data-toggle regardless of ACK. "] - DONTCARE, - } - impl FRCDATATOGR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - FRCDATATOGR::RECEIVED => false, - FRCDATATOGR::DONTCARE => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> FRCDATATOGR { - match value { - false => FRCDATATOGR::RECEIVED, - true => FRCDATATOGR::DONTCARE, - } - } - #[doc = "Checks if the value of the field is `RECEIVED`"] - #[inline] - pub fn is_received(&self) -> bool { - *self == FRCDATATOGR::RECEIVED - } - #[doc = "Checks if the value of the field is `DONTCARE`"] - #[inline] - pub fn is_dontcare(&self) -> bool { - *self == FRCDATATOGR::DONTCARE - } - } - #[doc = "Possible values of the field `DMAREQMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAREQMODER { - #[doc = "Enable DMA Request Mode 0."] - _0, - #[doc = "Enable DMA Request Mode 1."] - _1, - } - impl DMAREQMODER { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DMAREQMODER::_0 => false, - DMAREQMODER::_1 => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DMAREQMODER { - match value { - false => DMAREQMODER::_0, - true => DMAREQMODER::_1, - } - } - #[doc = "Checks if the value of the field is `_0`"] - #[inline] - pub fn is_0(&self) -> bool { - *self == DMAREQMODER::_0 - } - #[doc = "Checks if the value of the field is `_1`"] - #[inline] - pub fn is_1(&self) -> bool { - *self == DMAREQMODER::_1 - } - } - #[doc = "Possible values of the field `DPKTBUFDIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DPKTBUFDISR { - #[doc = "Enable Double packet buffering."] - EN, - #[doc = "Disable Double Packet Buffering."] - DIS, - } - impl DPKTBUFDISR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - DPKTBUFDISR::EN => false, - DPKTBUFDISR::DIS => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> DPKTBUFDISR { - match value { - false => DPKTBUFDISR::EN, - true => DPKTBUFDISR::DIS, - } - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == DPKTBUFDISR::EN - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == DPKTBUFDISR::DIS - } - } - #[doc = "Values that can be written to the field `AUTOSET`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum AUTOSETW { - #[doc = "USBHS_INCSRL_inpktrdy must be set by firmware."] - SET, - #[doc = "USBHS_INCSRL_inpktrdy is automatically set. "] - AUTO, - } - impl AUTOSETW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - AUTOSETW::SET => false, - AUTOSETW::AUTO => true, - } - } - } - #[doc = r" Proxy"] - pub struct _AUTOSETW<'a> { - w: &'a mut W, - } - impl<'a> _AUTOSETW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: AUTOSETW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "USBHS_INCSRL_inpktrdy must be set by firmware."] - #[inline] - pub fn set(self) -> &'a mut W { - self.variant(AUTOSETW::SET) - } - #[doc = "USBHS_INCSRL_inpktrdy is automatically set."] - #[inline] - pub fn auto(self) -> &'a mut W { - self.variant(AUTOSETW::AUTO) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `ISO`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum ISOW { - #[doc = "Enable IN Bulk and IN interrupt transfers."] - INTERRUPT, - #[doc = "Enable IN Isochronous transfers. "] - ISOCHRONOUS, - } - impl ISOW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - ISOW::INTERRUPT => false, - ISOW::ISOCHRONOUS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _ISOW<'a> { - w: &'a mut W, - } - impl<'a> _ISOW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: ISOW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable IN Bulk and IN interrupt transfers."] - #[inline] - pub fn interrupt(self) -> &'a mut W { - self.variant(ISOW::INTERRUPT) - } - #[doc = "Enable IN Isochronous transfers."] - #[inline] - pub fn isochronous(self) -> &'a mut W { - self.variant(ISOW::ISOCHRONOUS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `MODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum MODEW { - #[doc = "Endpoint direction is OUT."] - OUT, - #[doc = "Endpoint direction is IN. "] - IN, - } - impl MODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - MODEW::OUT => false, - MODEW::IN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _MODEW<'a> { - w: &'a mut W, - } - impl<'a> _MODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: MODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Endpoint direction is OUT."] - #[inline] - pub fn out(self) -> &'a mut W { - self.variant(MODEW::OUT) - } - #[doc = "Endpoint direction is IN."] - #[inline] - pub fn in_(self) -> &'a mut W { - self.variant(MODEW::IN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMAREQEN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAREQENW { - #[doc = "Disable DMA for this IN endpoint."] - DIS, - #[doc = "Enable DMA for this IN endpoint."] - EN, - } - impl DMAREQENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMAREQENW::DIS => false, - DMAREQENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DMAREQENW<'a> { - w: &'a mut W, - } - impl<'a> _DMAREQENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMAREQENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable DMA for this IN endpoint."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DMAREQENW::DIS) - } - #[doc = "Enable DMA for this IN endpoint."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DMAREQENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `FRCDATATOG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum FRCDATATOGW { - #[doc = "Toggle data-toglge only when an ACK is received."] - RECEIVED, - #[doc = "Toggle data-toggle regardless of ACK. "] - DONTCARE, - } - impl FRCDATATOGW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - FRCDATATOGW::RECEIVED => false, - FRCDATATOGW::DONTCARE => true, - } - } - } - #[doc = r" Proxy"] - pub struct _FRCDATATOGW<'a> { - w: &'a mut W, - } - impl<'a> _FRCDATATOGW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: FRCDATATOGW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Toggle data-toglge only when an ACK is received."] - #[inline] - pub fn received(self) -> &'a mut W { - self.variant(FRCDATATOGW::RECEIVED) - } - #[doc = "Toggle data-toggle regardless of ACK."] - #[inline] - pub fn dontcare(self) -> &'a mut W { - self.variant(FRCDATATOGW::DONTCARE) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DMAREQMODE`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DMAREQMODEW { - #[doc = "Enable DMA Request Mode 0."] - _0, - #[doc = "Enable DMA Request Mode 1."] - _1, - } - impl DMAREQMODEW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DMAREQMODEW::_0 => false, - DMAREQMODEW::_1 => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DMAREQMODEW<'a> { - w: &'a mut W, - } - impl<'a> _DMAREQMODEW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DMAREQMODEW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable DMA Request Mode 0."] - #[inline] - pub fn _0(self) -> &'a mut W { - self.variant(DMAREQMODEW::_0) - } - #[doc = "Enable DMA Request Mode 1."] - #[inline] - pub fn _1(self) -> &'a mut W { - self.variant(DMAREQMODEW::_1) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `DPKTBUFDIS`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum DPKTBUFDISW { - #[doc = "Enable Double packet buffering."] - EN, - #[doc = "Disable Double Packet Buffering."] - DIS, - } - impl DPKTBUFDISW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - DPKTBUFDISW::EN => false, - DPKTBUFDISW::DIS => true, - } - } - } - #[doc = r" Proxy"] - pub struct _DPKTBUFDISW<'a> { - w: &'a mut W, - } - impl<'a> _DPKTBUFDISW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: DPKTBUFDISW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Enable Double packet buffering."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(DPKTBUFDISW::EN) - } - #[doc = "Disable Double Packet Buffering."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(DPKTBUFDISW::DIS) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 7 - Auto Set inpktrdy."] - #[inline] - pub fn autoset(&self) -> AUTOSETR { - AUTOSETR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 6 - Isochronous Transfer Enable"] - #[inline] - pub fn iso(&self) -> ISOR { - ISOR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 5 - Endpoint Direction Mode."] - #[inline] - pub fn mode(&self) -> MODER { - MODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 4 - DMA Request Enable"] - #[inline] - pub fn dmareqen(&self) -> DMAREQENR { - DMAREQENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 3 - Force In Data - Toggle"] - #[inline] - pub fn frcdatatog(&self) -> FRCDATATOGR { - FRCDATATOGR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 2 - DMA Request Mode Enable"] - #[inline] - pub fn dmareqmode(&self) -> DMAREQMODER { - DMAREQMODER::_from({ - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - #[doc = "Bit 1 - Double Packet Buffering Disable"] - #[inline] - pub fn dpktbufdis(&self) -> DPKTBUFDISR { - DPKTBUFDISR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 7 - Auto Set inpktrdy."] - #[inline] - pub fn autoset(&mut self) -> _AUTOSETW { - _AUTOSETW { w: self } - } - #[doc = "Bit 6 - Isochronous Transfer Enable"] - #[inline] - pub fn iso(&mut self) -> _ISOW { - _ISOW { w: self } - } - #[doc = "Bit 5 - Endpoint Direction Mode."] - #[inline] - pub fn mode(&mut self) -> _MODEW { - _MODEW { w: self } - } - #[doc = "Bit 4 - DMA Request Enable"] - #[inline] - pub fn dmareqen(&mut self) -> _DMAREQENW { - _DMAREQENW { w: self } - } - #[doc = "Bit 3 - Force In Data - Toggle"] - #[inline] - pub fn frcdatatog(&mut self) -> _FRCDATATOGW { - _FRCDATATOGW { w: self } - } - #[doc = "Bit 2 - DMA Request Mode Enable"] - #[inline] - pub fn dmareqmode(&mut self) -> _DMAREQMODEW { - _DMAREQMODEW { w: self } - } - #[doc = "Bit 1 - Double Packet Buffering Disable"] - #[inline] - pub fn dpktbufdis(&mut self) -> _DPKTBUFDISW { - _DPKTBUFDISW { w: self } - } - } - } - #[doc = "Maximum packet size for OUTx endpoint (x == INDEX)."] - pub struct OUTMAXP { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Maximum packet size for OUTx endpoint (x == INDEX)."] - pub mod outmaxp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::OUTMAXP { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct NUMPACKMINUS1R { - bits: u8, - } - impl NUMPACKMINUS1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct MAXPACKETSIZER { - bits: u16, - } - impl MAXPACKETSIZER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _NUMPACKMINUS1W<'a> { - w: &'a mut W, - } - impl<'a> _NUMPACKMINUS1W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _MAXPACKETSIZEW<'a> { - w: &'a mut W, - } - impl<'a> _MAXPACKETSIZEW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0x07ff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 11:15 - Number of Split Packets -1. Defines the maximum number of packets - 1 that a usb payload is combined into. The value must be exact multiple of maxpacketsize."] - #[inline] - pub fn numpackminus1(&self) -> NUMPACKMINUS1R { - let bits = { - const MASK: u8 = 0x1f; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - NUMPACKMINUS1R { bits } - } - #[doc = "Bits 0:10 - Maximum Packet in a Single Transaction. This is the maximum packet size, in bytes, that is transmitted for each microframe. The maximum value is 1024, subject to the limitations for the endpoint type set in USB2.0 spesification, chapter 9."] - #[inline] - pub fn maxpacketsize(&self) -> MAXPACKETSIZER { - let bits = { - const MASK: u16 = 0x07ff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - MAXPACKETSIZER { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 11:15 - Number of Split Packets -1. Defines the maximum number of packets - 1 that a usb payload is combined into. The value must be exact multiple of maxpacketsize."] - #[inline] - pub fn numpackminus1(&mut self) -> _NUMPACKMINUS1W { - _NUMPACKMINUS1W { w: self } - } - #[doc = "Bits 0:10 - Maximum Packet in a Single Transaction. This is the maximum packet size, in bytes, that is transmitted for each microframe. The maximum value is 1024, subject to the limitations for the endpoint type set in USB2.0 spesification, chapter 9."] - #[inline] - pub fn maxpacketsize(&mut self) -> _MAXPACKETSIZEW { - _MAXPACKETSIZEW { w: self } - } - } - } - #[doc = "Control status lower register for OUTx endpoint (x == INDEX)."] - pub struct OUTCSRL { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Control status lower register for OUTx endpoint (x == INDEX)."] - pub mod outcsrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::OUTCSRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct CLRDATATOGR { - bits: bool, - } - impl CLRDATATOGR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SENTSTALLR { - bits: bool, - } - impl SENTSTALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct SENDSTALLR { - bits: bool, - } - impl SENDSTALLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FLUSHFIFOR { - bits: bool, - } - impl FLUSHFIFOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DATAERRORR { - bits: bool, - } - impl DATAERRORR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OVERRUNR { - bits: bool, - } - impl OVERRUNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct FIFOFULLR { - bits: bool, - } - impl FIFOFULLR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct OUTPKTRDYR { - bits: bool, - } - impl OUTPKTRDYR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _CLRDATATOGW<'a> { - w: &'a mut W, - } - impl<'a> _CLRDATATOGW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SENTSTALLW<'a> { - w: &'a mut W, - } - impl<'a> _SENTSTALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _SENDSTALLW<'a> { - w: &'a mut W, - } - impl<'a> _SENDSTALLW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _FLUSHFIFOW<'a> { - w: &'a mut W, - } - impl<'a> _FLUSHFIFOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OVERRUNW<'a> { - w: &'a mut W, - } - impl<'a> _OVERRUNW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 2; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _OUTPKTRDYW<'a> { - w: &'a mut W, - } - impl<'a> _OUTPKTRDYW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 7"] - #[inline] - pub fn clrdatatog(&self) -> CLRDATATOGR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - CLRDATATOGR { bits } - } - #[doc = "Bit 6"] - #[inline] - pub fn sentstall(&self) -> SENTSTALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SENTSTALLR { bits } - } - #[doc = "Bit 5"] - #[inline] - pub fn sendstall(&self) -> SENDSTALLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - SENDSTALLR { bits } - } - #[doc = "Bit 4"] - #[inline] - pub fn flushfifo(&self) -> FLUSHFIFOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FLUSHFIFOR { bits } - } - #[doc = "Bit 3"] - #[inline] - pub fn dataerror(&self) -> DATAERRORR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DATAERRORR { bits } - } - #[doc = "Bit 2"] - #[inline] - pub fn overrun(&self) -> OVERRUNR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 2; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - OVERRUNR { bits } - } - #[doc = "Bit 1"] - #[inline] - pub fn fifofull(&self) -> FIFOFULLR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - FIFOFULLR { bits } - } - #[doc = "Bit 0"] - #[inline] - pub fn outpktrdy(&self) -> OUTPKTRDYR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - OUTPKTRDYR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 7"] - #[inline] - pub fn clrdatatog(&mut self) -> _CLRDATATOGW { - _CLRDATATOGW { w: self } - } - #[doc = "Bit 6"] - #[inline] - pub fn sentstall(&mut self) -> _SENTSTALLW { - _SENTSTALLW { w: self } - } - #[doc = "Bit 5"] - #[inline] - pub fn sendstall(&mut self) -> _SENDSTALLW { - _SENDSTALLW { w: self } - } - #[doc = "Bit 4"] - #[inline] - pub fn flushfifo(&mut self) -> _FLUSHFIFOW { - _FLUSHFIFOW { w: self } - } - #[doc = "Bit 2"] - #[inline] - pub fn overrun(&mut self) -> _OVERRUNW { - _OVERRUNW { w: self } - } - #[doc = "Bit 0"] - #[inline] - pub fn outpktrdy(&mut self) -> _OUTPKTRDYW { - _OUTPKTRDYW { w: self } - } - } - } - #[doc = "Control status upper register for OUTx endpoint (x == INDEX)."] - pub struct OUTCSRU { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Control status upper register for OUTx endpoint (x == INDEX)."] - pub mod outcsru { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::OUTCSRU { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct AUTOCLEARR { - bits: bool, - } - impl AUTOCLEARR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct ISOR { - bits: bool, - } - impl ISOR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAREQENR { - bits: bool, - } - impl DMAREQENR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DISNYETR { - bits: bool, - } - impl DISNYETR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMAREQMODER { - bits: bool, - } - impl DMAREQMODER { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DPKTBUFDISR { - bits: bool, - } - impl DPKTBUFDISR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct INCOMPRXR { - bits: bool, - } - impl INCOMPRXR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _AUTOCLEARW<'a> { - w: &'a mut W, - } - impl<'a> _AUTOCLEARW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 7; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _ISOW<'a> { - w: &'a mut W, - } - impl<'a> _ISOW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 6; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAREQENW<'a> { - w: &'a mut W, - } - impl<'a> _DMAREQENW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 5; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DISNYETW<'a> { - w: &'a mut W, - } - impl<'a> _DISNYETW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMAREQMODEW<'a> { - w: &'a mut W, - } - impl<'a> _DMAREQMODEW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 3; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DPKTBUFDISW<'a> { - w: &'a mut W, - } - impl<'a> _DPKTBUFDISW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 7"] - #[inline] - pub fn autoclear(&self) -> AUTOCLEARR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 7; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - AUTOCLEARR { bits } - } - #[doc = "Bit 6"] - #[inline] - pub fn iso(&self) -> ISOR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 6; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - ISOR { bits } - } - #[doc = "Bit 5"] - #[inline] - pub fn dmareqen(&self) -> DMAREQENR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 5; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DMAREQENR { bits } - } - #[doc = "Bit 4"] - #[inline] - pub fn disnyet(&self) -> DISNYETR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DISNYETR { bits } - } - #[doc = "Bit 3"] - #[inline] - pub fn dmareqmode(&self) -> DMAREQMODER { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 3; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DMAREQMODER { bits } - } - #[doc = "Bit 1"] - #[inline] - pub fn dpktbufdis(&self) -> DPKTBUFDISR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - DPKTBUFDISR { bits } - } - #[doc = "Bit 0"] - #[inline] - pub fn incomprx(&self) -> INCOMPRXR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - INCOMPRXR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 7"] - #[inline] - pub fn autoclear(&mut self) -> _AUTOCLEARW { - _AUTOCLEARW { w: self } - } - #[doc = "Bit 6"] - #[inline] - pub fn iso(&mut self) -> _ISOW { - _ISOW { w: self } - } - #[doc = "Bit 5"] - #[inline] - pub fn dmareqen(&mut self) -> _DMAREQENW { - _DMAREQENW { w: self } - } - #[doc = "Bit 4"] - #[inline] - pub fn disnyet(&mut self) -> _DISNYETW { - _DISNYETW { w: self } - } - #[doc = "Bit 3"] - #[inline] - pub fn dmareqmode(&mut self) -> _DMAREQMODEW { - _DMAREQMODEW { w: self } - } - #[doc = "Bit 1"] - #[inline] - pub fn dpktbufdis(&mut self) -> _DPKTBUFDISW { - _DPKTBUFDISW { w: self } - } - } - } - #[doc = "Number of received bytes in EP 0 FIFO (INDEX == 0)."] - pub struct COUNT0 { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Number of received bytes in EP 0 FIFO (INDEX == 0)."] - pub mod count0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::COUNT0 { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct COUNT0R { - bits: u8, - } - impl COUNT0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:6 - Read Number of Data Bytes in the Endpoint 0 FIFO. Returns the number of data bytes in the endpoint 0 FIFO. This value changes as contents of the FIFO change. The value is only valued when USBHS_OUTSCRL_outpktrdy = 1"] - #[inline] - pub fn count0(&self) -> COUNT0R { - let bits = { - const MASK: u8 = 0x7f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u8 - }; - COUNT0R { bits } - } - } - } - #[doc = "Number of received bytes in OUT EPx FIFO (x == INDEX)."] - pub struct OUTCOUNT { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Number of received bytes in OUT EPx FIFO (x == INDEX)."] - pub mod outcount { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - impl super::OUTCOUNT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct OUTCOUNTR { - bits: u16, - } - impl OUTCOUNTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:12 - Read Number of Data Bytes in OUT FIFO. Returns the number of data bytes in the packet that are read next in the OUT FIFO."] - #[inline] - pub fn outcount(&self) -> OUTCOUNTR { - let bits = { - const MASK: u16 = 0x1fff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - OUTCOUNTR { bits } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO0 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo0 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO0 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO0R { - bits: u32, - } - impl USBHS_FIFO0R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO0W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO0W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo0(&self) -> USBHS_FIFO0R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO0R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo0(&mut self) -> _USBHS_FIFO0W { - _USBHS_FIFO0W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO1 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo1 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO1 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO1R { - bits: u32, - } - impl USBHS_FIFO1R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO1W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO1W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo1(&self) -> USBHS_FIFO1R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO1R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo1(&mut self) -> _USBHS_FIFO1W { - _USBHS_FIFO1W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO2 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo2 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO2 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO2R { - bits: u32, - } - impl USBHS_FIFO2R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO2W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO2W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo2(&self) -> USBHS_FIFO2R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO2R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo2(&mut self) -> _USBHS_FIFO2W { - _USBHS_FIFO2W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO3 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo3 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO3 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO3R { - bits: u32, - } - impl USBHS_FIFO3R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO3W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO3W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo3(&self) -> USBHS_FIFO3R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO3R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo3(&mut self) -> _USBHS_FIFO3W { - _USBHS_FIFO3W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO4 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO4 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO4R { - bits: u32, - } - impl USBHS_FIFO4R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO4W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO4W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo4(&self) -> USBHS_FIFO4R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO4R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo4(&mut self) -> _USBHS_FIFO4W { - _USBHS_FIFO4W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO5 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo5 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO5 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO5R { - bits: u32, - } - impl USBHS_FIFO5R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO5W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO5W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo5(&self) -> USBHS_FIFO5R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO5R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo5(&mut self) -> _USBHS_FIFO5W { - _USBHS_FIFO5W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO6 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo6 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO6 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO6R { - bits: u32, - } - impl USBHS_FIFO6R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO6W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO6W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo6(&self) -> USBHS_FIFO6R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO6R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo6(&mut self) -> _USBHS_FIFO6W { - _USBHS_FIFO6W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO7 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo7 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO7 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO7R { - bits: u32, - } - impl USBHS_FIFO7R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO7W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO7W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo7(&self) -> USBHS_FIFO7R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO7R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo7(&mut self) -> _USBHS_FIFO7W { - _USBHS_FIFO7W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO8 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo8 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO8 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO8R { - bits: u32, - } - impl USBHS_FIFO8R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO8W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO8W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo8(&self) -> USBHS_FIFO8R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO8R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo8(&mut self) -> _USBHS_FIFO8W { - _USBHS_FIFO8W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO9 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo9 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO9 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO9R { - bits: u32, - } - impl USBHS_FIFO9R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO9W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO9W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo9(&self) -> USBHS_FIFO9R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO9R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo9(&mut self) -> _USBHS_FIFO9W { - _USBHS_FIFO9W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO10 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo10 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO10 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO10R { - bits: u32, - } - impl USBHS_FIFO10R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO10W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO10W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo10(&self) -> USBHS_FIFO10R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO10R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo10(&mut self) -> _USBHS_FIFO10W { - _USBHS_FIFO10W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO11 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo11 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO11 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO11R { - bits: u32, - } - impl USBHS_FIFO11R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO11W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO11W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo11(&self) -> USBHS_FIFO11R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO11R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo11(&mut self) -> _USBHS_FIFO11W { - _USBHS_FIFO11W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO12 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo12 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO12 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO12R { - bits: u32, - } - impl USBHS_FIFO12R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO12W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO12W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo12(&self) -> USBHS_FIFO12R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO12R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo12(&mut self) -> _USBHS_FIFO12W { - _USBHS_FIFO12W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO13 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo13 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO13 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO13R { - bits: u32, - } - impl USBHS_FIFO13R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO13W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO13W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo13(&self) -> USBHS_FIFO13R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO13R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo13(&mut self) -> _USBHS_FIFO13W { - _USBHS_FIFO13W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO14 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo14 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO14 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO14R { - bits: u32, - } - impl USBHS_FIFO14R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO14W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO14W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo14(&self) -> USBHS_FIFO14R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO14R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo14(&mut self) -> _USBHS_FIFO14W { - _USBHS_FIFO14W { w: self } - } - } - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub struct FIFO15 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Read for OUT data FIFO, write for IN data FIFO."] - pub mod fifo15 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::FIFO15 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_FIFO15R { - bits: u32, - } - impl USBHS_FIFO15R { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_FIFO15W<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_FIFO15W<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u32) -> &'a mut W { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo15(&self) -> USBHS_FIFO15R { - let bits = { - const MASK: u32 = 0xffff_ffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u32 - }; - USBHS_FIFO15R { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:31 - USBHS Endpoint FIFO Read/Write Register."] - #[inline] - pub fn usbhs_fifo15(&mut self) -> _USBHS_FIFO15W { - _USBHS_FIFO15W { w: self } - } - } - } - #[doc = "HWVERS"] - pub struct HWVERS { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "HWVERS"] - pub mod hwvers { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::HWVERS { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct USBHS_HWVERSR { - bits: u16, - } - impl USBHS_HWVERSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _USBHS_HWVERSW<'a> { - w: &'a mut W, - } - impl<'a> _USBHS_HWVERSW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - USBHS Register."] - #[inline] - pub fn usbhs_hwvers(&self) -> USBHS_HWVERSR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - USBHS_HWVERSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - USBHS Register."] - #[inline] - pub fn usbhs_hwvers(&mut self) -> _USBHS_HWVERSW { - _USBHS_HWVERSW { w: self } - } - } - } - #[doc = "Endpoint hardware information."] - pub struct EPINFO { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Endpoint hardware information."] - pub mod epinfo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - impl super::EPINFO { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct OUTENDPOINTSR { - bits: u8, - } - impl OUTENDPOINTSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct INTENDPOINTSR { - bits: u8, - } - impl INTENDPOINTSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 4:7"] - #[inline] - pub fn outendpoints(&self) -> OUTENDPOINTSR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - OUTENDPOINTSR { bits } - } - #[doc = "Bits 0:3"] - #[inline] - pub fn intendpoints(&self) -> INTENDPOINTSR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - INTENDPOINTSR { bits } - } - } - } - #[doc = "RAM width and DMA hardware information."] - pub struct RAMINFO { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "RAM width and DMA hardware information."] - pub mod raminfo { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - impl super::RAMINFO { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - #[doc = r" Value of the field"] - pub struct DMACHANSR { - bits: u8, - } - impl DMACHANSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - #[doc = r" Value of the field"] - pub struct RAMBITSR { - bits: u8, - } - impl RAMBITSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bits 4:7"] - #[inline] - pub fn dmachans(&self) -> DMACHANSR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - DMACHANSR { bits } - } - #[doc = "Bits 0:3"] - #[inline] - pub fn rambits(&self) -> RAMBITSR { - let bits = { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) as u8 - }; - RAMBITSR { bits } - } - } - } - #[doc = "Software reset register."] - pub struct SOFTRESET { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "Software reset register."] - pub mod softreset { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::SOFTRESET { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct RSTXSR { - bits: bool, - } - impl RSTXSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct RSTSR { - bits: bool, - } - impl RSTSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _RSTXSW<'a> { - w: &'a mut W, - } - impl<'a> _RSTXSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _RSTSW<'a> { - w: &'a mut W, - } - impl<'a> _RSTSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 1"] - #[inline] - pub fn rstxs(&self) -> RSTXSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RSTXSR { bits } - } - #[doc = "Bit 0"] - #[inline] - pub fn rsts(&self) -> RSTSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - RSTSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 1"] - #[inline] - pub fn rstxs(&mut self) -> _RSTXSW { - _RSTXSW { w: self } - } - #[doc = "Bit 0"] - #[inline] - pub fn rsts(&mut self) -> _RSTSW { - _RSTSW { w: self } - } - } - } - #[doc = "DMA timing control register."] - pub struct EARLYDMA { - register: ::vcell::VolatileCell<u8>, - } - #[doc = "DMA timing control register."] - pub mod earlydma { - #[doc = r" Value read from the register"] - pub struct R { - bits: u8, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u8, - } - impl super::EARLYDMA { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct EDMAINR { - bits: bool, - } - impl EDMAINR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct EDMAOUTR { - bits: bool, - } - impl EDMAOUTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _EDMAINW<'a> { - w: &'a mut W, - } - impl<'a> _EDMAINW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _EDMAOUTW<'a> { - w: &'a mut W, - } - impl<'a> _EDMAOUTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u8) << OFFSET); - self.w.bits |= ((value & MASK) as u8) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - self.bits - } - #[doc = "Bit 1"] - #[inline] - pub fn edmain(&self) -> EDMAINR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - EDMAINR { bits } - } - #[doc = "Bit 0"] - #[inline] - pub fn edmaout(&self) -> EDMAOUTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u8) != 0 - }; - EDMAOUTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 1"] - #[inline] - pub fn edmain(&mut self) -> _EDMAINW { - _EDMAINW { w: self } - } - #[doc = "Bit 0"] - #[inline] - pub fn edmaout(&mut self) -> _EDMAOUTW { - _EDMAOUTW { w: self } - } - } - } - #[doc = "Chirp timeout timer setting."] - pub struct CTUCH { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Chirp timeout timer setting."] - pub mod ctuch { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::CTUCH { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct C_T_UCHR { - bits: u16, - } - impl C_T_UCHR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _C_T_UCHW<'a> { - w: &'a mut W, - } - impl<'a> _C_T_UCHW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - HS Chirp Timeout Clock Cycles. This configures the chirp timeout used by this device to negotiate a HS connection with a FS Host."] - #[inline] - pub fn c_t_uch(&self) -> C_T_UCHR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - C_T_UCHR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - HS Chirp Timeout Clock Cycles. This configures the chirp timeout used by this device to negotiate a HS connection with a FS Host."] - #[inline] - pub fn c_t_uch(&mut self) -> _C_T_UCHW { - _C_T_UCHW { w: self } - } - } - } - #[doc = "Sets delay between HS resume to UTM normal operating mode."] - pub struct CTHSRTN { - register: ::vcell::VolatileCell<u16>, - } - #[doc = "Sets delay between HS resume to UTM normal operating mode."] - pub mod cthsrtn { - #[doc = r" Value read from the register"] - pub struct R { - bits: u16, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u16, - } - impl super::CTHSRTN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct C_T_HSTRNR { - bits: u16, - } - impl C_T_HSTRNR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - } - #[doc = r" Proxy"] - pub struct _C_T_HSTRNW<'a> { - w: &'a mut W, - } - impl<'a> _C_T_HSTRNW<'a> { - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u16) -> &'a mut W { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u16) << OFFSET); - self.w.bits |= ((value & MASK) as u16) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u16 { - self.bits - } - #[doc = "Bits 0:15 - High Speed Resume Delay Clock Cycles. This configures the delay from when the RESUME state on the bus ends, the when the USBHS resumes normal operation."] - #[inline] - pub fn c_t_hstrn(&self) -> C_T_HSTRNR { - let bits = { - const MASK: u16 = 0xffff; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u16) as u16 - }; - C_T_HSTRNR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:15 - High Speed Resume Delay Clock Cycles. This configures the delay from when the RESUME state on the bus ends, the when the USBHS resumes normal operation."] - #[inline] - pub fn c_t_hstrn(&mut self) -> _C_T_HSTRNW { - _C_T_HSTRNW { w: self } - } - } - } - #[doc = "M31_PHY_PONRST"] - pub struct M31_PHY_PONRST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_PONRST"] - pub mod m31_phy_ponrst { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_PONRST { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_NONCRY_RSTB"] - pub struct M31_PHY_NONCRY_RSTB { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_NONCRY_RSTB"] - pub mod m31_phy_noncry_rstb { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_NONCRY_RSTB { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_NONCRY_EN"] - pub struct M31_PHY_NONCRY_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_NONCRY_EN"] - pub mod m31_phy_noncry_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_NONCRY_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_PLL_EN"] - pub struct M31_PHY_PLL_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_PLL_EN"] - pub mod m31_phy_pll_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_PLL_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_OSCOUTEN"] - pub struct M31_PHY_OSCOUTEN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_OSCOUTEN"] - pub mod m31_phy_oscouten { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_OSCOUTEN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_CORECLKIN"] - pub struct M31_PHY_CORECLKIN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_CORECLKIN"] - pub mod m31_phy_coreclkin { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_CORECLKIN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_XTLSEL"] - pub struct M31_PHY_XTLSEL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_XTLSEL"] - pub mod m31_phy_xtlsel { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_XTLSEL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "M31_PHY_OUTCLKSEL"] - pub struct M31_PHY_OUTCLKSEL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "M31_PHY_OUTCLKSEL"] - pub mod m31_phy_outclksel { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::M31_PHY_OUTCLKSEL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - } - } - #[doc = "USB Added Maxim Interrupt Flag Register."] - pub struct MXM_INT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "USB Added Maxim Interrupt Flag Register."] - pub mod mxm_int { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MXM_INT { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VBUSR { - bits: bool, - } - impl VBUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct NOVBUSR { - bits: bool, - } - impl NOVBUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _VBUSW<'a> { - w: &'a mut W, - } - impl<'a> _VBUSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NOVBUSW<'a> { - w: &'a mut W, - } - impl<'a> _NOVBUSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - VBUS"] - #[inline] - pub fn vbus(&self) -> VBUSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - VBUSR { bits } - } - #[doc = "Bit 1 - NOVBUS"] - #[inline] - pub fn novbus(&self) -> NOVBUSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - NOVBUSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - VBUS"] - #[inline] - pub fn vbus(&mut self) -> _VBUSW { - _VBUSW { w: self } - } - #[doc = "Bit 1 - NOVBUS"] - #[inline] - pub fn novbus(&mut self) -> _NOVBUSW { - _NOVBUSW { w: self } - } - } - } - #[doc = "USB Added Maxim Interrupt Enable Register."] - pub struct MXM_INT_EN { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "USB Added Maxim Interrupt Enable Register."] - pub mod mxm_int_en { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MXM_INT_EN { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VBUSR { - bits: bool, - } - impl VBUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct NOVBUSR { - bits: bool, - } - impl NOVBUSR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _VBUSW<'a> { - w: &'a mut W, - } - impl<'a> _VBUSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _NOVBUSW<'a> { - w: &'a mut W, - } - impl<'a> _NOVBUSW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - VBUS"] - #[inline] - pub fn vbus(&self) -> VBUSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - VBUSR { bits } - } - #[doc = "Bit 1 - NOVBUS"] - #[inline] - pub fn novbus(&self) -> NOVBUSR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - NOVBUSR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - VBUS"] - #[inline] - pub fn vbus(&mut self) -> _VBUSW { - _VBUSW { w: self } - } - #[doc = "Bit 1 - NOVBUS"] - #[inline] - pub fn novbus(&mut self) -> _NOVBUSW { - _NOVBUSW { w: self } - } - } - } - #[doc = "USB Added Maxim Suspend Register."] - pub struct MXM_SUSPEND { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "USB Added Maxim Suspend Register."] - pub mod mxm_suspend { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MXM_SUSPEND { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct SELR { - bits: bool, - } - impl SELR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _SELW<'a> { - w: &'a mut W, - } - impl<'a> _SELW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - Suspend register"] - #[inline] - pub fn sel(&self) -> SELR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - SELR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - Suspend register"] - #[inline] - pub fn sel(&mut self) -> _SELW { - _SELW { w: self } - } - } - } - #[doc = "USB Added Maxim Power Status Register"] - pub struct MXM_REG_A4 { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "USB Added Maxim Power Status Register"] - pub mod mxm_reg_a4 { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::MXM_REG_A4 { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = r" Value of the field"] - pub struct VRST_VDDB_N_AR { - bits: bool, - } - impl VRST_VDDB_N_AR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Value of the field"] - pub struct DMA_INTR { - bits: bool, - } - impl DMA_INTR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - self.bits - } - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - } - #[doc = r" Proxy"] - pub struct _VRST_VDDB_N_AW<'a> { - w: &'a mut W, - } - impl<'a> _VRST_VDDB_N_AW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = r" Proxy"] - pub struct _DMA_INTW<'a> { - w: &'a mut W, - } - impl<'a> _DMA_INTW<'a> { - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 1; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bit 0 - VRST_VDDB_N_A"] - #[inline] - pub fn vrst_vddb_n_a(&self) -> VRST_VDDB_N_AR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - VRST_VDDB_N_AR { bits } - } - #[doc = "Bit 1 - DMA_INT"] - #[inline] - pub fn dma_int(&self) -> DMA_INTR { - let bits = { - const MASK: bool = true; - const OFFSET: u8 = 1; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }; - DMA_INTR { bits } - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bit 0 - VRST_VDDB_N_A"] - #[inline] - pub fn vrst_vddb_n_a(&mut self) -> _VRST_VDDB_N_AW { - _VRST_VDDB_N_AW { w: self } - } - #[doc = "Bit 1 - DMA_INT"] - #[inline] - pub fn dma_int(&mut self) -> _DMA_INTW { - _DMA_INTW { w: self } - } - } - } -} -#[doc = "Watchdog Timer 0"] -pub struct WDT0 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for WDT0 {} -impl WDT0 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const wdt0::RegisterBlock { - 0x4000_3000 as *const _ - } -} -impl Deref for WDT0 { - type Target = wdt0::RegisterBlock; - fn deref(&self) -> &wdt0::RegisterBlock { - unsafe { &*WDT0::ptr() } - } -} -#[doc = "Watchdog Timer 0"] -pub mod wdt0 { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Watchdog Timer Control Register."] - pub ctrl: CTRL, - #[doc = "0x04 - Watchdog Timer Reset Register."] - pub rst: RST, - } - #[doc = "Watchdog Timer Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Watchdog Timer Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::CTRL { - #[doc = r" Modifies the contents of the register"] - #[inline] - pub fn modify<F>(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - let r = R { bits: bits }; - let mut w = W { bits: bits }; - f(&r, &mut w); - self.register.set(w.bits); - } - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - #[doc = r" Writes the reset value to the register"] - #[inline] - pub fn reset(&self) { - self.write(|w| w) - } - } - #[doc = "Possible values of the field `INT_PERIOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_PERIODR { - #[doc = "2**31 clock cycles."] - WDT2POW31, - #[doc = "2**30 clock cycles."] - WDT2POW30, - #[doc = "2**29 clock cycles."] - WDT2POW29, - #[doc = "2**28 clock cycles."] - WDT2POW28, - #[doc = "2^27 clock cycles."] - WDT2POW27, - #[doc = "2**26 clock cycles."] - WDT2POW26, - #[doc = "2**25 clock cycles."] - WDT2POW25, - #[doc = "2**24 clock cycles."] - WDT2POW24, - #[doc = "2**23 clock cycles."] - WDT2POW23, - #[doc = "2**22 clock cycles."] - WDT2POW22, - #[doc = "2**21 clock cycles."] - WDT2POW21, - #[doc = "2**20 clock cycles."] - WDT2POW20, - #[doc = "2**19 clock cycles."] - WDT2POW19, - #[doc = "2**18 clock cycles."] - WDT2POW18, - #[doc = "2**17 clock cycles."] - WDT2POW17, - #[doc = "2**16 clock cycles."] - WDT2POW16, - } - impl INT_PERIODR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - INT_PERIODR::WDT2POW31 => 0, - INT_PERIODR::WDT2POW30 => 0x01, - INT_PERIODR::WDT2POW29 => 0x02, - INT_PERIODR::WDT2POW28 => 0x03, - INT_PERIODR::WDT2POW27 => 0x04, - INT_PERIODR::WDT2POW26 => 0x05, - INT_PERIODR::WDT2POW25 => 0x06, - INT_PERIODR::WDT2POW24 => 0x07, - INT_PERIODR::WDT2POW23 => 0x08, - INT_PERIODR::WDT2POW22 => 0x09, - INT_PERIODR::WDT2POW21 => 0x0a, - INT_PERIODR::WDT2POW20 => 0x0b, - INT_PERIODR::WDT2POW19 => 0x0c, - INT_PERIODR::WDT2POW18 => 0x0d, - INT_PERIODR::WDT2POW17 => 0x0e, - INT_PERIODR::WDT2POW16 => 0x0f, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> INT_PERIODR { - match value { - 0 => INT_PERIODR::WDT2POW31, - 1 => INT_PERIODR::WDT2POW30, - 2 => INT_PERIODR::WDT2POW29, - 3 => INT_PERIODR::WDT2POW28, - 4 => INT_PERIODR::WDT2POW27, - 5 => INT_PERIODR::WDT2POW26, - 6 => INT_PERIODR::WDT2POW25, - 7 => INT_PERIODR::WDT2POW24, - 8 => INT_PERIODR::WDT2POW23, - 9 => INT_PERIODR::WDT2POW22, - 10 => INT_PERIODR::WDT2POW21, - 11 => INT_PERIODR::WDT2POW20, - 12 => INT_PERIODR::WDT2POW19, - 13 => INT_PERIODR::WDT2POW18, - 14 => INT_PERIODR::WDT2POW17, - 15 => INT_PERIODR::WDT2POW16, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `WDT2POW31`"] - #[inline] - pub fn is_wdt2pow31(&self) -> bool { - *self == INT_PERIODR::WDT2POW31 - } - #[doc = "Checks if the value of the field is `WDT2POW30`"] - #[inline] - pub fn is_wdt2pow30(&self) -> bool { - *self == INT_PERIODR::WDT2POW30 - } - #[doc = "Checks if the value of the field is `WDT2POW29`"] - #[inline] - pub fn is_wdt2pow29(&self) -> bool { - *self == INT_PERIODR::WDT2POW29 - } - #[doc = "Checks if the value of the field is `WDT2POW28`"] - #[inline] - pub fn is_wdt2pow28(&self) -> bool { - *self == INT_PERIODR::WDT2POW28 - } - #[doc = "Checks if the value of the field is `WDT2POW27`"] - #[inline] - pub fn is_wdt2pow27(&self) -> bool { - *self == INT_PERIODR::WDT2POW27 - } - #[doc = "Checks if the value of the field is `WDT2POW26`"] - #[inline] - pub fn is_wdt2pow26(&self) -> bool { - *self == INT_PERIODR::WDT2POW26 - } - #[doc = "Checks if the value of the field is `WDT2POW25`"] - #[inline] - pub fn is_wdt2pow25(&self) -> bool { - *self == INT_PERIODR::WDT2POW25 - } - #[doc = "Checks if the value of the field is `WDT2POW24`"] - #[inline] - pub fn is_wdt2pow24(&self) -> bool { - *self == INT_PERIODR::WDT2POW24 - } - #[doc = "Checks if the value of the field is `WDT2POW23`"] - #[inline] - pub fn is_wdt2pow23(&self) -> bool { - *self == INT_PERIODR::WDT2POW23 - } - #[doc = "Checks if the value of the field is `WDT2POW22`"] - #[inline] - pub fn is_wdt2pow22(&self) -> bool { - *self == INT_PERIODR::WDT2POW22 - } - #[doc = "Checks if the value of the field is `WDT2POW21`"] - #[inline] - pub fn is_wdt2pow21(&self) -> bool { - *self == INT_PERIODR::WDT2POW21 - } - #[doc = "Checks if the value of the field is `WDT2POW20`"] - #[inline] - pub fn is_wdt2pow20(&self) -> bool { - *self == INT_PERIODR::WDT2POW20 - } - #[doc = "Checks if the value of the field is `WDT2POW19`"] - #[inline] - pub fn is_wdt2pow19(&self) -> bool { - *self == INT_PERIODR::WDT2POW19 - } - #[doc = "Checks if the value of the field is `WDT2POW18`"] - #[inline] - pub fn is_wdt2pow18(&self) -> bool { - *self == INT_PERIODR::WDT2POW18 - } - #[doc = "Checks if the value of the field is `WDT2POW17`"] - #[inline] - pub fn is_wdt2pow17(&self) -> bool { - *self == INT_PERIODR::WDT2POW17 - } - #[doc = "Checks if the value of the field is `WDT2POW16`"] - #[inline] - pub fn is_wdt2pow16(&self) -> bool { - *self == INT_PERIODR::WDT2POW16 - } - } - #[doc = "Possible values of the field `RST_PERIOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_PERIODR { - #[doc = "2**31 clock cycles."] - WDT2POW31, - #[doc = "2**30 clock cycles."] - WDT2POW30, - #[doc = "2**29 clock cycles."] - WDT2POW29, - #[doc = "2**28 clock cycles."] - WDT2POW28, - #[doc = "2^27 clock cycles."] - WDT2POW27, - #[doc = "2**26 clock cycles."] - WDT2POW26, - #[doc = "2**25 clock cycles."] - WDT2POW25, - #[doc = "2**24 clock cycles."] - WDT2POW24, - #[doc = "2**23 clock cycles."] - WDT2POW23, - #[doc = "2**22 clock cycles."] - WDT2POW22, - #[doc = "2**21 clock cycles."] - WDT2POW21, - #[doc = "2**20 clock cycles."] - WDT2POW20, - #[doc = "2**19 clock cycles."] - WDT2POW19, - #[doc = "2**18 clock cycles."] - WDT2POW18, - #[doc = "2**17 clock cycles."] - WDT2POW17, - #[doc = "2**16 clock cycles."] - WDT2POW16, - } - impl RST_PERIODR { - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bits(&self) -> u8 { - match *self { - RST_PERIODR::WDT2POW31 => 0, - RST_PERIODR::WDT2POW30 => 0x01, - RST_PERIODR::WDT2POW29 => 0x02, - RST_PERIODR::WDT2POW28 => 0x03, - RST_PERIODR::WDT2POW27 => 0x04, - RST_PERIODR::WDT2POW26 => 0x05, - RST_PERIODR::WDT2POW25 => 0x06, - RST_PERIODR::WDT2POW24 => 0x07, - RST_PERIODR::WDT2POW23 => 0x08, - RST_PERIODR::WDT2POW22 => 0x09, - RST_PERIODR::WDT2POW21 => 0x0a, - RST_PERIODR::WDT2POW20 => 0x0b, - RST_PERIODR::WDT2POW19 => 0x0c, - RST_PERIODR::WDT2POW18 => 0x0d, - RST_PERIODR::WDT2POW17 => 0x0e, - RST_PERIODR::WDT2POW16 => 0x0f, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: u8) -> RST_PERIODR { - match value { - 0 => RST_PERIODR::WDT2POW31, - 1 => RST_PERIODR::WDT2POW30, - 2 => RST_PERIODR::WDT2POW29, - 3 => RST_PERIODR::WDT2POW28, - 4 => RST_PERIODR::WDT2POW27, - 5 => RST_PERIODR::WDT2POW26, - 6 => RST_PERIODR::WDT2POW25, - 7 => RST_PERIODR::WDT2POW24, - 8 => RST_PERIODR::WDT2POW23, - 9 => RST_PERIODR::WDT2POW22, - 10 => RST_PERIODR::WDT2POW21, - 11 => RST_PERIODR::WDT2POW20, - 12 => RST_PERIODR::WDT2POW19, - 13 => RST_PERIODR::WDT2POW18, - 14 => RST_PERIODR::WDT2POW17, - 15 => RST_PERIODR::WDT2POW16, - _ => unreachable!(), - } - } - #[doc = "Checks if the value of the field is `WDT2POW31`"] - #[inline] - pub fn is_wdt2pow31(&self) -> bool { - *self == RST_PERIODR::WDT2POW31 - } - #[doc = "Checks if the value of the field is `WDT2POW30`"] - #[inline] - pub fn is_wdt2pow30(&self) -> bool { - *self == RST_PERIODR::WDT2POW30 - } - #[doc = "Checks if the value of the field is `WDT2POW29`"] - #[inline] - pub fn is_wdt2pow29(&self) -> bool { - *self == RST_PERIODR::WDT2POW29 - } - #[doc = "Checks if the value of the field is `WDT2POW28`"] - #[inline] - pub fn is_wdt2pow28(&self) -> bool { - *self == RST_PERIODR::WDT2POW28 - } - #[doc = "Checks if the value of the field is `WDT2POW27`"] - #[inline] - pub fn is_wdt2pow27(&self) -> bool { - *self == RST_PERIODR::WDT2POW27 - } - #[doc = "Checks if the value of the field is `WDT2POW26`"] - #[inline] - pub fn is_wdt2pow26(&self) -> bool { - *self == RST_PERIODR::WDT2POW26 - } - #[doc = "Checks if the value of the field is `WDT2POW25`"] - #[inline] - pub fn is_wdt2pow25(&self) -> bool { - *self == RST_PERIODR::WDT2POW25 - } - #[doc = "Checks if the value of the field is `WDT2POW24`"] - #[inline] - pub fn is_wdt2pow24(&self) -> bool { - *self == RST_PERIODR::WDT2POW24 - } - #[doc = "Checks if the value of the field is `WDT2POW23`"] - #[inline] - pub fn is_wdt2pow23(&self) -> bool { - *self == RST_PERIODR::WDT2POW23 - } - #[doc = "Checks if the value of the field is `WDT2POW22`"] - #[inline] - pub fn is_wdt2pow22(&self) -> bool { - *self == RST_PERIODR::WDT2POW22 - } - #[doc = "Checks if the value of the field is `WDT2POW21`"] - #[inline] - pub fn is_wdt2pow21(&self) -> bool { - *self == RST_PERIODR::WDT2POW21 - } - #[doc = "Checks if the value of the field is `WDT2POW20`"] - #[inline] - pub fn is_wdt2pow20(&self) -> bool { - *self == RST_PERIODR::WDT2POW20 - } - #[doc = "Checks if the value of the field is `WDT2POW19`"] - #[inline] - pub fn is_wdt2pow19(&self) -> bool { - *self == RST_PERIODR::WDT2POW19 - } - #[doc = "Checks if the value of the field is `WDT2POW18`"] - #[inline] - pub fn is_wdt2pow18(&self) -> bool { - *self == RST_PERIODR::WDT2POW18 - } - #[doc = "Checks if the value of the field is `WDT2POW17`"] - #[inline] - pub fn is_wdt2pow17(&self) -> bool { - *self == RST_PERIODR::WDT2POW17 - } - #[doc = "Checks if the value of the field is `WDT2POW16`"] - #[inline] - pub fn is_wdt2pow16(&self) -> bool { - *self == RST_PERIODR::WDT2POW16 - } - } - #[doc = "Possible values of the field `WDT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WDT_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl WDT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - WDT_ENR::DIS => false, - WDT_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> WDT_ENR { - match value { - false => WDT_ENR::DIS, - true => WDT_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == WDT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == WDT_ENR::EN - } - } - #[doc = "Possible values of the field `INT_FLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_FLAGR { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl INT_FLAGR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INT_FLAGR::INACTIVE => false, - INT_FLAGR::PENDING => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INT_FLAGR { - match value { - false => INT_FLAGR::INACTIVE, - true => INT_FLAGR::PENDING, - } - } - #[doc = "Checks if the value of the field is `INACTIVE`"] - #[inline] - pub fn is_inactive(&self) -> bool { - *self == INT_FLAGR::INACTIVE - } - #[doc = "Checks if the value of the field is `PENDING`"] - #[inline] - pub fn is_pending(&self) -> bool { - *self == INT_FLAGR::PENDING - } - } - #[doc = "Possible values of the field `INT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl INT_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - INT_ENR::DIS => false, - INT_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> INT_ENR { - match value { - false => INT_ENR::DIS, - true => INT_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == INT_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == INT_ENR::EN - } - } - #[doc = "Possible values of the field `RST_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_ENR { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RST_ENR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RST_ENR::DIS => false, - RST_ENR::EN => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RST_ENR { - match value { - false => RST_ENR::DIS, - true => RST_ENR::EN, - } - } - #[doc = "Checks if the value of the field is `DIS`"] - #[inline] - pub fn is_dis(&self) -> bool { - *self == RST_ENR::DIS - } - #[doc = "Checks if the value of the field is `EN`"] - #[inline] - pub fn is_en(&self) -> bool { - *self == RST_ENR::EN - } - } - #[doc = "Possible values of the field `RST_FLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_FLAGR { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl RST_FLAGR { - #[doc = r" Returns `true` if the bit is clear (0)"] - #[inline] - pub fn bit_is_clear(&self) -> bool { - !self.bit() - } - #[doc = r" Returns `true` if the bit is set (1)"] - #[inline] - pub fn bit_is_set(&self) -> bool { - self.bit() - } - #[doc = r" Value of the field as raw bits"] - #[inline] - pub fn bit(&self) -> bool { - match *self { - RST_FLAGR::NOEVENT => false, - RST_FLAGR::OCCURRED => true, - } - } - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _from(value: bool) -> RST_FLAGR { - match value { - false => RST_FLAGR::NOEVENT, - true => RST_FLAGR::OCCURRED, - } - } - #[doc = "Checks if the value of the field is `NOEVENT`"] - #[inline] - pub fn is_no_event(&self) -> bool { - *self == RST_FLAGR::NOEVENT - } - #[doc = "Checks if the value of the field is `OCCURRED`"] - #[inline] - pub fn is_occurred(&self) -> bool { - *self == RST_FLAGR::OCCURRED - } - } - #[doc = "Values that can be written to the field `INT_PERIOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_PERIODW { - #[doc = "2**31 clock cycles."] - WDT2POW31, - #[doc = "2**30 clock cycles."] - WDT2POW30, - #[doc = "2**29 clock cycles."] - WDT2POW29, - #[doc = "2**28 clock cycles."] - WDT2POW28, - #[doc = "2^27 clock cycles."] - WDT2POW27, - #[doc = "2**26 clock cycles."] - WDT2POW26, - #[doc = "2**25 clock cycles."] - WDT2POW25, - #[doc = "2**24 clock cycles."] - WDT2POW24, - #[doc = "2**23 clock cycles."] - WDT2POW23, - #[doc = "2**22 clock cycles."] - WDT2POW22, - #[doc = "2**21 clock cycles."] - WDT2POW21, - #[doc = "2**20 clock cycles."] - WDT2POW20, - #[doc = "2**19 clock cycles."] - WDT2POW19, - #[doc = "2**18 clock cycles."] - WDT2POW18, - #[doc = "2**17 clock cycles."] - WDT2POW17, - #[doc = "2**16 clock cycles."] - WDT2POW16, - } - impl INT_PERIODW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - INT_PERIODW::WDT2POW31 => 0, - INT_PERIODW::WDT2POW30 => 1, - INT_PERIODW::WDT2POW29 => 2, - INT_PERIODW::WDT2POW28 => 3, - INT_PERIODW::WDT2POW27 => 4, - INT_PERIODW::WDT2POW26 => 5, - INT_PERIODW::WDT2POW25 => 6, - INT_PERIODW::WDT2POW24 => 7, - INT_PERIODW::WDT2POW23 => 8, - INT_PERIODW::WDT2POW22 => 9, - INT_PERIODW::WDT2POW21 => 10, - INT_PERIODW::WDT2POW20 => 11, - INT_PERIODW::WDT2POW19 => 12, - INT_PERIODW::WDT2POW18 => 13, - INT_PERIODW::WDT2POW17 => 14, - INT_PERIODW::WDT2POW16 => 15, - } - } - } - #[doc = r" Proxy"] - pub struct _INT_PERIODW<'a> { - w: &'a mut W, - } - impl<'a> _INT_PERIODW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INT_PERIODW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "2**31 clock cycles."] - #[inline] - pub fn wdt2pow31(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW31) - } - #[doc = "2**30 clock cycles."] - #[inline] - pub fn wdt2pow30(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW30) - } - #[doc = "2**29 clock cycles."] - #[inline] - pub fn wdt2pow29(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW29) - } - #[doc = "2**28 clock cycles."] - #[inline] - pub fn wdt2pow28(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW28) - } - #[doc = "2^27 clock cycles."] - #[inline] - pub fn wdt2pow27(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW27) - } - #[doc = "2**26 clock cycles."] - #[inline] - pub fn wdt2pow26(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW26) - } - #[doc = "2**25 clock cycles."] - #[inline] - pub fn wdt2pow25(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW25) - } - #[doc = "2**24 clock cycles."] - #[inline] - pub fn wdt2pow24(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW24) - } - #[doc = "2**23 clock cycles."] - #[inline] - pub fn wdt2pow23(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW23) - } - #[doc = "2**22 clock cycles."] - #[inline] - pub fn wdt2pow22(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW22) - } - #[doc = "2**21 clock cycles."] - #[inline] - pub fn wdt2pow21(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW21) - } - #[doc = "2**20 clock cycles."] - #[inline] - pub fn wdt2pow20(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW20) - } - #[doc = "2**19 clock cycles."] - #[inline] - pub fn wdt2pow19(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW19) - } - #[doc = "2**18 clock cycles."] - #[inline] - pub fn wdt2pow18(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW18) - } - #[doc = "2**17 clock cycles."] - #[inline] - pub fn wdt2pow17(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW17) - } - #[doc = "2**16 clock cycles."] - #[inline] - pub fn wdt2pow16(self) -> &'a mut W { - self.variant(INT_PERIODW::WDT2POW16) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RST_PERIOD`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_PERIODW { - #[doc = "2**31 clock cycles."] - WDT2POW31, - #[doc = "2**30 clock cycles."] - WDT2POW30, - #[doc = "2**29 clock cycles."] - WDT2POW29, - #[doc = "2**28 clock cycles."] - WDT2POW28, - #[doc = "2^27 clock cycles."] - WDT2POW27, - #[doc = "2**26 clock cycles."] - WDT2POW26, - #[doc = "2**25 clock cycles."] - WDT2POW25, - #[doc = "2**24 clock cycles."] - WDT2POW24, - #[doc = "2**23 clock cycles."] - WDT2POW23, - #[doc = "2**22 clock cycles."] - WDT2POW22, - #[doc = "2**21 clock cycles."] - WDT2POW21, - #[doc = "2**20 clock cycles."] - WDT2POW20, - #[doc = "2**19 clock cycles."] - WDT2POW19, - #[doc = "2**18 clock cycles."] - WDT2POW18, - #[doc = "2**17 clock cycles."] - WDT2POW17, - #[doc = "2**16 clock cycles."] - WDT2POW16, - } - impl RST_PERIODW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - RST_PERIODW::WDT2POW31 => 0, - RST_PERIODW::WDT2POW30 => 1, - RST_PERIODW::WDT2POW29 => 2, - RST_PERIODW::WDT2POW28 => 3, - RST_PERIODW::WDT2POW27 => 4, - RST_PERIODW::WDT2POW26 => 5, - RST_PERIODW::WDT2POW25 => 6, - RST_PERIODW::WDT2POW24 => 7, - RST_PERIODW::WDT2POW23 => 8, - RST_PERIODW::WDT2POW22 => 9, - RST_PERIODW::WDT2POW21 => 10, - RST_PERIODW::WDT2POW20 => 11, - RST_PERIODW::WDT2POW19 => 12, - RST_PERIODW::WDT2POW18 => 13, - RST_PERIODW::WDT2POW17 => 14, - RST_PERIODW::WDT2POW16 => 15, - } - } - } - #[doc = r" Proxy"] - pub struct _RST_PERIODW<'a> { - w: &'a mut W, - } - impl<'a> _RST_PERIODW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RST_PERIODW) -> &'a mut W { - { - self.bits(variant._bits()) - } - } - #[doc = "2**31 clock cycles."] - #[inline] - pub fn wdt2pow31(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW31) - } - #[doc = "2**30 clock cycles."] - #[inline] - pub fn wdt2pow30(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW30) - } - #[doc = "2**29 clock cycles."] - #[inline] - pub fn wdt2pow29(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW29) - } - #[doc = "2**28 clock cycles."] - #[inline] - pub fn wdt2pow28(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW28) - } - #[doc = "2^27 clock cycles."] - #[inline] - pub fn wdt2pow27(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW27) - } - #[doc = "2**26 clock cycles."] - #[inline] - pub fn wdt2pow26(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW26) - } - #[doc = "2**25 clock cycles."] - #[inline] - pub fn wdt2pow25(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW25) - } - #[doc = "2**24 clock cycles."] - #[inline] - pub fn wdt2pow24(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW24) - } - #[doc = "2**23 clock cycles."] - #[inline] - pub fn wdt2pow23(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW23) - } - #[doc = "2**22 clock cycles."] - #[inline] - pub fn wdt2pow22(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW22) - } - #[doc = "2**21 clock cycles."] - #[inline] - pub fn wdt2pow21(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW21) - } - #[doc = "2**20 clock cycles."] - #[inline] - pub fn wdt2pow20(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW20) - } - #[doc = "2**19 clock cycles."] - #[inline] - pub fn wdt2pow19(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW19) - } - #[doc = "2**18 clock cycles."] - #[inline] - pub fn wdt2pow18(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW18) - } - #[doc = "2**17 clock cycles."] - #[inline] - pub fn wdt2pow17(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW17) - } - #[doc = "2**16 clock cycles."] - #[inline] - pub fn wdt2pow16(self) -> &'a mut W { - self.variant(RST_PERIODW::WDT2POW16) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `WDT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WDT_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl WDT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - WDT_ENW::DIS => false, - WDT_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _WDT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _WDT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WDT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(WDT_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(WDT_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 8; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `INT_FLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_FLAGW { - #[doc = "No interrupt is pending."] - INACTIVE, - #[doc = "An interrupt is pending."] - PENDING, - } - impl INT_FLAGW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INT_FLAGW::INACTIVE => false, - INT_FLAGW::PENDING => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INT_FLAGW<'a> { - w: &'a mut W, - } - impl<'a> _INT_FLAGW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INT_FLAGW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "No interrupt is pending."] - #[inline] - pub fn inactive(self) -> &'a mut W { - self.variant(INT_FLAGW::INACTIVE) - } - #[doc = "An interrupt is pending."] - #[inline] - pub fn pending(self) -> &'a mut W { - self.variant(INT_FLAGW::PENDING) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 9; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `INT_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum INT_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl INT_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - INT_ENW::DIS => false, - INT_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _INT_ENW<'a> { - w: &'a mut W, - } - impl<'a> _INT_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: INT_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(INT_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(INT_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 10; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RST_EN`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_ENW { - #[doc = "Disable."] - DIS, - #[doc = "Enable."] - EN, - } - impl RST_ENW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RST_ENW::DIS => false, - RST_ENW::EN => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RST_ENW<'a> { - w: &'a mut W, - } - impl<'a> _RST_ENW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RST_ENW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "Disable."] - #[inline] - pub fn dis(self) -> &'a mut W { - self.variant(RST_ENW::DIS) - } - #[doc = "Enable."] - #[inline] - pub fn en(self) -> &'a mut W { - self.variant(RST_ENW::EN) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 11; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - #[doc = "Values that can be written to the field `RST_FLAG`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum RST_FLAGW { - #[doc = "The event has not occurred."] - NOEVENT, - #[doc = "The event has occurred."] - OCCURRED, - } - impl RST_FLAGW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> bool { - match *self { - RST_FLAGW::NOEVENT => false, - RST_FLAGW::OCCURRED => true, - } - } - } - #[doc = r" Proxy"] - pub struct _RST_FLAGW<'a> { - w: &'a mut W, - } - impl<'a> _RST_FLAGW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: RST_FLAGW) -> &'a mut W { - { - self.bit(variant._bits()) - } - } - #[doc = "The event has not occurred."] - #[inline] - pub fn no_event(self) -> &'a mut W { - self.variant(RST_FLAGW::NOEVENT) - } - #[doc = "The event has occurred."] - #[inline] - pub fn occurred(self) -> &'a mut W { - self.variant(RST_FLAGW::OCCURRED) - } - #[doc = r" Sets the field bit"] - pub fn set_bit(self) -> &'a mut W { - self.bit(true) - } - #[doc = r" Clears the field bit"] - pub fn clear_bit(self) -> &'a mut W { - self.bit(false) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub fn bit(self, value: bool) -> &'a mut W { - const MASK: bool = true; - const OFFSET: u8 = 31; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - #[doc = "Bits 0:3 - Watchdog Interrupt Period. The watchdog timer will assert an interrupt, if enabled, if the CPU does not write the watchdog reset sequence to the WDT_RST register before the watchdog timer has counted this time period since the last timer reset."] - #[inline] - pub fn int_period(&self) -> INT_PERIODR { - INT_PERIODR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 0; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bits 4:7 - Watchdog Reset Period. The watchdog timer will assert a reset, if enabled, if the CPU does not write the watchdog reset sequence to the WDT_RST register before the watchdog timer has counted this time period since the last timer reset."] - #[inline] - pub fn rst_period(&self) -> RST_PERIODR { - RST_PERIODR::_from({ - const MASK: u8 = 0x0f; - const OFFSET: u8 = 4; - ((self.bits >> OFFSET) & MASK as u32) as u8 - }) - } - #[doc = "Bit 8 - Watchdog Timer Enable."] - #[inline] - pub fn wdt_en(&self) -> WDT_ENR { - WDT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 8; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 9 - Watchdog Timer Interrupt Flag."] - #[inline] - pub fn int_flag(&self) -> INT_FLAGR { - INT_FLAGR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 9; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 10 - Watchdog Timer Interrupt Enable."] - #[inline] - pub fn int_en(&self) -> INT_ENR { - INT_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 10; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 11 - Watchdog Timer Reset Enable."] - #[inline] - pub fn rst_en(&self) -> RST_ENR { - RST_ENR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 11; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - #[doc = "Bit 31 - Watchdog Timer Reset Flag."] - #[inline] - pub fn rst_flag(&self) -> RST_FLAGR { - RST_FLAGR::_from({ - const MASK: bool = true; - const OFFSET: u8 = 31; - ((self.bits >> OFFSET) & MASK as u32) != 0 - }) - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:3 - Watchdog Interrupt Period. The watchdog timer will assert an interrupt, if enabled, if the CPU does not write the watchdog reset sequence to the WDT_RST register before the watchdog timer has counted this time period since the last timer reset."] - #[inline] - pub fn int_period(&mut self) -> _INT_PERIODW { - _INT_PERIODW { w: self } - } - #[doc = "Bits 4:7 - Watchdog Reset Period. The watchdog timer will assert a reset, if enabled, if the CPU does not write the watchdog reset sequence to the WDT_RST register before the watchdog timer has counted this time period since the last timer reset."] - #[inline] - pub fn rst_period(&mut self) -> _RST_PERIODW { - _RST_PERIODW { w: self } - } - #[doc = "Bit 8 - Watchdog Timer Enable."] - #[inline] - pub fn wdt_en(&mut self) -> _WDT_ENW { - _WDT_ENW { w: self } - } - #[doc = "Bit 9 - Watchdog Timer Interrupt Flag."] - #[inline] - pub fn int_flag(&mut self) -> _INT_FLAGW { - _INT_FLAGW { w: self } - } - #[doc = "Bit 10 - Watchdog Timer Interrupt Enable."] - #[inline] - pub fn int_en(&mut self) -> _INT_ENW { - _INT_ENW { w: self } - } - #[doc = "Bit 11 - Watchdog Timer Reset Enable."] - #[inline] - pub fn rst_en(&mut self) -> _RST_ENW { - _RST_ENW { w: self } - } - #[doc = "Bit 31 - Watchdog Timer Reset Flag."] - #[inline] - pub fn rst_flag(&mut self) -> _RST_FLAGW { - _RST_FLAGW { w: self } - } - } - } - #[doc = "Watchdog Timer Reset Register."] - pub struct RST { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Watchdog Timer Reset Register."] - pub mod rst { - #[doc = r" Value to write to the register"] - pub struct W { - bits: u32, - } - impl super::RST { - #[doc = r" Writes to the register"] - #[inline] - pub fn write<F>(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - let mut w = W::reset_value(); - f(&mut w); - self.register.set(w.bits); - } - } - #[doc = "Values that can be written to the field `WDT_RST`"] - #[derive(Clone, Copy, Debug, PartialEq)] - pub enum WDT_RSTW { - #[doc = "The first value to be written to reset the WDT."] - SEQ0, - #[doc = "The second value to be written to reset the WDT."] - SEQ1, - } - impl WDT_RSTW { - #[allow(missing_docs)] - #[doc(hidden)] - #[inline] - pub fn _bits(&self) -> u8 { - match *self { - WDT_RSTW::SEQ0 => 165, - WDT_RSTW::SEQ1 => 90, - } - } - } - #[doc = r" Proxy"] - pub struct _WDT_RSTW<'a> { - w: &'a mut W, - } - impl<'a> _WDT_RSTW<'a> { - #[doc = r" Writes `variant` to the field"] - #[inline] - pub fn variant(self, variant: WDT_RSTW) -> &'a mut W { - unsafe { self.bits(variant._bits()) } - } - #[doc = "The first value to be written to reset the WDT."] - #[inline] - pub fn seq0(self) -> &'a mut W { - self.variant(WDT_RSTW::SEQ0) - } - #[doc = "The second value to be written to reset the WDT."] - #[inline] - pub fn seq1(self) -> &'a mut W { - self.variant(WDT_RSTW::SEQ1) - } - #[doc = r" Writes raw bits to the field"] - #[inline] - pub unsafe fn bits(self, value: u8) -> &'a mut W { - const MASK: u8 = 0xff; - const OFFSET: u8 = 0; - self.w.bits &= !((MASK as u32) << OFFSET); - self.w.bits |= ((value & MASK) as u32) << OFFSET; - self.w - } - } - impl W { - #[doc = r" Reset value of the register"] - #[inline] - pub fn reset_value() -> W { - W { bits: 0 } - } - #[doc = r" Writes raw bits to the register"] - #[inline] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.bits = bits; - self - } - #[doc = "Bits 0:7 - Writing the watchdog counter 'reset sequence' to this register resets the watchdog counter. If the watchdog count exceeds INT_PERIOD then a watchdog interrupt will occur, if enabled. If the watchdog count exceeds RST_PERIOD then a watchdog reset will occur, if enabled."] - #[inline] - pub fn wdt_rst(&mut self) -> _WDT_RSTW { - _WDT_RSTW { w: self } - } - } - } -} -#[doc = "Watchdog Timer 0 1"] -pub struct WDT1 { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for WDT1 {} -impl WDT1 { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const wdt0::RegisterBlock { - 0x4000_3400 as *const _ - } -} -impl Deref for WDT1 { - type Target = wdt0::RegisterBlock; - fn deref(&self) -> &wdt0::RegisterBlock { - unsafe { &*WDT1::ptr() } - } -} -#[doc = "Wakeup Timer."] -pub struct WUT { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for WUT {} -impl WUT { - #[doc = r" Returns a pointer to the register block"] - pub fn ptr() -> *const wut::RegisterBlock { - 0x4000_6400 as *const _ - } -} -impl Deref for WUT { - type Target = wut::RegisterBlock; - fn deref(&self) -> &wut::RegisterBlock { - unsafe { &*WUT::ptr() } - } -} -#[doc = "Wakeup Timer."] -pub mod wut { - #[doc = r" Register block"] - #[repr(C)] - pub struct RegisterBlock { - #[doc = "0x00 - Wakeup Timer Count Register."] - pub cnt: CNT, - #[doc = "0x04 - Wakeup Timer Compare Register."] - pub cmp: CMP, - #[doc = "0x08 - Wakeup Timer PWM Register."] - pub pwm: PWM, - #[doc = "0x0c - Wakeup Timer Interrupt Register."] - pub intr: INTR, - #[doc = "0x10 - Wakeup Timer Control Register."] - pub ctrl: CTRL, - #[doc = "0x14 - Wakeup Timer Non-overlap Register."] - pub nolap: NOLAP, - #[doc = "0x18 - Wakeup Timer Base Band Event Timer Preset Register."] - pub preset: PRESET, - #[doc = "0x1c - Wakeup Timer Base Band Event Timer Preset Load Register."] - pub reload: RELOAD, - #[doc = "0x20 - Wakeup Timer Base Band Event Timer Snapshot Register."] - pub snapshot: SNAPSHOT, - } - #[doc = "Wakeup Timer Count Register."] - pub struct CNT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Count Register."] - pub mod cnt { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CNT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Compare Register."] - pub struct CMP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Compare Register."] - pub mod cmp { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CMP { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer PWM Register."] - pub struct PWM { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer PWM Register."] - pub mod pwm { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::PWM { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Interrupt Register."] - pub struct INTR { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Interrupt Register."] - pub mod intr { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::INTR { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Control Register."] - pub struct CTRL { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Control Register."] - pub mod ctrl { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::CTRL { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Non-overlap Register."] - pub struct NOLAP { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Non-overlap Register."] - pub mod nolap { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::NOLAP { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Base Band Event Timer Preset Register."] - pub struct PRESET { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Base Band Event Timer Preset Register."] - pub mod preset { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::PRESET { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Base Band Event Timer Preset Load Register."] - pub struct RELOAD { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Base Band Event Timer Preset Load Register."] - pub mod reload { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::RELOAD { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } - #[doc = "Wakeup Timer Base Band Event Timer Snapshot Register."] - pub struct SNAPSHOT { - register: ::vcell::VolatileCell<u32>, - } - #[doc = "Wakeup Timer Base Band Event Timer Snapshot Register."] - pub mod snapshot { - #[doc = r" Value read from the register"] - pub struct R { - bits: u32, - } - impl super::SNAPSHOT { - #[doc = r" Reads the contents of the register"] - #[inline] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - } - } - } - impl R { - #[doc = r" Value of the register as raw bits"] - #[inline] - pub fn bits(&self) -> u32 { - self.bits - } - } - } -} -#[no_mangle] -static mut DEVICE_PERIPHERALS: bool = false; -#[doc = r" All the peripherals"] -#[allow(non_snake_case)] -pub struct Peripherals { - #[doc = "ADC"] - pub ADC: ADC, - #[doc = "MCR"] - pub MCR: MCR, - #[doc = "TPU"] - pub TPU: TPU, - #[doc = "AES_KEY"] - pub AES_KEY: AES_KEY, - #[doc = "EMCC"] - pub EMCC: EMCC, - #[doc = "DMA"] - pub DMA: DMA, - #[doc = "FLC"] - pub FLC: FLC, - #[doc = "GCR"] - pub GCR: GCR, - #[doc = "GPIO0"] - pub GPIO0: GPIO0, - #[doc = "GPIO1"] - pub GPIO1: GPIO1, - #[doc = "GPIO2"] - pub GPIO2: GPIO2, - #[doc = "HTMR"] - pub HTMR: HTMR, - #[doc = "HTMR1"] - pub HTMR1: HTMR1, - #[doc = "I2C0"] - pub I2C0: I2C0, - #[doc = "I2C1"] - pub I2C1: I2C1, - #[doc = "I2C2"] - pub I2C2: I2C2, - #[doc = "ICC0"] - pub ICC0: ICC0, - #[doc = "ICC1"] - pub ICC1: ICC1, - #[doc = "FCR"] - pub FCR: FCR, - #[doc = "OWM"] - pub OWM: OWM, - #[doc = "PTG"] - pub PTG: PTG, - #[doc = "PT"] - pub PT: PT, - #[doc = "PT1"] - pub PT1: PT1, - #[doc = "PT2"] - pub PT2: PT2, - #[doc = "PT3"] - pub PT3: PT3, - #[doc = "PT4"] - pub PT4: PT4, - #[doc = "PT5"] - pub PT5: PT5, - #[doc = "PT6"] - pub PT6: PT6, - #[doc = "PT7"] - pub PT7: PT7, - #[doc = "PT8"] - pub PT8: PT8, - #[doc = "PT9"] - pub PT9: PT9, - #[doc = "PT10"] - pub PT10: PT10, - #[doc = "PT11"] - pub PT11: PT11, - #[doc = "PT12"] - pub PT12: PT12, - #[doc = "PT13"] - pub PT13: PT13, - #[doc = "PT14"] - pub PT14: PT14, - #[doc = "PT15"] - pub PT15: PT15, - #[doc = "PWRSEQ"] - pub PWRSEQ: PWRSEQ, - #[doc = "RTC"] - pub RTC: RTC, - #[doc = "RPU"] - pub RPU: RPU, - #[doc = "SDHC"] - pub SDHC: SDHC, - #[doc = "SDMA"] - pub SDMA: SDMA, - #[doc = "SEMA"] - pub SEMA: SEMA, - #[doc = "SIMO"] - pub SIMO: SIMO, - #[doc = "SIR"] - pub SIR: SIR, - #[doc = "SMON"] - pub SMON: SMON, - #[doc = "SPIXR"] - pub SPIXR: SPIXR, - #[doc = "SPIXFC"] - pub SPIXFC: SPIXFC, - #[doc = "SPIXF_FIFO"] - pub SPIXF_FIFO: SPIXF_FIFO, - #[doc = "SPIXF"] - pub SPIXF: SPIXF, - #[doc = "SPI17Y"] - pub SPI17Y: SPI17Y, - #[doc = "SPI17Y1"] - pub SPI17Y1: SPI17Y1, - #[doc = "SPI17Y2"] - pub SPI17Y2: SPI17Y2, - #[doc = "TMR0"] - pub TMR0: TMR0, - #[doc = "TMR1"] - pub TMR1: TMR1, - #[doc = "TMR2"] - pub TMR2: TMR2, - #[doc = "TMR3"] - pub TMR3: TMR3, - #[doc = "TMR4"] - pub TMR4: TMR4, - #[doc = "TMR5"] - pub TMR5: TMR5, - #[doc = "TRNG"] - pub TRNG: TRNG, - #[doc = "UART0"] - pub UART0: UART0, - #[doc = "UART1"] - pub UART1: UART1, - #[doc = "UART2"] - pub UART2: UART2, - #[doc = "USBHS"] - pub USBHS: USBHS, - #[doc = "WDT0"] - pub WDT0: WDT0, - #[doc = "WDT1"] - pub WDT1: WDT1, - #[doc = "WUT"] - pub WUT: WUT, -} -impl Peripherals { - #[doc = r" Returns all the peripherals *once*"] - #[inline] - pub fn take() -> Option<Self> { - cortex_m::interrupt::free(|_| { - if unsafe { DEVICE_PERIPHERALS } { - None - } else { - Some(unsafe { Peripherals::steal() }) - } - }) - } - #[doc = r" Unchecked version of `Peripherals::take`"] - pub unsafe fn steal() -> Self { - debug_assert!(!DEVICE_PERIPHERALS); - DEVICE_PERIPHERALS = true; - Peripherals { - ADC: ADC { - _marker: PhantomData, - }, - MCR: MCR { - _marker: PhantomData, - }, - TPU: TPU { - _marker: PhantomData, - }, - AES_KEY: AES_KEY { - _marker: PhantomData, - }, - EMCC: EMCC { - _marker: PhantomData, - }, - DMA: DMA { - _marker: PhantomData, - }, - FLC: FLC { - _marker: PhantomData, - }, - GCR: GCR { - _marker: PhantomData, - }, - GPIO0: GPIO0 { - _marker: PhantomData, - }, - GPIO1: GPIO1 { - _marker: PhantomData, - }, - GPIO2: GPIO2 { - _marker: PhantomData, - }, - HTMR: HTMR { - _marker: PhantomData, - }, - HTMR1: HTMR1 { - _marker: PhantomData, - }, - I2C0: I2C0 { - _marker: PhantomData, - }, - I2C1: I2C1 { - _marker: PhantomData, - }, - I2C2: I2C2 { - _marker: PhantomData, - }, - ICC0: ICC0 { - _marker: PhantomData, - }, - ICC1: ICC1 { - _marker: PhantomData, - }, - FCR: FCR { - _marker: PhantomData, - }, - OWM: OWM { - _marker: PhantomData, - }, - PTG: PTG { - _marker: PhantomData, - }, - PT: PT { - _marker: PhantomData, - }, - PT1: PT1 { - _marker: PhantomData, - }, - PT2: PT2 { - _marker: PhantomData, - }, - PT3: PT3 { - _marker: PhantomData, - }, - PT4: PT4 { - _marker: PhantomData, - }, - PT5: PT5 { - _marker: PhantomData, - }, - PT6: PT6 { - _marker: PhantomData, - }, - PT7: PT7 { - _marker: PhantomData, - }, - PT8: PT8 { - _marker: PhantomData, - }, - PT9: PT9 { - _marker: PhantomData, - }, - PT10: PT10 { - _marker: PhantomData, - }, - PT11: PT11 { - _marker: PhantomData, - }, - PT12: PT12 { - _marker: PhantomData, - }, - PT13: PT13 { - _marker: PhantomData, - }, - PT14: PT14 { - _marker: PhantomData, - }, - PT15: PT15 { - _marker: PhantomData, - }, - PWRSEQ: PWRSEQ { - _marker: PhantomData, - }, - RTC: RTC { - _marker: PhantomData, - }, - RPU: RPU { - _marker: PhantomData, - }, - SDHC: SDHC { - _marker: PhantomData, - }, - SDMA: SDMA { - _marker: PhantomData, - }, - SEMA: SEMA { - _marker: PhantomData, - }, - SIMO: SIMO { - _marker: PhantomData, - }, - SIR: SIR { - _marker: PhantomData, - }, - SMON: SMON { - _marker: PhantomData, - }, - SPIXR: SPIXR { - _marker: PhantomData, - }, - SPIXFC: SPIXFC { - _marker: PhantomData, - }, - SPIXF_FIFO: SPIXF_FIFO { - _marker: PhantomData, - }, - SPIXF: SPIXF { - _marker: PhantomData, - }, - SPI17Y: SPI17Y { - _marker: PhantomData, - }, - SPI17Y1: SPI17Y1 { - _marker: PhantomData, - }, - SPI17Y2: SPI17Y2 { - _marker: PhantomData, - }, - TMR0: TMR0 { - _marker: PhantomData, - }, - TMR1: TMR1 { - _marker: PhantomData, - }, - TMR2: TMR2 { - _marker: PhantomData, - }, - TMR3: TMR3 { - _marker: PhantomData, - }, - TMR4: TMR4 { - _marker: PhantomData, - }, - TMR5: TMR5 { - _marker: PhantomData, - }, - TRNG: TRNG { - _marker: PhantomData, - }, - UART0: UART0 { - _marker: PhantomData, - }, - UART1: UART1 { - _marker: PhantomData, - }, - UART2: UART2 { - _marker: PhantomData, - }, - USBHS: USBHS { - _marker: PhantomData, - }, - WDT0: WDT0 { - _marker: PhantomData, - }, - WDT1: WDT1 { - _marker: PhantomData, - }, - WUT: WUT { - _marker: PhantomData, - }, - } - } -} diff --git a/watchapp/Cargo.toml b/watchapp/Cargo.toml deleted file mode 100644 index 10fde538e0f546f0d129b62215ab053faf180d67..0000000000000000000000000000000000000000 --- a/watchapp/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -edition = "2018" -name = "watchapp" -version = "0.0.0" -authors = ["Astro <astro@spaceboyz.net>"] - -[dependencies] -card10 = { path = "../card10" } -panic-abort = "0.3.1" diff --git a/watchapp/src/main.rs b/watchapp/src/main.rs deleted file mode 100644 index 994c34ea8273258fbc8f560a24d1f99ef26399e7..0000000000000000000000000000000000000000 --- a/watchapp/src/main.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![no_std] -#![no_main] - -use panic_abort as _; -use card10::{entry, lcd, leds::Leds}; - - -#[entry] -fn main() -> ! { - card10::init(); - let leds = Leds::new(); - - lcd::set_backlight(1000); - let mut t = 0; - loop { - for x in 0..lcd::W { - for y in 0..lcd::H { - if (((x - 2 * t) / 8) + ((y + t) / 8)) % 2 == 0 { - lcd::put_pixel(x, y, 0); - } else { - lcd::put_pixel(x, y, 0xffff); - } - } - } - lcd::update(); - - for led in leds.iter() { - led.set(((t << 2) & 0xFF) as u8, ((t << 1) & 0xFF) as u8, ((t >> 2) & 0xFF) as u8); - } - leds.update(); - - t += 1; - } -}