diff --git a/.github/workflows/clippy.yaml b/.github/workflows/clippy.yaml index 03996f4..2427b72 100644 --- a/.github/workflows/clippy.yaml +++ b/.github/workflows/clippy.yaml @@ -31,7 +31,7 @@ jobs: - name: Run clippy (direct mode) run: cargo clippy --features board-${{ matrix.board }} -- $CLIPPY_PARAMS - name: Run clippy (vectored mode) - run: cargo clippy --features virq,board-${{ matrix.board }} -- $CLIPPY_PARAMS + run: cargo clippy --features v-trap,board-${{ matrix.board }} -- $CLIPPY_PARAMS # Job to check that all the lint checks succeeded clippy-check: diff --git a/.github/workflows/e310x-hal.yaml b/.github/workflows/e310x-hal.yaml index 0ffea09..ea4af6b 100644 --- a/.github/workflows/e310x-hal.yaml +++ b/.github/workflows/e310x-hal.yaml @@ -11,8 +11,8 @@ jobs: build-riscv: strategy: matrix: - # All generated code should be running on stable now, MRSV is 1.72.0 - toolchain: [ stable, nightly, 1.72.0 ] + # All generated code should be running on stable now, MRSV is 1.76.0 + toolchain: [ stable, nightly, 1.76.0 ] include: # Nightly is only for reference and allowed to fail - toolchain: nightly diff --git a/.github/workflows/e310x.yaml b/.github/workflows/e310x.yaml index 8247a9f..f1336e7 100644 --- a/.github/workflows/e310x.yaml +++ b/.github/workflows/e310x.yaml @@ -11,8 +11,8 @@ jobs: build-riscv: strategy: matrix: - # All generated code should be running on stable now, MRSV is 1.72.0 - toolchain: [ stable, nightly, 1.72.0 ] + # All generated code should be running on stable now, MRSV is 1.76.0 + toolchain: [ stable, nightly, 1.76.0 ] include: # Nightly is only for reference and allowed to fail - toolchain: nightly diff --git a/.github/workflows/hifive1.yaml b/.github/workflows/hifive1.yaml index 0ff7f13..e644f21 100644 --- a/.github/workflows/hifive1.yaml +++ b/.github/workflows/hifive1.yaml @@ -11,8 +11,8 @@ jobs: build-riscv: strategy: matrix: - # All generated code should be running on stable now, MRSV is 1.72.0 - toolchain: [nightly, stable, 1.72.0] + # All generated code should be running on stable now, MRSV is 1.76.0 + toolchain: [nightly, stable, 1.76.0] board: [hifive1, hifive1-revb, redv, lofive, lofive-r1] include: # Nightly is only for reference and allowed to fail @@ -29,7 +29,7 @@ jobs: - name: Build (direct) run: cargo build --package hifive1 --features board-${{ matrix.board }} - name: Build (vectored) - run: cargo build --package hifive1 --features board-${{ matrix.board }},virq + run: cargo build --package hifive1 --features board-${{ matrix.board }},v-trap # On MacOS and Ubuntu, we at least make sure that the crate builds and links. # On Windows, linking fails when the rt feature is enabled. @@ -48,5 +48,5 @@ jobs: - name: Build (direct) run: cargo test --package hifive1 --features board-${{ matrix.board }} - name: Build (vectored) - run: cargo test --package hifive1 --features board-${{ matrix.board }},virq + run: cargo test --package hifive1 --features board-${{ matrix.board }},v-trap \ No newline at end of file diff --git a/e310x-hal/CHANGELOG.md b/e310x-hal/CHANGELOG.md index dd61301..9e8b183 100644 --- a/e310x-hal/CHANGELOG.md +++ b/e310x-hal/CHANGELOG.md @@ -8,11 +8,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Changed + +- Remove `virq` feature. Now interrupts are handled by `e310x` - Apply clippy changes - Use `portable-atomic` with `zaamo` feature to use native `amo*` operations. - Official target is now `riscv32imc-unknown-none-elf`, as it does not fully support the A extension. - Update `e310x` dependency and adapt code -- Bump MSRV to 1.72.0 to ensure a correct behavior of portable-atomic +- Bump MSRV to 1.76.0 to ensure a correct behavior of portable-atomic ## [v0.10.0] - 2023-03-28 diff --git a/e310x-hal/Cargo.toml b/e310x-hal/Cargo.toml index 57eaf03..33c148b 100644 --- a/e310x-hal/Cargo.toml +++ b/e310x-hal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "e310x-hal" -version = "0.11.0" +version = "0.12.0" authors = ["David Craven "] repository = "https://github.com/riscv-rust/e310x" categories = ["embedded", "hardware-support", "no-std"] @@ -8,18 +8,18 @@ description = "HAL for the E310x family of microcontrollers." keywords = ["riscv", "e310", "hal"] license = "ISC" edition = "2021" -rust-version = "1.72" +rust-version = "1.76" [dependencies] embedded-hal = { version = "0.2.6", features = ["unproven"] } nb = "1.0.0" -riscv = { version = "0.10.1", features = ["critical-section-single-hart"] } -e310x = { path = "../e310x", version = "0.11.0", features = ["rt", "critical-section"] } +riscv = { version = "0.12.1", features = ["critical-section-single-hart"] } +e310x = { path = "../e310x", version = "0.12.0", features = ["rt", "critical-section"] } portable-atomic = { version = "1.9", default-features = false} [features] g002 = ["e310x/g002"] -virq = [] +v-trap = ["e310x/v-trap"] [package.metadata.docs.rs] -features = ["g002", "virq"] +features = ["g002"] diff --git a/e310x-hal/src/clock.rs b/e310x-hal/src/clock.rs index 79fae5e..5399098 100644 --- a/e310x-hal/src/clock.rs +++ b/e310x-hal/src/clock.rs @@ -1,7 +1,6 @@ //! Clock configuration -use crate::core::clint::MTIME; use crate::time::Hertz; -use e310x::{Aonclk as AONCLK, Prci as PRCI}; +use e310x::{Aonclk as AONCLK, Prci as PRCI, CLINT}; use riscv::interrupt; use riscv::register::mcycle; @@ -229,7 +228,7 @@ impl CoreClk { }; // Calculate the desired vco frequency - let target_vco_freq = pllout_freq * q; + let target_vco_freq: u32 = pllout_freq * q; assert!((VCO_MIN..=VCO_MAX).contains(&target_vco_freq)); // Calculate PLL F ratio @@ -291,9 +290,9 @@ impl CoreClk { // Need to wait 100 us // RTC is running at 32kHz. // So wait 4 ticks of RTC. - let mtime = MTIME; - let time = mtime.mtime() + 4; - while mtime.mtime() < time {} + let mtime = CLINT::mtimer().mtime; + let time = mtime.read() + 4; + while mtime.read() < time {} // Now it is safe to check for PLL Lock while !prci.pllcfg().read().lock().bit_is_set() {} @@ -385,19 +384,19 @@ impl Clocks { /// Measure the coreclk frequency by counting the number of aonclk ticks. fn _measure_coreclk(&self, min_ticks: u64) -> Hertz { - let mtime = MTIME; + let mtime = CLINT::mtimer().mtime; interrupt::free(|| { // Don't start measuring until we see an mtime tick - while mtime.mtime() == mtime.mtime() {} + while mtime.read() == mtime.read() {} let start_cycle = mcycle::read64(); - let start_time = mtime.mtime(); + let start_time = mtime.read(); // Wait for min_ticks to pass - while start_time + min_ticks > mtime.mtime() {} + while start_time + min_ticks > mtime.read() {} let end_cycle = mcycle::read64(); - let end_time = mtime.mtime(); + let end_time = mtime.read(); let delta_cycle: u64 = end_cycle - start_cycle; let delta_time: u64 = end_time - start_time; diff --git a/e310x-hal/src/core/clint.rs b/e310x-hal/src/core/clint.rs deleted file mode 100644 index 82912e6..0000000 --- a/e310x-hal/src/core/clint.rs +++ /dev/null @@ -1,117 +0,0 @@ -//! Core-Local Interruptor - -use e310x::Clint as CLINT; - -macro_rules! read64 { - ($hi:expr, $lo:expr) => { - loop { - let hi = $hi; - let lo = $lo; - if hi == $hi { - return ((hi as u64) << 32) | lo as u64; - } - } - }; -} - -/// Opaque msip register -pub struct MSIP { - _0: (), -} - -impl MSIP { - /// Set msip register value - pub fn set_value(&mut self, value: bool) { - unsafe { - CLINT::steal() - .msip() - .write(|w| if value { w.bits(1) } else { w.bits(0) }) - } - } -} - -/// Opaque mtime register -pub struct MTIME; - -impl MTIME { - /// Read mtime register. - #[inline] - pub fn mtime_lo(&self) -> u32 { - unsafe { CLINT::steal() }.mtime().read().bits() - } - - /// Read mtimeh register. - #[inline] - pub fn mtime_hi(&self) -> u32 { - unsafe { CLINT::steal() }.mtimeh().read().bits() - } - - /// Read mtime and mtimeh registers. - pub fn mtime(&self) -> u64 { - read64!(self.mtime_hi(), self.mtime_lo()) - } -} - -/// Opaque mtimecmp register -pub struct MTIMECMP { - _0: (), -} - -impl MTIMECMP { - /// Read mtimecmp register. - #[inline] - pub fn mtimecmp_lo(&self) -> u32 { - unsafe { CLINT::steal() }.mtimecmp().read().bits() - } - - /// Read mtimecmph register. - #[inline] - pub fn mtimecmp_hi(&self) -> u32 { - unsafe { CLINT::steal() }.mtimecmph().read().bits() - } - - /// Read mtimecmp and mtimecmph registers. - pub fn mtimecmp(&self) -> u64 { - read64!(self.mtimecmp_hi(), self.mtimecmp_lo()) - } - - /// Write mtimecmp register - #[inline] - pub fn set_mtimecmp_lo(&mut self, value: u32) { - unsafe { CLINT::steal().mtimecmp().write(|w| w.bits(value)) }; - } - - /// Write mtimecmph register - #[inline] - pub fn set_mtimecmp_hi(&mut self, value: u32) { - unsafe { CLINT::steal().mtimecmph().write(|w| w.bits(value)) }; - } - - /// Write mtimecmp and mtimecmph registers. - pub fn set_mtimecmp(&mut self, value: u64) { - // Volume II: RISC-V Privileged Architectures V1.10 p.31, figure 3.15 - self.set_mtimecmp_lo(0xffff_ffff); // No smaller than old value - self.set_mtimecmp_hi((value >> 32) as u32); // New value - self.set_mtimecmp_lo(value as u32); // New value - } -} - -/// Core-Local Interruptor abstraction -pub struct Clint { - /// Opaque msip register - pub msip: MSIP, - /// Opaque mtimecmp register - pub mtimecmp: MTIMECMP, - /// Opaque mtime register - pub mtime: MTIME, -} - -impl From for Clint { - fn from(_: CLINT) -> Self { - Clint { - msip: MSIP { _0: () }, - mtimecmp: MTIMECMP { _0: () }, - mtime: MTIME, - } - } -} diff --git a/e310x-hal/src/core/mod.rs b/e310x-hal/src/core/mod.rs index 5b8d03e..75e20d9 100644 --- a/e310x-hal/src/core/mod.rs +++ b/e310x-hal/src/core/mod.rs @@ -1,26 +1,18 @@ //! E31 core peripherals -pub mod clint; pub mod counters; -pub mod plic; + +pub use e310x::{CLINT, PLIC}; /// Core peripherals pub struct CorePeripherals { - /// Core-Local Interruptor - pub clint: clint::Clint, - - /// Platform-Level Interrupt Controller - pub plic: plic::Plic, - /// Performance counters pub counters: counters::PerformanceCounters, } impl CorePeripherals { - pub(crate) fn new(clint: e310x::Clint, plic: e310x::Plic) -> Self { + pub(crate) fn new() -> Self { Self { - clint: clint.into(), - plic: plic.into(), counters: counters::PerformanceCounters::new(), } } @@ -31,7 +23,6 @@ impl CorePeripherals { /// /// Using this function may break the guarantees of the singleton pattern. pub unsafe fn steal() -> Self { - let p = e310x::Peripherals::steal(); - Self::new(p.clint, p.plic) + Self::new() } } diff --git a/e310x-hal/src/core/plic.rs b/e310x-hal/src/core/plic.rs deleted file mode 100644 index 9f3e0a9..0000000 --- a/e310x-hal/src/core/plic.rs +++ /dev/null @@ -1,252 +0,0 @@ -//! Platform-Level Interrupt Controller -use core::marker::PhantomData; -use e310x::Interrupt; -use e310x::Plic as PLIC; -use riscv::register::{mie, mip}; - -/// Priority of a plic::Interrupt. -#[derive(Clone, Copy)] -pub enum Priority { - /// Priority 0: Never interrupt - P0, - /// Priority 1: Lowest active priority - P1, - /// Priority 2 - P2, - /// Priority 3 - P3, - /// Priority 4 - P4, - /// Priority 5 - P5, - /// Priority 6 - P6, - /// Priority 7: Highest priority - P7, -} - -impl Priority { - /// Takes a read interrupt priority or plic threshold - /// register value and returns a plic::Priority enum. - fn from(prio: u32) -> Option { - match prio { - 0 => Some(Priority::P0), - 1 => Some(Priority::P1), - 2 => Some(Priority::P2), - 3 => Some(Priority::P3), - 4 => Some(Priority::P4), - 5 => Some(Priority::P5), - 6 => Some(Priority::P6), - 7 => Some(Priority::P7), - _ => None, - } - } -} - -impl From for u32 { - /// Returns the numeric priority for writing to a - /// interrupt priority or the plic threshold register. - fn from(val: Priority) -> Self { - match val { - Priority::P0 => 0, - Priority::P1 => 1, - Priority::P2 => 2, - Priority::P3 => 3, - Priority::P4 => 4, - Priority::P5 => 5, - Priority::P6 => 6, - Priority::P7 => 7, - } - } -} - -/// Watchdog interrupt (type state) -pub struct IrqWatchdog; -/// Realtime clock interrupt (type state) -pub struct IrqRtc; -/// Uart0 interrupt (type state) -pub struct IrqUart0; - -/// Parts of `PLIC` peripheral for fine grained permissions. -pub struct Plic { - /// Opaque mext register - pub mext: MEXT, - /// Opaque threshold register - pub threshold: THRESHOLD, - /// Opaque claim register - pub claim: CLAIM, - /// Opaque watchdog register - pub wdog: INTERRUPT, - /// Opaque rtc register - pub rtc: INTERRUPT, - /// Opaque uart0 register - pub uart0: INTERRUPT, -} - -impl From for Plic { - fn from(_: PLIC) -> Self { - Plic { - mext: MEXT { _0: () }, - threshold: THRESHOLD { _0: () }, - claim: CLAIM { _0: () }, - wdog: INTERRUPT { - offset: 0, - mask: 1 << (Interrupt::WATCHDOG as u8), - priority_offset: Interrupt::WATCHDOG as usize, - _marker: PhantomData, - }, - rtc: INTERRUPT { - offset: 0, - mask: 1 << (Interrupt::RTC as u8), - priority_offset: Interrupt::RTC as usize, - _marker: PhantomData, - }, - uart0: INTERRUPT { - offset: 0, - mask: 1 << (Interrupt::UART0 as u8), - priority_offset: Interrupt::UART0 as usize, - _marker: PhantomData, - }, - } - } -} - -/// Opaque MEXT register. -pub struct MEXT { - _0: (), -} - -impl MEXT { - /// Enable MachineExternal interrupt. - #[inline] - pub fn enable(&mut self) { - unsafe { mie::set_mext() }; - } - - /// Disable MachineExternal interrupt. - #[inline] - pub fn disable(&mut self) { - unsafe { mie::clear_mext() }; - } - - /// Returns true when MachineExternal interrupt is pending. - #[inline] - pub fn is_pending(&self) -> bool { - mip::read().mext() - } -} - -/// Opaque THRESHOLD register. -pub struct THRESHOLD { - _0: (), -} - -impl THRESHOLD { - /// Returns the current active priority threshold. - pub fn get(&self) -> Priority { - // NOTE: Atomic read with no side effects. - let threshold = unsafe { PLIC::steal() }.threshold().read(); - Priority::from(threshold.bits()).unwrap() - } - - /// Sets the current active priority threshold. This - /// deactivates all interrupts with a lower priority. - pub fn set(&mut self, priority: Priority) { - // NOTE: Atomic write with no side effects. - unsafe { PLIC::steal().threshold().write(|w| w.bits(priority.into())) }; - } -} - -/// Opaque CLAIM register. -pub struct CLAIM { - _0: (), -} - -impl CLAIM { - /// Claims the interrupt with the highest priority. - pub fn claim(&mut self) -> Option { - // NOTE: Atomic read with side effects. - let intr = unsafe { PLIC::steal() }.claim().read().bits(); - - // If no interrupt is pending return None - if intr == 0 { - None - } else { - Some(Interrupt::try_from(intr as u8).unwrap()) - } - } - - /// Notifies the PLIC that a claimed interrupt is complete. - pub fn complete(&mut self, intr: Interrupt) { - // NOTE: Atomic write with side effects. - unsafe { PLIC::steal().claim().write(|w| w.bits(intr as u32)) }; - } -} - -/// Fine grained interrupt handling. -pub struct INTERRUPT { - /// Offset in to enable and pending plic registers - offset: usize, - /// Bitmask for enable and pending plic registers - mask: u32, - /// Offset in to priority plic registers - priority_offset: usize, - _marker: PhantomData, -} - -impl INTERRUPT { - /// Enable IRQ interrupt. - #[inline] - pub fn enable(&mut self) { - // NOTE: should use atomic operations - unsafe { - PLIC::steal() - .enable(self.offset) - .modify(|r, w| w.bits(r.bits() | self.mask)) - }; - } - - /// Disable IRQ interrupt. - #[inline] - pub fn disable(&mut self) { - // NOTE: should use atomic operations - unsafe { - PLIC::steal() - .enable(self.offset) - .modify(|r, w| w.bits(r.bits() & !self.mask)) - }; - } - - /// Returns true when IRQ interrupt is pending. - pub fn is_pending(&self) -> bool { - // NOTE: Atomic write without side effects. - let pending = unsafe { PLIC::steal() }.pending(self.offset).read(); - pending.bits() & self.mask == self.mask - } - - /// Returns true when WDOG interrupt is enabled. - pub fn is_enabled(&self) -> bool { - // NOTE: Atomic write without side effects. - let enabled = unsafe { PLIC::steal() }.enable(self.offset).read(); - enabled.bits() & self.mask == self.mask - } - - /// Returns the priority of the IRQ interrupt. - pub fn priority(&self) -> Priority { - // NOTE: Atomic read without side effects. - let priority = unsafe { PLIC::steal() } - .priority(self.priority_offset) - .read(); - Priority::from(priority.bits()).unwrap() - } - - /// Sets the priority of the IRQ interrupt. - pub fn set_priority(&mut self, priority: Priority) { - // NOTE: Atomic write without side effects. - unsafe { - PLIC::steal() - .priority(self.priority_offset) - .write(|w| w.bits(priority as u32)) - }; - } -} diff --git a/e310x-hal/src/delay.rs b/e310x-hal/src/delay.rs index 5a89293..596b2e2 100644 --- a/e310x-hal/src/delay.rs +++ b/e310x-hal/src/delay.rs @@ -1,9 +1,9 @@ //! # Delays use crate::clock::Clocks; -use crate::core::clint::{MTIME, MTIMECMP}; +use e310x::CLINT; use embedded_hal::blocking::delay::{DelayMs, DelayUs}; -use riscv::register::{mie, mip}; +use riscv::register::mip; /// Machine timer (mtime) as a busyloop delay provider #[derive(Default)] @@ -22,9 +22,9 @@ impl DelayUs for Delay { fn delay_us(&mut self, us: u32) { let ticks = (us as u64) * TICKS_PER_SECOND / 1_000_000; - let mtime = MTIME; - let t = mtime.mtime() + ticks; - while mtime.mtime() < t {} + let mtime = CLINT::mtimer().mtime; + let t = mtime.read() + ticks; + while mtime.read() < t {} } } @@ -83,15 +83,13 @@ impl DelayMs for Delay { /// Machine timer (mtime) as a sleep delay provider using mtimecmp pub struct Sleep { clock_freq: u32, - mtimecmp: MTIMECMP, } impl Sleep { /// Constructs a delay provider using mtimecmp register to sleep - pub fn new(mtimecmp: MTIMECMP, clocks: Clocks) -> Self { + pub fn new(clocks: Clocks) -> Self { Sleep { clock_freq: clocks.lfclk().0, - mtimecmp, } } } @@ -99,23 +97,19 @@ impl Sleep { impl DelayMs for Sleep { fn delay_ms(&mut self, ms: u32) { let ticks = (ms as u64) * (self.clock_freq as u64) / 1000; - let t = MTIME.mtime() + ticks; + let t = CLINT::mtimer().mtime.read() + ticks; - self.mtimecmp.set_mtimecmp(t); + CLINT::mtimecmp0().write(t); // Enable timer interrupt - unsafe { - mie::set_mtimer(); - } + unsafe { CLINT::mtimer_enable() }; // Wait For Interrupt will put CPU to sleep until an interrupt hits // in our case when internal timer mtime value >= mtimecmp value // after which empty handler gets called and we go into the // next iteration of this loop loop { - unsafe { - riscv::asm::wfi(); - } + riscv::asm::wfi(); // check if we got the right interrupt cause, otherwise just loop back to wfi if mip::read().mtimer() { @@ -124,9 +118,7 @@ impl DelayMs for Sleep { } // Clear timer interrupt - unsafe { - mie::clear_mtimer(); - } + CLINT::mtimer_disable(); } } diff --git a/e310x-hal/src/device.rs b/e310x-hal/src/device.rs index da0a63f..8bb56df 100644 --- a/e310x-hal/src/device.rs +++ b/e310x-hal/src/device.rs @@ -159,7 +159,7 @@ impl From for DeviceResources { }; DeviceResources { - core_peripherals: CorePeripherals::new(p.clint, p.plic), + core_peripherals: CorePeripherals::new(), peripherals, pins: p.gpio0.into(), } diff --git a/e310x-hal/src/interrupt.rs b/e310x-hal/src/interrupt.rs deleted file mode 100644 index 8599835..0000000 --- a/e310x-hal/src/interrupt.rs +++ /dev/null @@ -1,203 +0,0 @@ -//! Vectored machine external interrupt handler. -//! -//! # Notes -//! -//! - You must activate the `virq` feature to use this module. -//! -//! - The vectored handler automatically claims the PLIC interrupt source as complete. -//! Thus, users do not have to worry about this step. -//! -//! # Features -//! -//! This module provides: -//! -//! - A vectored implementation for handling each machine external interrupt source independently. -//! -//! - A linker script that provides weak symbols for all the interrupt sources of an E310X microcontroller. -//! This file must be supplied using rustflag when compiling. -//! -//! # Implementation details -//! -//! You can define a custom handler for each interrupt source (see [`e310x::interrupt::Interrupt`]). -//! For instance, if you want to define a custom handler for interrupts triggered by -//! the [`e310x::interrupt::Interrupt::GPIO0`] source, you must define the `GPIO0` function: -//! -//! ```ignore -//! #[no_mangle] -//! #[allow(non_snake_case)] -//! fn GPIO0() { -//! // define the behavior of your custom handler -//! } -//! ``` -//! -//! Note that the function must be marked as `no_mangle`. -//! You can also use the [`e310x::interrupt!`] macro. -//! -//! If a source without custom handler triggers an interruption, it executes the -//! `OtherMachineExternal` handler. This handler function is shared among all the -//! undefined interrupt sources. You can define this handler as follows: -//! -//! ```ignore,no_run -//! #[no_mangle] -//! #[allow(non_snake_case)] -//! fn OtherMachineExternal() { -//! // define the behavior of this handler -//! } -//! ``` -//! -//! By default, `OtherMachineExternal` executes the [`DefaultMachineExternal`] handler. -//! This handler is just an infinite loop. - -use crate::core::CorePeripherals; -pub use e310x::interrupt::*; - -extern "C" { - fn WATCHDOG(); - fn RTC(); - fn UART0(); - fn UART1(); - fn QSPI0(); - fn QSPI1(); - fn QSPI2(); - fn GPIO0(); - fn GPIO1(); - fn GPIO2(); - fn GPIO3(); - fn GPIO4(); - fn GPIO5(); - fn GPIO6(); - fn GPIO7(); - fn GPIO8(); - fn GPIO9(); - fn GPIO10(); - fn GPIO11(); - fn GPIO12(); - fn GPIO13(); - fn GPIO14(); - fn GPIO15(); - fn GPIO16(); - fn GPIO17(); - fn GPIO18(); - fn GPIO19(); - fn GPIO20(); - fn GPIO21(); - fn GPIO22(); - fn GPIO23(); - fn GPIO24(); - fn GPIO25(); - fn GPIO26(); - fn GPIO27(); - fn GPIO28(); - fn GPIO29(); - fn GPIO30(); - fn GPIO31(); - fn PWM0CMP0(); - fn PWM0CMP1(); - fn PWM0CMP2(); - fn PWM0CMP3(); - fn PWM1CMP0(); - fn PWM1CMP1(); - fn PWM1CMP2(); - fn PWM1CMP3(); - fn PWM2CMP0(); - fn PWM2CMP1(); - fn PWM2CMP2(); - fn PWM2CMP3(); - #[cfg(feature = "g002")] - fn I2C0(); -} - -#[no_mangle] -#[allow(non_snake_case)] -/// Default machine external interrupt handler. It is an infinite loop. -pub fn DefaultMachineExternal() { - loop { - // Prevent this from turning into a UDF instruction - // see rust-lang/rust#28728 for details - continue; - } -} - -#[cfg(not(feature = "g002"))] -const N_INTERRUPTS: usize = 51; -#[cfg(feature = "g002")] -const N_INTERRUPTS: usize = 52; - -/// Array of machine external interrupt handlers. -static HANDLERS: [unsafe extern "C" fn(); N_INTERRUPTS] = [ - WATCHDOG, - RTC, - UART0, - UART1, - QSPI0, - QSPI1, - QSPI2, - GPIO0, - GPIO1, - GPIO2, - GPIO3, - GPIO4, - GPIO5, - GPIO6, - GPIO7, - GPIO8, - GPIO9, - GPIO10, - GPIO11, - GPIO12, - GPIO13, - GPIO14, - GPIO15, - GPIO16, - GPIO17, - GPIO18, - GPIO19, - GPIO20, - GPIO21, - GPIO22, - GPIO23, - GPIO24, - GPIO25, - GPIO26, - GPIO27, - GPIO28, - GPIO29, - GPIO30, - GPIO31, - PWM0CMP0, - PWM0CMP1, - PWM0CMP2, - PWM0CMP3, - PWM1CMP0, - PWM1CMP1, - PWM1CMP2, - PWM1CMP3, - PWM2CMP0, - PWM2CMP1, - PWM2CMP2, - PWM2CMP3, - #[cfg(feature = "g002")] - I2C0, -]; - -/// Handler for vectored machine external interrupts (see the [`riscv-rt`] crate). -#[no_mangle] -#[allow(non_snake_case)] -unsafe fn MachineExternal() { - // Steal the PLIC peripheral and claim the interrupt - let mut plic = CorePeripherals::steal().plic; - let interrupt = plic.claim.claim().unwrap(); - let interrupt_n = interrupt as usize; - // Match the appropriate machine external interrupt - if interrupt_n == 0 { - // Interrupt number 0 is defined as no interrupt - } else if interrupt_n <= HANDLERS.len() { - // Execute corresponding interrupt handler - HANDLERS[interrupt_n - 1](); - } else { - // Any other interrupt number is not allowed - DefaultMachineExternal(); - } - // Claim PLIC interrupt source as complete by this handler - plic.claim.complete(interrupt); -} diff --git a/e310x-hal/src/lib.rs b/e310x-hal/src/lib.rs index 40bf01a..b040046 100644 --- a/e310x-hal/src/lib.rs +++ b/e310x-hal/src/lib.rs @@ -61,7 +61,5 @@ pub mod wdog; #[cfg(feature = "g002")] pub mod i2c; -#[cfg(feature = "virq")] -pub mod interrupt; pub use device::DeviceResources; diff --git a/e310x-hal/src/prelude.rs b/e310x-hal/src/prelude.rs index c6ccd12..4b7b561 100644 --- a/e310x-hal/src/prelude.rs +++ b/e310x-hal/src/prelude.rs @@ -7,6 +7,10 @@ pub use crate::rtc::RtcExt as _e310x_hal_rtc_RtcExt; pub use crate::stdout::Write as _e310x_hal_stdout_Write; pub use crate::time::U32Ext as _e310x_hal_time_U32Ext; pub use crate::wdog::WdogExt as _e310x_hal_wdog_WdogExt; +pub use e310x::interrupt::{ + CoreInterrupt, Exception, ExceptionNumber, ExternalInterrupt, InterruptNumber, Priority, + PriorityNumber, +}; pub use embedded_hal::digital::v2::{ InputPin as _embedded_hal_digital_v2_InputPin, OutputPin as _embedded_hal_digital_v2_OutputPin, StatefulOutputPin as _embedded_hal_digital_v2_StatefulOutputPin, diff --git a/e310x/CHANGELOG.md b/e310x/CHANGELOG.md index cd31b6c..86d8b67 100644 --- a/e310x/CHANGELOG.md +++ b/e310x/CHANGELOG.md @@ -8,8 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Changed -- Bump MSRV to 1.72.0 to ensure a correct behavior of portable-atomic -- Regenerate code with `svd2rust` v0.33.4 + +- Now CLINT and PLIC are provided by `riscv-peripheral` 0.2 +- Adapt crate to work with `riscv` 0.12 and `riscv-rt` 0.13 +- Bump MSRV to 1.76.0 to ensure a correct behavior of portable-atomic +- Regenerate code with `svd2rust` 8b809ac2c1e1a13f30af59ee41f4d66a4995d625 (unreleased) ## [v0.11.0] diff --git a/e310x/Cargo.toml b/e310x/Cargo.toml index b73b28f..7ec7786 100644 --- a/e310x/Cargo.toml +++ b/e310x/Cargo.toml @@ -1,21 +1,25 @@ [package] name = "e310x" -version = "0.11.0" +version = "0.12.0" repository = "https://github.com/riscv-rust/e310x" authors = ["David Craven ", "The RISC-V Team "] categories = ["embedded", "hardware-support", "no-std"] description = "With svd2rust generated peripherals for Freedom E310 MCU's." keywords = ["riscv", "register", "peripheral"] license = "ISC" -rust-version = "1.72" +rust-version = "1.76" edition = "2021" [dependencies] -critical-section = { version = "1.1.3", optional = true } +critical-section = { version = "1.2.0", optional = true } +riscv = "0.12.0" +riscv-peripheral = "0.2.0" +riscv-rt = { version = "0.13.0", features = ["no-interrupts"], optional = true } vcell = "0.1.3" [features] -rt = [] +rt = ["riscv-rt"] +v-trap = ["rt", "riscv-rt/v-trap"] g002 = [] [package.metadata.docs.rs] diff --git a/e310x/device.x b/e310x/device.x index 2c95228..c2d6e5e 100644 --- a/e310x/device.x +++ b/e310x/device.x @@ -3,6 +3,14 @@ MEMORY RAM : ORIGIN = 0x80000000, LENGTH = 16K } +/* Core interrupt sources and trap handlers */ +PROVIDE(MachineSoft = DefaultHandler); +PROVIDE(_start_MachineSoft_trap = _start_DefaultHandler_trap); +PROVIDE(MachineTimer = DefaultHandler); +PROVIDE(_start_MachineTimer_trap = _start_DefaultHandler_trap); +PROVIDE(MachineExternal = DefaultHandler); +PROVIDE(_start_MachineExternal_trap = _start_DefaultHandler_trap); +/* External interrupt sources */ PROVIDE(WATCHDOG = DefaultHandler); PROVIDE(RTC = DefaultHandler); PROVIDE(UART0 = DefaultHandler); diff --git a/e310x/settings.yaml b/e310x/settings.yaml new file mode 100644 index 0000000..e081b54 --- /dev/null +++ b/e310x/settings.yaml @@ -0,0 +1,52 @@ +riscv_config: + core_interrupts: + - name: "MachineSoft" + value: 3 + description: "Machine Software Interrupt" + - name: "MachineTimer" + value: 7 + description: "Machine Timer Interrupt" + - name: "MachineExternal" + value: 11 + description: "Machine External Interrupt" + + priorities: + - name: "P0" + value: 0 + description: "Priority level 0" + - name: "P1" + value: 1 + description: "Priority level 1" + - name: "P2" + value: 2 + description: "Priority level 2" + - name: "P3" + value: 3 + description: "Priority level 3" + - name: "P4" + value: 4 + description: "Priority level 4" + - name: "P5" + value: 5 + description: "Priority level 5" + - name: "P6" + value: 6 + description: "Priority level 6" + - name: "P7" + value: 7 + description: "Priority level 7" + + harts: + - name: "H0" + value: 0 + description: "Hart 0" + + clint: + name: "CLINT" + freq: 32768 + async_delay: false + + plic: + name: "PLIC" + core_interrupt: "MachineExternal" + hart_id: "H0" diff --git a/e310x/src/aonclk/lfrosccfg.rs b/e310x/src/aonclk/lfrosccfg.rs index 2576e2a..8e9cd21 100644 --- a/e310x/src/aonclk/lfrosccfg.rs +++ b/e310x/src/aonclk/lfrosccfg.rs @@ -43,25 +43,21 @@ impl R { impl W { #[doc = "Bits 0:5"] #[inline(always)] - #[must_use] pub fn div(&mut self) -> DivW { DivW::new(self, 0) } #[doc = "Bits 16:20"] #[inline(always)] - #[must_use] pub fn trim(&mut self) -> TrimW { TrimW::new(self, 16) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn enable(&mut self) -> EnableW { EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn ready(&mut self) -> ReadyW { ReadyW::new(self, 31) } diff --git a/e310x/src/clint.rs b/e310x/src/clint.rs deleted file mode 100644 index 4e222f0..0000000 --- a/e310x/src/clint.rs +++ /dev/null @@ -1,68 +0,0 @@ -#[repr(C)] -#[doc = "Register block"] -pub struct RegisterBlock { - msip: Msip, - _reserved1: [u8; 0x3ffc], - mtimecmp: Mtimecmp, - mtimecmph: Mtimecmph, - _reserved3: [u8; 0x7ff0], - mtime: Mtime, - mtimeh: Mtimeh, -} -impl RegisterBlock { - #[doc = "0x00 - Hart 0 software interrupt register"] - #[inline(always)] - pub const fn msip(&self) -> &Msip { - &self.msip - } - #[doc = "0x4000 - Hart 0 time comparator register"] - #[inline(always)] - pub const fn mtimecmp(&self) -> &Mtimecmp { - &self.mtimecmp - } - #[doc = "0x4004 - Hart 0 time comparator register"] - #[inline(always)] - pub const fn mtimecmph(&self) -> &Mtimecmph { - &self.mtimecmph - } - #[doc = "0xbff8 - Timer register"] - #[inline(always)] - pub const fn mtime(&self) -> &Mtime { - &self.mtime - } - #[doc = "0xbffc - Timer register"] - #[inline(always)] - pub const fn mtimeh(&self) -> &Mtimeh { - &self.mtimeh - } -} -#[doc = "msip (rw) register accessor: Hart 0 software interrupt register\n\nYou can [`read`](crate::Reg::read) this register and get [`msip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`msip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@msip`] -module"] -#[doc(alias = "msip")] -pub type Msip = crate::Reg; -#[doc = "Hart 0 software interrupt register"] -pub mod msip; -#[doc = "mtimecmp (rw) register accessor: Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimecmp`] -module"] -#[doc(alias = "mtimecmp")] -pub type Mtimecmp = crate::Reg; -#[doc = "Hart 0 time comparator register"] -pub mod mtimecmp; -#[doc = "mtimecmph (rw) register accessor: Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmph::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmph::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimecmph`] -module"] -#[doc(alias = "mtimecmph")] -pub type Mtimecmph = crate::Reg; -#[doc = "Hart 0 time comparator register"] -pub mod mtimecmph; -#[doc = "mtime (rw) register accessor: Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtime::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtime::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtime`] -module"] -#[doc(alias = "mtime")] -pub type Mtime = crate::Reg; -#[doc = "Timer register"] -pub mod mtime; -#[doc = "mtimeh (rw) register accessor: Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimeh::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimeh::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimeh`] -module"] -#[doc(alias = "mtimeh")] -pub type Mtimeh = crate::Reg; -#[doc = "Timer register"] -pub mod mtimeh; diff --git a/e310x/src/clint/msip.rs b/e310x/src/clint/msip.rs deleted file mode 100644 index f8ba2bc..0000000 --- a/e310x/src/clint/msip.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `msip` reader"] -pub type R = crate::R; -#[doc = "Register `msip` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Hart 0 software interrupt register\n\nYou can [`read`](crate::Reg::read) this register and get [`msip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`msip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct MsipSpec; -impl crate::RegisterSpec for MsipSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`msip::R`](R) reader structure"] -impl crate::Readable for MsipSpec {} -#[doc = "`write(|w| ..)` method takes [`msip::W`](W) writer structure"] -impl crate::Writable for MsipSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets msip to value 0"] -impl crate::Resettable for MsipSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/clint/mtime.rs b/e310x/src/clint/mtime.rs deleted file mode 100644 index e8b419c..0000000 --- a/e310x/src/clint/mtime.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `mtime` reader"] -pub type R = crate::R; -#[doc = "Register `mtime` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtime::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtime::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct MtimeSpec; -impl crate::RegisterSpec for MtimeSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`mtime::R`](R) reader structure"] -impl crate::Readable for MtimeSpec {} -#[doc = "`write(|w| ..)` method takes [`mtime::W`](W) writer structure"] -impl crate::Writable for MtimeSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets mtime to value 0"] -impl crate::Resettable for MtimeSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/clint/mtimecmp.rs b/e310x/src/clint/mtimecmp.rs deleted file mode 100644 index ad97205..0000000 --- a/e310x/src/clint/mtimecmp.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `mtimecmp` reader"] -pub type R = crate::R; -#[doc = "Register `mtimecmp` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmp::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmp::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct MtimecmpSpec; -impl crate::RegisterSpec for MtimecmpSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`mtimecmp::R`](R) reader structure"] -impl crate::Readable for MtimecmpSpec {} -#[doc = "`write(|w| ..)` method takes [`mtimecmp::W`](W) writer structure"] -impl crate::Writable for MtimecmpSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets mtimecmp to value 0"] -impl crate::Resettable for MtimecmpSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/clint/mtimecmph.rs b/e310x/src/clint/mtimecmph.rs deleted file mode 100644 index d70cff4..0000000 --- a/e310x/src/clint/mtimecmph.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `mtimecmph` reader"] -pub type R = crate::R; -#[doc = "Register `mtimecmph` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmph::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmph::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct MtimecmphSpec; -impl crate::RegisterSpec for MtimecmphSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`mtimecmph::R`](R) reader structure"] -impl crate::Readable for MtimecmphSpec {} -#[doc = "`write(|w| ..)` method takes [`mtimecmph::W`](W) writer structure"] -impl crate::Writable for MtimecmphSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets mtimecmph to value 0"] -impl crate::Resettable for MtimecmphSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/clint/mtimeh.rs b/e310x/src/clint/mtimeh.rs deleted file mode 100644 index 4de4968..0000000 --- a/e310x/src/clint/mtimeh.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `mtimeh` reader"] -pub type R = crate::R; -#[doc = "Register `mtimeh` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimeh::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimeh::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct MtimehSpec; -impl crate::RegisterSpec for MtimehSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`mtimeh::R`](R) reader structure"] -impl crate::Readable for MtimehSpec {} -#[doc = "`write(|w| ..)` method takes [`mtimeh::W`](W) writer structure"] -impl crate::Writable for MtimehSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets mtimeh to value 0"] -impl crate::Resettable for MtimehSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/generic.rs b/e310x/src/generic.rs index 5c6d2a6..e7e9158 100644 --- a/e310x/src/generic.rs +++ b/e310x/src/generic.rs @@ -147,6 +147,7 @@ pub mod raw { } } + #[must_use = "after creating `FieldWriter` you need to call field value setting method"] pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> where REG: Writable + RegisterSpec, @@ -174,6 +175,7 @@ pub mod raw { } } + #[must_use = "after creating `BitWriter` you need to call bit setting method"] pub struct BitWriter<'a, REG, FI = bool, M = BitM> where REG: Writable + RegisterSpec, diff --git a/e310x/src/gpio0/drive.rs b/e310x/src/gpio0/drive.rs index dd5cd3c..e11fe05 100644 --- a/e310x/src/gpio0/drive.rs +++ b/e310x/src/gpio0/drive.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/fall_ie.rs b/e310x/src/gpio0/fall_ie.rs index 80e5d99..c055233 100644 --- a/e310x/src/gpio0/fall_ie.rs +++ b/e310x/src/gpio0/fall_ie.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/fall_ip.rs b/e310x/src/gpio0/fall_ip.rs index 36df848..ebc2dab 100644 --- a/e310x/src/gpio0/fall_ip.rs +++ b/e310x/src/gpio0/fall_ip.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/high_ie.rs b/e310x/src/gpio0/high_ie.rs index 627853b..3209092 100644 --- a/e310x/src/gpio0/high_ie.rs +++ b/e310x/src/gpio0/high_ie.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/high_ip.rs b/e310x/src/gpio0/high_ip.rs index eb02239..0844d80 100644 --- a/e310x/src/gpio0/high_ip.rs +++ b/e310x/src/gpio0/high_ip.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/input_en.rs b/e310x/src/gpio0/input_en.rs index 5348ebe..8cb602b 100644 --- a/e310x/src/gpio0/input_en.rs +++ b/e310x/src/gpio0/input_en.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/input_val.rs b/e310x/src/gpio0/input_val.rs index 710e706..95e06ad 100644 --- a/e310x/src/gpio0/input_val.rs +++ b/e310x/src/gpio0/input_val.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/iof_en.rs b/e310x/src/gpio0/iof_en.rs index cd9590a..c7aeb9a 100644 --- a/e310x/src/gpio0/iof_en.rs +++ b/e310x/src/gpio0/iof_en.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/iof_sel.rs b/e310x/src/gpio0/iof_sel.rs index b0cb56c..b0b394d 100644 --- a/e310x/src/gpio0/iof_sel.rs +++ b/e310x/src/gpio0/iof_sel.rs @@ -1863,193 +1863,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/low_ie.rs b/e310x/src/gpio0/low_ie.rs index b696aea..260e0a2 100644 --- a/e310x/src/gpio0/low_ie.rs +++ b/e310x/src/gpio0/low_ie.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/low_ip.rs b/e310x/src/gpio0/low_ip.rs index f9660d4..2902074 100644 --- a/e310x/src/gpio0/low_ip.rs +++ b/e310x/src/gpio0/low_ip.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/out_xor.rs b/e310x/src/gpio0/out_xor.rs index dde20db..8d38451 100644 --- a/e310x/src/gpio0/out_xor.rs +++ b/e310x/src/gpio0/out_xor.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/output_en.rs b/e310x/src/gpio0/output_en.rs index 3e56491..f51e43d 100644 --- a/e310x/src/gpio0/output_en.rs +++ b/e310x/src/gpio0/output_en.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/output_val.rs b/e310x/src/gpio0/output_val.rs index 876de01..48b1645 100644 --- a/e310x/src/gpio0/output_val.rs +++ b/e310x/src/gpio0/output_val.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/pullup.rs b/e310x/src/gpio0/pullup.rs index c3ef136..3a31897 100644 --- a/e310x/src/gpio0/pullup.rs +++ b/e310x/src/gpio0/pullup.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/rise_ie.rs b/e310x/src/gpio0/rise_ie.rs index c3d628b..a422759 100644 --- a/e310x/src/gpio0/rise_ie.rs +++ b/e310x/src/gpio0/rise_ie.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/gpio0/rise_ip.rs b/e310x/src/gpio0/rise_ip.rs index 1d70a1f..60b0ea6 100644 --- a/e310x/src/gpio0/rise_ip.rs +++ b/e310x/src/gpio0/rise_ip.rs @@ -295,193 +295,161 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn pin0(&mut self) -> Pin0W { Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn pin1(&mut self) -> Pin1W { Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn pin2(&mut self) -> Pin2W { Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn pin3(&mut self) -> Pin3W { Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pin4(&mut self) -> Pin4W { Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pin5(&mut self) -> Pin5W { Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - #[must_use] pub fn pin6(&mut self) -> Pin6W { Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn pin7(&mut self) -> Pin7W { Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn pin8(&mut self) -> Pin8W { Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn pin9(&mut self) -> Pin9W { Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn pin10(&mut self) -> Pin10W { Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - #[must_use] pub fn pin11(&mut self) -> Pin11W { Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn pin12(&mut self) -> Pin12W { Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn pin13(&mut self) -> Pin13W { Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - #[must_use] pub fn pin14(&mut self) -> Pin14W { Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - #[must_use] pub fn pin15(&mut self) -> Pin15W { Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn pin16(&mut self) -> Pin16W { Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn pin17(&mut self) -> Pin17W { Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn pin18(&mut self) -> Pin18W { Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn pin19(&mut self) -> Pin19W { Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - #[must_use] pub fn pin20(&mut self) -> Pin20W { Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - #[must_use] pub fn pin21(&mut self) -> Pin21W { Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - #[must_use] pub fn pin22(&mut self) -> Pin22W { Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - #[must_use] pub fn pin23(&mut self) -> Pin23W { Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn pin24(&mut self) -> Pin24W { Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn pin25(&mut self) -> Pin25W { Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - #[must_use] pub fn pin26(&mut self) -> Pin26W { Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn pin27(&mut self) -> Pin27W { Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn pin28(&mut self) -> Pin28W { Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn pin29(&mut self) -> Pin29W { Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn pin30(&mut self) -> Pin30W { Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn pin31(&mut self) -> Pin31W { Pin31W::new(self, 31) } diff --git a/e310x/src/i2c0.rs b/e310x/src/i2c0.rs index 493193a..1161c0f 100644 --- a/e310x/src/i2c0.rs +++ b/e310x/src/i2c0.rs @@ -31,17 +31,17 @@ impl RegisterBlock { #[doc = "0x10 - Status register"] #[inline(always)] pub const fn sr(&self) -> &Sr { - unsafe { &*(self as *const Self).cast::().add(16).cast() } + unsafe { &*core::ptr::from_ref(self).cast::().add(16).cast() } } #[doc = "0x10 - Command register"] #[inline(always)] pub const fn cr(&self) -> &Cr { - unsafe { &*(self as *const Self).cast::().add(16).cast() } + unsafe { &*core::ptr::from_ref(self).cast::().add(16).cast() } } #[doc = "0x10 - Command register / Status register"] #[inline(always)] pub const fn cr_sr(&self) -> &CrSr { - unsafe { &*(self as *const Self).cast::().add(16).cast() } + unsafe { &*core::ptr::from_ref(self).cast::().add(16).cast() } } } #[doc = "prer_lo (rw) register accessor: Clock Prescale register lo-byte\n\nYou can [`read`](crate::Reg::read) this register and get [`prer_lo::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer_lo::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prer_lo`] diff --git a/e310x/src/i2c0/cr.rs b/e310x/src/i2c0/cr.rs index 3f6fbb3..3800fce 100644 --- a/e310x/src/i2c0/cr.rs +++ b/e310x/src/i2c0/cr.rs @@ -44,37 +44,31 @@ pub type StaW<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Interrupt acknowledge. When set, clears a pending interrupt"] #[inline(always)] - #[must_use] pub fn iack(&mut self) -> IackW { IackW::new(self, 0) } #[doc = "Bit 3 - When a receiver, sent ACK (0) or NACK (1)"] #[inline(always)] - #[must_use] pub fn ack(&mut self) -> AckW { AckW::new(self, 3) } #[doc = "Bit 4 - Write to slave"] #[inline(always)] - #[must_use] pub fn wr(&mut self) -> WrW { WrW::new(self, 4) } #[doc = "Bit 5 - Read from slave"] #[inline(always)] - #[must_use] pub fn rd(&mut self) -> RdW { RdW::new(self, 5) } #[doc = "Bit 6 - Generate stop condition"] #[inline(always)] - #[must_use] pub fn sto(&mut self) -> StoW { StoW::new(self, 6) } #[doc = "Bit 7 - Generate (repeated) start condition"] #[inline(always)] - #[must_use] pub fn sta(&mut self) -> StaW { StaW::new(self, 7) } diff --git a/e310x/src/i2c0/ctr.rs b/e310x/src/i2c0/ctr.rs index 474cca8..2108cef 100644 --- a/e310x/src/i2c0/ctr.rs +++ b/e310x/src/i2c0/ctr.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 6 - I2C core interrupt enable bit"] #[inline(always)] - #[must_use] pub fn ien(&mut self) -> IenW { IenW::new(self, 6) } #[doc = "Bit 7 - I2C core enable bit"] #[inline(always)] - #[must_use] pub fn en(&mut self) -> EnW { EnW::new(self, 7) } diff --git a/e310x/src/i2c0/prer_hi.rs b/e310x/src/i2c0/prer_hi.rs index 1b9029a..ce91b6a 100644 --- a/e310x/src/i2c0/prer_hi.rs +++ b/e310x/src/i2c0/prer_hi.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:7"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/i2c0/prer_lo.rs b/e310x/src/i2c0/prer_lo.rs index b00c9d6..2e774da 100644 --- a/e310x/src/i2c0/prer_lo.rs +++ b/e310x/src/i2c0/prer_lo.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:7"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/i2c0/txr_rxr.rs b/e310x/src/i2c0/txr_rxr.rs index 9684ac7..786cebc 100644 --- a/e310x/src/i2c0/txr_rxr.rs +++ b/e310x/src/i2c0/txr_rxr.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:7"] #[inline(always)] - #[must_use] pub fn data(&mut self) -> DataW { DataW::new(self, 0) } diff --git a/e310x/src/interrupt.rs b/e310x/src/interrupt.rs index fa18484..1d045f7 100644 --- a/e310x/src/interrupt.rs +++ b/e310x/src/interrupt.rs @@ -1,7 +1,66 @@ -#[doc = r"Enumeration of all the interrupts."] -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -#[repr(u16)] -pub enum Interrupt { +#[doc = r" Core interrupts. These interrupts are handled by the core itself."] +# [riscv :: pac_enum (unsafe CoreInterruptNumber)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CoreInterrupt { + #[doc = "3 - Machine Software Interrupt"] + MachineSoft = 3, + #[doc = "7 - Machine Timer Interrupt"] + MachineTimer = 7, + #[doc = "11 - Machine External Interrupt"] + MachineExternal = 11, +} +pub use riscv::interrupt::Exception; +#[doc = r" Priority levels in the device"] +# [riscv :: pac_enum (unsafe PriorityNumber)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Priority { + #[doc = "0 - Priority level 0"] + P0 = 0, + #[doc = "1 - Priority level 1"] + P1 = 1, + #[doc = "2 - Priority level 2"] + P2 = 2, + #[doc = "3 - Priority level 3"] + P3 = 3, + #[doc = "4 - Priority level 4"] + P4 = 4, + #[doc = "5 - Priority level 5"] + P5 = 5, + #[doc = "6 - Priority level 6"] + P6 = 6, + #[doc = "7 - Priority level 7"] + P7 = 7, +} +#[doc = r" HARTs in the device"] +# [riscv :: pac_enum (unsafe HartIdNumber)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Hart { + #[doc = "0 - Hart 0"] + H0 = 0, +} +pub use riscv::{ + interrupt::{disable, enable, free, nested}, + ExceptionNumber, HartIdNumber, InterruptNumber, PriorityNumber, +}; +pub type Trap = riscv::interrupt::Trap; +#[doc = r" Retrieves the cause of a trap in the current hart."] +#[doc = r""] +#[doc = r" If the raw cause is not a valid interrupt or exception for the target, it returns an error."] +#[inline] +pub fn try_cause() -> riscv::result::Result { + riscv::interrupt::try_cause() +} +#[doc = r" Retrieves the cause of a trap in the current hart (machine mode)."] +#[doc = r""] +#[doc = r" If the raw cause is not a valid interrupt or exception for the target, it panics."] +#[inline] +pub fn cause() -> Trap { + try_cause().unwrap() +} +#[doc = r" External interrupts. These interrupts are handled by the external peripherals."] +# [riscv :: pac_enum (unsafe ExternalInterruptNumber)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ExternalInterrupt { #[doc = "1 - WATCHDOG"] WATCHDOG = 1, #[doc = "2 - RTC"] @@ -107,105 +166,12 @@ pub enum Interrupt { #[doc = "52 - I2C0"] I2C0 = 52, } -#[doc = r" TryFromInterruptError"] -#[derive(Debug, Copy, Clone)] -pub struct TryFromInterruptError(()); -impl Interrupt { - #[doc = r" Attempt to convert a given value into an `Interrupt`"] - #[inline] - pub fn try_from(value: u8) -> Result { - match value { - 1 => Ok(Interrupt::WATCHDOG), - 2 => Ok(Interrupt::RTC), - 3 => Ok(Interrupt::UART0), - 4 => Ok(Interrupt::UART1), - 5 => Ok(Interrupt::QSPI0), - 6 => Ok(Interrupt::QSPI1), - 7 => Ok(Interrupt::QSPI2), - 8 => Ok(Interrupt::GPIO0), - 9 => Ok(Interrupt::GPIO1), - 10 => Ok(Interrupt::GPIO2), - 11 => Ok(Interrupt::GPIO3), - 12 => Ok(Interrupt::GPIO4), - 13 => Ok(Interrupt::GPIO5), - 14 => Ok(Interrupt::GPIO6), - 15 => Ok(Interrupt::GPIO7), - 16 => Ok(Interrupt::GPIO8), - 17 => Ok(Interrupt::GPIO9), - 18 => Ok(Interrupt::GPIO10), - 19 => Ok(Interrupt::GPIO11), - 20 => Ok(Interrupt::GPIO12), - 21 => Ok(Interrupt::GPIO13), - 22 => Ok(Interrupt::GPIO14), - 23 => Ok(Interrupt::GPIO15), - 24 => Ok(Interrupt::GPIO16), - 25 => Ok(Interrupt::GPIO17), - 26 => Ok(Interrupt::GPIO18), - 27 => Ok(Interrupt::GPIO19), - 28 => Ok(Interrupt::GPIO20), - 29 => Ok(Interrupt::GPIO21), - 30 => Ok(Interrupt::GPIO22), - 31 => Ok(Interrupt::GPIO23), - 32 => Ok(Interrupt::GPIO24), - 33 => Ok(Interrupt::GPIO25), - 34 => Ok(Interrupt::GPIO26), - 35 => Ok(Interrupt::GPIO27), - 36 => Ok(Interrupt::GPIO28), - 37 => Ok(Interrupt::GPIO29), - 38 => Ok(Interrupt::GPIO30), - 39 => Ok(Interrupt::GPIO31), - 40 => Ok(Interrupt::PWM0CMP0), - 41 => Ok(Interrupt::PWM0CMP1), - 42 => Ok(Interrupt::PWM0CMP2), - 43 => Ok(Interrupt::PWM0CMP3), - 44 => Ok(Interrupt::PWM1CMP0), - 45 => Ok(Interrupt::PWM1CMP1), - 46 => Ok(Interrupt::PWM1CMP2), - 47 => Ok(Interrupt::PWM1CMP3), - 48 => Ok(Interrupt::PWM2CMP0), - 49 => Ok(Interrupt::PWM2CMP1), - 50 => Ok(Interrupt::PWM2CMP2), - 51 => Ok(Interrupt::PWM2CMP3), - 52 => Ok(Interrupt::I2C0), - _ => Err(TryFromInterruptError(())), - } +#[cfg(feature = "rt")] +#[riscv_rt::core_interrupt(CoreInterrupt::MachineExternal)] +fn plic_handler() { + let claim = crate::PLIC::ctx(Hart::H0).claim(); + if let Some(s) = claim.claim::() { + unsafe { _dispatch_external_interrupt(s.number()) } + claim.complete(s); } } -#[cfg(feature = "rt")] -#[macro_export] -#[doc = r" Assigns a handler to an interrupt"] -#[doc = r""] -#[doc = r" This macro takes two arguments: the name of an interrupt and the path to the"] -#[doc = r" function that will be used as the handler of that interrupt. That function"] -#[doc = r" must have signature `fn()`."] -#[doc = r""] -#[doc = r" Optionally, a third argument may be used to declare interrupt local data."] -#[doc = r" The handler will have exclusive access to these *local* variables on each"] -#[doc = r" invocation. If the third argument is used then the signature of the handler"] -#[doc = r" function must be `fn(&mut $NAME::Locals)` where `$NAME` is the first argument"] -#[doc = r" passed to the macro."] -#[doc = r""] -#[doc = r" # Example"] -#[doc = r""] -#[doc = r" ``` ignore"] -#[doc = r" interrupt!(TIM2, periodic);"] -#[doc = r""] -#[doc = r" fn periodic() {"] -#[doc = r#" print!(".");"#] -#[doc = r" }"] -#[doc = r""] -#[doc = r" interrupt!(TIM3, tick, locals: {"] -#[doc = r" tick: bool = false;"] -#[doc = r" });"] -#[doc = r""] -#[doc = r" fn tick(locals: &mut TIM3::Locals) {"] -#[doc = r" locals.tick = !locals.tick;"] -#[doc = r""] -#[doc = r" if locals.tick {"] -#[doc = r#" println!("Tick");"#] -#[doc = r" } else {"] -#[doc = r#" println!("Tock");"#] -#[doc = r" }"] -#[doc = r" }"] -#[doc = r" ```"] -macro_rules ! interrupt { ($ NAME : ident , $ path : path , locals : { $ ($ lvar : ident : $ lty : ty = $ lval : expr ;) * }) => { # [allow (non_snake_case)] mod $ NAME { pub struct Locals { $ (pub $ lvar : $ lty ,) * } } # [allow (non_snake_case)] # [no_mangle] pub extern "C" fn $ NAME () { let _ = $ crate :: interrupt :: Interrupt :: $ NAME ; static mut LOCALS : self :: $ NAME :: Locals = self :: $ NAME :: Locals { $ ($ lvar : $ lval ,) * } ; let f : fn (& mut self :: $ NAME :: Locals) = $ path ; f (unsafe { & mut LOCALS }) ; } } ; ($ NAME : ident , $ path : path) => { # [allow (non_snake_case)] # [no_mangle] pub extern "C" fn $ NAME () { let _ = $ crate :: interrupt :: Interrupt :: $ NAME ; let f : fn () = $ path ; f () ; } } } diff --git a/e310x/src/lib.rs b/e310x/src/lib.rs index f617f42..111cdef 100644 --- a/e310x/src/lib.rs +++ b/e310x/src/lib.rs @@ -1,5 +1,5 @@ -#![doc = "Peripheral access API for FE310 microcontrollers (generated using svd2rust v0.33.4 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] -svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.33.4/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] +#![doc = "Peripheral access API for FE310 microcontrollers (generated using svd2rust v0.33.5 (90ef2a6 2024-10-21))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] +svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.33.5/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] @@ -9,220 +9,10 @@ use core::ops::Deref; use generic::*; #[doc = "Common register and bit access and modify traits"] pub mod generic; -#[cfg(feature = "rt")] -extern "C" { - fn WATCHDOG(); - fn RTC(); - fn UART0(); - fn UART1(); - fn QSPI0(); - fn QSPI1(); - fn QSPI2(); - fn GPIO0(); - fn GPIO1(); - fn GPIO2(); - fn GPIO3(); - fn GPIO4(); - fn GPIO5(); - fn GPIO6(); - fn GPIO7(); - fn GPIO8(); - fn GPIO9(); - fn GPIO10(); - fn GPIO11(); - fn GPIO12(); - fn GPIO13(); - fn GPIO14(); - fn GPIO15(); - fn GPIO16(); - fn GPIO17(); - fn GPIO18(); - fn GPIO19(); - fn GPIO20(); - fn GPIO21(); - fn GPIO22(); - fn GPIO23(); - fn GPIO24(); - fn GPIO25(); - fn GPIO26(); - fn GPIO27(); - fn GPIO28(); - fn GPIO29(); - fn GPIO30(); - fn GPIO31(); - fn PWM0CMP0(); - fn PWM0CMP1(); - fn PWM0CMP2(); - fn PWM0CMP3(); - fn PWM1CMP0(); - fn PWM1CMP1(); - fn PWM1CMP2(); - fn PWM1CMP3(); - fn PWM2CMP0(); - fn PWM2CMP1(); - fn PWM2CMP2(); - fn PWM2CMP3(); - fn I2C0(); -} -#[doc(hidden)] -#[repr(C)] -pub union Vector { - pub _handler: unsafe extern "C" fn(), - pub _reserved: usize, -} -#[cfg(feature = "rt")] -#[doc(hidden)] -#[no_mangle] -pub static __EXTERNAL_INTERRUPTS: [Vector; 53] = [ - Vector { _reserved: 0 }, - Vector { _handler: WATCHDOG }, - Vector { _handler: RTC }, - Vector { _handler: UART0 }, - Vector { _handler: UART1 }, - Vector { _handler: QSPI0 }, - Vector { _handler: QSPI1 }, - Vector { _handler: QSPI2 }, - Vector { _handler: GPIO0 }, - Vector { _handler: GPIO1 }, - Vector { _handler: GPIO2 }, - Vector { _handler: GPIO3 }, - Vector { _handler: GPIO4 }, - Vector { _handler: GPIO5 }, - Vector { _handler: GPIO6 }, - Vector { _handler: GPIO7 }, - Vector { _handler: GPIO8 }, - Vector { _handler: GPIO9 }, - Vector { _handler: GPIO10 }, - Vector { _handler: GPIO11 }, - Vector { _handler: GPIO12 }, - Vector { _handler: GPIO13 }, - Vector { _handler: GPIO14 }, - Vector { _handler: GPIO15 }, - Vector { _handler: GPIO16 }, - Vector { _handler: GPIO17 }, - Vector { _handler: GPIO18 }, - Vector { _handler: GPIO19 }, - Vector { _handler: GPIO20 }, - Vector { _handler: GPIO21 }, - Vector { _handler: GPIO22 }, - Vector { _handler: GPIO23 }, - Vector { _handler: GPIO24 }, - Vector { _handler: GPIO25 }, - Vector { _handler: GPIO26 }, - Vector { _handler: GPIO27 }, - Vector { _handler: GPIO28 }, - Vector { _handler: GPIO29 }, - Vector { _handler: GPIO30 }, - Vector { _handler: GPIO31 }, - Vector { _handler: PWM0CMP0 }, - Vector { _handler: PWM0CMP1 }, - Vector { _handler: PWM0CMP2 }, - Vector { _handler: PWM0CMP3 }, - Vector { _handler: PWM1CMP0 }, - Vector { _handler: PWM1CMP1 }, - Vector { _handler: PWM1CMP2 }, - Vector { _handler: PWM1CMP3 }, - Vector { _handler: PWM2CMP0 }, - Vector { _handler: PWM2CMP1 }, - Vector { _handler: PWM2CMP2 }, - Vector { _handler: PWM2CMP3 }, - Vector { _handler: I2C0 }, -]; -#[doc(hidden)] +#[doc = r" Interrupt numbers, priority levels, and HART IDs."] pub mod interrupt; -pub use self::interrupt::Interrupt; -#[doc = "Coreplex Local Interrupts"] -pub struct Clint { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for Clint {} -impl Clint { - #[doc = r"Pointer to the register block"] - pub const PTR: *const clint::RegisterBlock = 0x0200_0000 as *const _; - #[doc = r"Return the pointer to the register block"] - #[inline(always)] - pub const fn ptr() -> *const clint::RegisterBlock { - Self::PTR - } - #[doc = r" Steal an instance of this peripheral"] - #[doc = r""] - #[doc = r" # Safety"] - #[doc = r""] - #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] - #[doc = r" that may race with any existing instances, for example by only"] - #[doc = r" accessing read-only or write-only registers, or by consuming the"] - #[doc = r" original peripheral and using critical sections to coordinate"] - #[doc = r" access between multiple new instances."] - #[doc = r""] - #[doc = r" Additionally, other software such as HALs may rely on only one"] - #[doc = r" peripheral instance existing to ensure memory safety; ensure"] - #[doc = r" no stolen instances are passed to such software."] - pub unsafe fn steal() -> Self { - Self { - _marker: PhantomData, - } - } -} -impl Deref for Clint { - type Target = clint::RegisterBlock; - #[inline(always)] - fn deref(&self) -> &Self::Target { - unsafe { &*Self::PTR } - } -} -impl core::fmt::Debug for Clint { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("Clint").finish() - } -} -#[doc = "Coreplex Local Interrupts"] -pub mod clint; -#[doc = "Platform Level Interrupt Control"] -pub struct Plic { - _marker: PhantomData<*const ()>, -} -unsafe impl Send for Plic {} -impl Plic { - #[doc = r"Pointer to the register block"] - pub const PTR: *const plic::RegisterBlock = 0x0c00_0000 as *const _; - #[doc = r"Return the pointer to the register block"] - #[inline(always)] - pub const fn ptr() -> *const plic::RegisterBlock { - Self::PTR - } - #[doc = r" Steal an instance of this peripheral"] - #[doc = r""] - #[doc = r" # Safety"] - #[doc = r""] - #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] - #[doc = r" that may race with any existing instances, for example by only"] - #[doc = r" accessing read-only or write-only registers, or by consuming the"] - #[doc = r" original peripheral and using critical sections to coordinate"] - #[doc = r" access between multiple new instances."] - #[doc = r""] - #[doc = r" Additionally, other software such as HALs may rely on only one"] - #[doc = r" peripheral instance existing to ensure memory safety; ensure"] - #[doc = r" no stolen instances are passed to such software."] - pub unsafe fn steal() -> Self { - Self { - _marker: PhantomData, - } - } -} -impl Deref for Plic { - type Target = plic::RegisterBlock; - #[inline(always)] - fn deref(&self) -> &Self::Target { - unsafe { &*Self::PTR } - } -} -impl core::fmt::Debug for Plic { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("Plic").finish() - } -} -#[doc = "Platform Level Interrupt Control"] -pub mod plic; +riscv_peripheral :: clint_codegen ! (base 0x2000000 , freq 32768 , mtimecmps [mtimecmp0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] , msips [msip0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] ,); +riscv_peripheral :: plic_codegen ! (base 0xC000000 , ctxs [ctx0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] ,); #[doc = "Watchdog"] pub struct Wdog { _marker: PhantomData<*const ()>, @@ -1010,10 +800,6 @@ static mut DEVICE_PERIPHERALS: bool = false; #[doc = r" All the peripherals."] #[allow(non_snake_case)] pub struct Peripherals { - #[doc = "CLINT"] - pub clint: Clint, - #[doc = "PLIC"] - pub plic: Plic, #[doc = "WDOG"] pub wdog: Wdog, #[doc = "RTC"] @@ -1070,8 +856,6 @@ impl Peripherals { pub unsafe fn steal() -> Self { DEVICE_PERIPHERALS = true; Peripherals { - clint: Clint::steal(), - plic: Plic::steal(), wdog: Wdog::steal(), rtc: Rtc::steal(), aonclk: Aonclk::steal(), diff --git a/e310x/src/plic.rs b/e310x/src/plic.rs deleted file mode 100644 index 0fcb34a..0000000 --- a/e310x/src/plic.rs +++ /dev/null @@ -1,87 +0,0 @@ -#[repr(C)] -#[doc = "Register block"] -pub struct RegisterBlock { - priority: [Priority; 53], - _reserved1: [u8; 0x0f2c], - pending: [Pending; 2], - _reserved2: [u8; 0x0ff8], - enable: [Enable; 2], - _reserved3: [u8; 0x001f_dff8], - threshold: Threshold, - claim: Claim, -} -impl RegisterBlock { - #[doc = "0x00..0xd4 - Interrupt Priority Register"] - #[inline(always)] - pub const fn priority(&self, n: usize) -> &Priority { - &self.priority[n] - } - #[doc = "Iterator for array of:"] - #[doc = "0x00..0xd4 - Interrupt Priority Register"] - #[inline(always)] - pub fn priority_iter(&self) -> impl Iterator { - self.priority.iter() - } - #[doc = "0x1000..0x1008 - Interrupt Pending Register"] - #[inline(always)] - pub const fn pending(&self, n: usize) -> &Pending { - &self.pending[n] - } - #[doc = "Iterator for array of:"] - #[doc = "0x1000..0x1008 - Interrupt Pending Register"] - #[inline(always)] - pub fn pending_iter(&self) -> impl Iterator { - self.pending.iter() - } - #[doc = "0x2000..0x2008 - Interrupt Enable Register"] - #[inline(always)] - pub const fn enable(&self, n: usize) -> &Enable { - &self.enable[n] - } - #[doc = "Iterator for array of:"] - #[doc = "0x2000..0x2008 - Interrupt Enable Register"] - #[inline(always)] - pub fn enable_iter(&self) -> impl Iterator { - self.enable.iter() - } - #[doc = "0x200000 - Priority Threshold Register"] - #[inline(always)] - pub const fn threshold(&self) -> &Threshold { - &self.threshold - } - #[doc = "0x200004 - Claim/Complete Register"] - #[inline(always)] - pub const fn claim(&self) -> &Claim { - &self.claim - } -} -#[doc = "priority (rw) register accessor: Interrupt Priority Register\n\nYou can [`read`](crate::Reg::read) this register and get [`priority::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`priority::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@priority`] -module"] -#[doc(alias = "priority")] -pub type Priority = crate::Reg; -#[doc = "Interrupt Priority Register"] -pub mod priority; -#[doc = "pending (rw) register accessor: Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pending::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pending::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pending`] -module"] -#[doc(alias = "pending")] -pub type Pending = crate::Reg; -#[doc = "Interrupt Pending Register"] -pub mod pending; -#[doc = "enable (rw) register accessor: Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`enable::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`enable::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@enable`] -module"] -#[doc(alias = "enable")] -pub type Enable = crate::Reg; -#[doc = "Interrupt Enable Register"] -pub mod enable; -#[doc = "threshold (rw) register accessor: Priority Threshold Register\n\nYou can [`read`](crate::Reg::read) this register and get [`threshold::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`threshold::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@threshold`] -module"] -#[doc(alias = "threshold")] -pub type Threshold = crate::Reg; -#[doc = "Priority Threshold Register"] -pub mod threshold; -#[doc = "claim (rw) register accessor: Claim/Complete Register\n\nYou can [`read`](crate::Reg::read) this register and get [`claim::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`claim::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@claim`] -module"] -#[doc(alias = "claim")] -pub type Claim = crate::Reg; -#[doc = "Claim/Complete Register"] -pub mod claim; diff --git a/e310x/src/plic/claim.rs b/e310x/src/plic/claim.rs deleted file mode 100644 index 94bbdef..0000000 --- a/e310x/src/plic/claim.rs +++ /dev/null @@ -1,27 +0,0 @@ -#[doc = "Register `claim` reader"] -pub type R = crate::R; -#[doc = "Register `claim` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Claim/Complete Register\n\nYou can [`read`](crate::Reg::read) this register and get [`claim::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`claim::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct ClaimSpec; -impl crate::RegisterSpec for ClaimSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`claim::R`](R) reader structure"] -impl crate::Readable for ClaimSpec {} -#[doc = "`write(|w| ..)` method takes [`claim::W`](W) writer structure"] -impl crate::Writable for ClaimSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets claim to value 0"] -impl crate::Resettable for ClaimSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/plic/enable.rs b/e310x/src/plic/enable.rs deleted file mode 100644 index 49582b8..0000000 --- a/e310x/src/plic/enable.rs +++ /dev/null @@ -1,28 +0,0 @@ -#[doc = "Register `enable[%s]` reader"] -pub type R = crate::R; -#[doc = "Register `enable[%s]` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`enable::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`enable::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct EnableSpec; -impl crate::RegisterSpec for EnableSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`enable::R`](R) reader structure"] -impl crate::Readable for EnableSpec {} -#[doc = "`write(|w| ..)` method takes [`enable::W`](W) writer structure"] -impl crate::Writable for EnableSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets enable[%s] -to value 0"] -impl crate::Resettable for EnableSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/plic/pending.rs b/e310x/src/plic/pending.rs deleted file mode 100644 index 7edf1ec..0000000 --- a/e310x/src/plic/pending.rs +++ /dev/null @@ -1,28 +0,0 @@ -#[doc = "Register `pending[%s]` reader"] -pub type R = crate::R; -#[doc = "Register `pending[%s]` writer"] -pub type W = crate::W; -impl core::fmt::Debug for R { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.bits()) - } -} -impl W {} -#[doc = "Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pending::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pending::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct PendingSpec; -impl crate::RegisterSpec for PendingSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`pending::R`](R) reader structure"] -impl crate::Readable for PendingSpec {} -#[doc = "`write(|w| ..)` method takes [`pending::W`](W) writer structure"] -impl crate::Writable for PendingSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets pending[%s] -to value 0"] -impl crate::Resettable for PendingSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/plic/priority.rs b/e310x/src/plic/priority.rs deleted file mode 100644 index b63d655..0000000 --- a/e310x/src/plic/priority.rs +++ /dev/null @@ -1,175 +0,0 @@ -#[doc = "Register `priority[%s]` reader"] -pub type R = crate::R; -#[doc = "Register `priority[%s]` writer"] -pub type W = crate::W; -#[doc = "\n\nValue on reset: 0"] -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[repr(u8)] -pub enum Priority { - #[doc = "0: Priority 0 (never interrupt)"] - P0 = 0, - #[doc = "1: Priority 1"] - P1 = 1, - #[doc = "2: Priority 2"] - P2 = 2, - #[doc = "3: Priority 3"] - P3 = 3, - #[doc = "4: Priority 4"] - P4 = 4, - #[doc = "5: Priority 5"] - P5 = 5, - #[doc = "6: Priority 6"] - P6 = 6, - #[doc = "7: Priority 7"] - P7 = 7, -} -impl From for u8 { - #[inline(always)] - fn from(variant: Priority) -> Self { - variant as _ - } -} -impl crate::FieldSpec for Priority { - type Ux = u8; -} -impl crate::IsEnum for Priority {} -#[doc = "Field `priority` reader - "] -pub type PriorityR = crate::FieldReader; -impl PriorityR { - #[doc = "Get enumerated values variant"] - #[inline(always)] - pub const fn variant(&self) -> Priority { - match self.bits { - 0 => Priority::P0, - 1 => Priority::P1, - 2 => Priority::P2, - 3 => Priority::P3, - 4 => Priority::P4, - 5 => Priority::P5, - 6 => Priority::P6, - 7 => Priority::P7, - _ => unreachable!(), - } - } - #[doc = "Priority 0 (never interrupt)"] - #[inline(always)] - pub fn is_p0(&self) -> bool { - *self == Priority::P0 - } - #[doc = "Priority 1"] - #[inline(always)] - pub fn is_p1(&self) -> bool { - *self == Priority::P1 - } - #[doc = "Priority 2"] - #[inline(always)] - pub fn is_p2(&self) -> bool { - *self == Priority::P2 - } - #[doc = "Priority 3"] - #[inline(always)] - pub fn is_p3(&self) -> bool { - *self == Priority::P3 - } - #[doc = "Priority 4"] - #[inline(always)] - pub fn is_p4(&self) -> bool { - *self == Priority::P4 - } - #[doc = "Priority 5"] - #[inline(always)] - pub fn is_p5(&self) -> bool { - *self == Priority::P5 - } - #[doc = "Priority 6"] - #[inline(always)] - pub fn is_p6(&self) -> bool { - *self == Priority::P6 - } - #[doc = "Priority 7"] - #[inline(always)] - pub fn is_p7(&self) -> bool { - *self == Priority::P7 - } -} -#[doc = "Field `priority` writer - "] -pub type PriorityW<'a, REG> = crate::FieldWriter<'a, REG, 3, Priority, crate::Safe>; -impl<'a, REG> PriorityW<'a, REG> -where - REG: crate::Writable + crate::RegisterSpec, - REG::Ux: From, -{ - #[doc = "Priority 0 (never interrupt)"] - #[inline(always)] - pub fn p0(self) -> &'a mut crate::W { - self.variant(Priority::P0) - } - #[doc = "Priority 1"] - #[inline(always)] - pub fn p1(self) -> &'a mut crate::W { - self.variant(Priority::P1) - } - #[doc = "Priority 2"] - #[inline(always)] - pub fn p2(self) -> &'a mut crate::W { - self.variant(Priority::P2) - } - #[doc = "Priority 3"] - #[inline(always)] - pub fn p3(self) -> &'a mut crate::W { - self.variant(Priority::P3) - } - #[doc = "Priority 4"] - #[inline(always)] - pub fn p4(self) -> &'a mut crate::W { - self.variant(Priority::P4) - } - #[doc = "Priority 5"] - #[inline(always)] - pub fn p5(self) -> &'a mut crate::W { - self.variant(Priority::P5) - } - #[doc = "Priority 6"] - #[inline(always)] - pub fn p6(self) -> &'a mut crate::W { - self.variant(Priority::P6) - } - #[doc = "Priority 7"] - #[inline(always)] - pub fn p7(self) -> &'a mut crate::W { - self.variant(Priority::P7) - } -} -impl R { - #[doc = "Bits 0:2"] - #[inline(always)] - pub fn priority(&self) -> PriorityR { - PriorityR::new((self.bits & 7) as u8) - } -} -impl W { - #[doc = "Bits 0:2"] - #[inline(always)] - #[must_use] - pub fn priority(&mut self) -> PriorityW { - PriorityW::new(self, 0) - } -} -#[doc = "Interrupt Priority Register\n\nYou can [`read`](crate::Reg::read) this register and get [`priority::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`priority::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct PrioritySpec; -impl crate::RegisterSpec for PrioritySpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`priority::R`](R) reader structure"] -impl crate::Readable for PrioritySpec {} -#[doc = "`write(|w| ..)` method takes [`priority::W`](W) writer structure"] -impl crate::Writable for PrioritySpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets priority[%s] -to value 0"] -impl crate::Resettable for PrioritySpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/plic/threshold.rs b/e310x/src/plic/threshold.rs deleted file mode 100644 index 69a870d..0000000 --- a/e310x/src/plic/threshold.rs +++ /dev/null @@ -1,174 +0,0 @@ -#[doc = "Register `threshold` reader"] -pub type R = crate::R; -#[doc = "Register `threshold` writer"] -pub type W = crate::W; -#[doc = "\n\nValue on reset: 0"] -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[repr(u8)] -pub enum Priority { - #[doc = "0: Allow interrupts with priority > 0"] - P0 = 0, - #[doc = "1: Allow interrupts with priority > 1"] - P1 = 1, - #[doc = "2: Allow interrupts with priority > 2"] - P2 = 2, - #[doc = "3: Allow interrupts with priority > 3"] - P3 = 3, - #[doc = "4: Allow interrupts with priority > 4"] - P4 = 4, - #[doc = "5: Allow interrupts with priority > 5"] - P5 = 5, - #[doc = "6: Allow interrupts with priority > 6"] - P6 = 6, - #[doc = "7: Mask all interrupts"] - P7 = 7, -} -impl From for u8 { - #[inline(always)] - fn from(variant: Priority) -> Self { - variant as _ - } -} -impl crate::FieldSpec for Priority { - type Ux = u8; -} -impl crate::IsEnum for Priority {} -#[doc = "Field `priority` reader - "] -pub type PriorityR = crate::FieldReader; -impl PriorityR { - #[doc = "Get enumerated values variant"] - #[inline(always)] - pub const fn variant(&self) -> Priority { - match self.bits { - 0 => Priority::P0, - 1 => Priority::P1, - 2 => Priority::P2, - 3 => Priority::P3, - 4 => Priority::P4, - 5 => Priority::P5, - 6 => Priority::P6, - 7 => Priority::P7, - _ => unreachable!(), - } - } - #[doc = "Allow interrupts with priority > 0"] - #[inline(always)] - pub fn is_p0(&self) -> bool { - *self == Priority::P0 - } - #[doc = "Allow interrupts with priority > 1"] - #[inline(always)] - pub fn is_p1(&self) -> bool { - *self == Priority::P1 - } - #[doc = "Allow interrupts with priority > 2"] - #[inline(always)] - pub fn is_p2(&self) -> bool { - *self == Priority::P2 - } - #[doc = "Allow interrupts with priority > 3"] - #[inline(always)] - pub fn is_p3(&self) -> bool { - *self == Priority::P3 - } - #[doc = "Allow interrupts with priority > 4"] - #[inline(always)] - pub fn is_p4(&self) -> bool { - *self == Priority::P4 - } - #[doc = "Allow interrupts with priority > 5"] - #[inline(always)] - pub fn is_p5(&self) -> bool { - *self == Priority::P5 - } - #[doc = "Allow interrupts with priority > 6"] - #[inline(always)] - pub fn is_p6(&self) -> bool { - *self == Priority::P6 - } - #[doc = "Mask all interrupts"] - #[inline(always)] - pub fn is_p7(&self) -> bool { - *self == Priority::P7 - } -} -#[doc = "Field `priority` writer - "] -pub type PriorityW<'a, REG> = crate::FieldWriter<'a, REG, 3, Priority, crate::Safe>; -impl<'a, REG> PriorityW<'a, REG> -where - REG: crate::Writable + crate::RegisterSpec, - REG::Ux: From, -{ - #[doc = "Allow interrupts with priority > 0"] - #[inline(always)] - pub fn p0(self) -> &'a mut crate::W { - self.variant(Priority::P0) - } - #[doc = "Allow interrupts with priority > 1"] - #[inline(always)] - pub fn p1(self) -> &'a mut crate::W { - self.variant(Priority::P1) - } - #[doc = "Allow interrupts with priority > 2"] - #[inline(always)] - pub fn p2(self) -> &'a mut crate::W { - self.variant(Priority::P2) - } - #[doc = "Allow interrupts with priority > 3"] - #[inline(always)] - pub fn p3(self) -> &'a mut crate::W { - self.variant(Priority::P3) - } - #[doc = "Allow interrupts with priority > 4"] - #[inline(always)] - pub fn p4(self) -> &'a mut crate::W { - self.variant(Priority::P4) - } - #[doc = "Allow interrupts with priority > 5"] - #[inline(always)] - pub fn p5(self) -> &'a mut crate::W { - self.variant(Priority::P5) - } - #[doc = "Allow interrupts with priority > 6"] - #[inline(always)] - pub fn p6(self) -> &'a mut crate::W { - self.variant(Priority::P6) - } - #[doc = "Mask all interrupts"] - #[inline(always)] - pub fn p7(self) -> &'a mut crate::W { - self.variant(Priority::P7) - } -} -impl R { - #[doc = "Bits 0:2"] - #[inline(always)] - pub fn priority(&self) -> PriorityR { - PriorityR::new((self.bits & 7) as u8) - } -} -impl W { - #[doc = "Bits 0:2"] - #[inline(always)] - #[must_use] - pub fn priority(&mut self) -> PriorityW { - PriorityW::new(self, 0) - } -} -#[doc = "Priority Threshold Register\n\nYou can [`read`](crate::Reg::read) this register and get [`threshold::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`threshold::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub struct ThresholdSpec; -impl crate::RegisterSpec for ThresholdSpec { - type Ux = u32; -} -#[doc = "`read()` method returns [`threshold::R`](R) reader structure"] -impl crate::Readable for ThresholdSpec {} -#[doc = "`write(|w| ..)` method takes [`threshold::W`](W) writer structure"] -impl crate::Writable for ThresholdSpec { - type Safety = crate::Unsafe; - const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; - const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; -} -#[doc = "`reset()` method sets threshold to value 0"] -impl crate::Resettable for ThresholdSpec { - const RESET_VALUE: u32 = 0; -} diff --git a/e310x/src/pmu/pmucause.rs b/e310x/src/pmu/pmucause.rs index f716e32..eabe01a 100644 --- a/e310x/src/pmu/pmucause.rs +++ b/e310x/src/pmu/pmucause.rs @@ -163,13 +163,11 @@ impl R { impl W { #[doc = "Bits 0:1"] #[inline(always)] - #[must_use] pub fn wakeupcause(&mut self) -> WakeupcauseW { WakeupcauseW::new(self, 0) } #[doc = "Bits 8:9"] #[inline(always)] - #[must_use] pub fn resetcause(&mut self) -> ResetcauseW { ResetcauseW::new(self, 8) } diff --git a/e310x/src/pmu/pmuie.rs b/e310x/src/pmu/pmuie.rs index 023c965..91a9175 100644 --- a/e310x/src/pmu/pmuie.rs +++ b/e310x/src/pmu/pmuie.rs @@ -34,19 +34,16 @@ impl R { impl W { #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn rtc(&mut self) -> RtcW { RtcW::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - #[must_use] pub fn dwakeup(&mut self) -> DwakeupW { DwakeupW::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - #[must_use] pub fn awakeup(&mut self) -> AwakeupW { AwakeupW::new(self, 3) } diff --git a/e310x/src/pmu/pmusleep.rs b/e310x/src/pmu/pmusleep.rs index 7cdc56d..1aee511 100644 --- a/e310x/src/pmu/pmusleep.rs +++ b/e310x/src/pmu/pmusleep.rs @@ -5,7 +5,6 @@ pub type SleepW<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn sleep(&mut self) -> SleepW { SleepW::new(self, 0) } diff --git a/e310x/src/pmu/pmusleeppm.rs b/e310x/src/pmu/pmusleeppm.rs index cf59af6..ec6a724 100644 --- a/e310x/src/pmu/pmusleeppm.rs +++ b/e310x/src/pmu/pmusleeppm.rs @@ -61,37 +61,31 @@ impl R { impl W { #[doc = "Bits 0:3"] #[inline(always)] - #[must_use] pub fn delay(&mut self) -> DelayW { DelayW::new(self, 0) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pmu_out_0_en(&mut self) -> PmuOut0EnW { PmuOut0EnW::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pmu_out_1_en(&mut self) -> PmuOut1EnW { PmuOut1EnW::new(self, 5) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn corerst(&mut self) -> CorerstW { CorerstW::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn hfclkrst(&mut self) -> HfclkrstW { HfclkrstW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn isolate(&mut self) -> IsolateW { IsolateW::new(self, 9) } diff --git a/e310x/src/pmu/pmuwakepm.rs b/e310x/src/pmu/pmuwakepm.rs index 030488e..4825b40 100644 --- a/e310x/src/pmu/pmuwakepm.rs +++ b/e310x/src/pmu/pmuwakepm.rs @@ -61,37 +61,31 @@ impl R { impl W { #[doc = "Bits 0:3"] #[inline(always)] - #[must_use] pub fn delay(&mut self) -> DelayW { DelayW::new(self, 0) } #[doc = "Bit 4"] #[inline(always)] - #[must_use] pub fn pmu_out_0_en(&mut self) -> PmuOut0EnW { PmuOut0EnW::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - #[must_use] pub fn pmu_out_1_en(&mut self) -> PmuOut1EnW { PmuOut1EnW::new(self, 5) } #[doc = "Bit 7"] #[inline(always)] - #[must_use] pub fn corerst(&mut self) -> CorerstW { CorerstW::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn hfclkrst(&mut self) -> HfclkrstW { HfclkrstW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn isolate(&mut self) -> IsolateW { IsolateW::new(self, 9) } diff --git a/e310x/src/prci/hfrosccfg.rs b/e310x/src/prci/hfrosccfg.rs index a9d2491..7aad64d 100644 --- a/e310x/src/prci/hfrosccfg.rs +++ b/e310x/src/prci/hfrosccfg.rs @@ -43,25 +43,21 @@ impl R { impl W { #[doc = "Bits 0:5"] #[inline(always)] - #[must_use] pub fn div(&mut self) -> DivW { DivW::new(self, 0) } #[doc = "Bits 16:20"] #[inline(always)] - #[must_use] pub fn trim(&mut self) -> TrimW { TrimW::new(self, 16) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn enable(&mut self) -> EnableW { EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn ready(&mut self) -> ReadyW { ReadyW::new(self, 31) } diff --git a/e310x/src/prci/hfxosccfg.rs b/e310x/src/prci/hfxosccfg.rs index ad2cdc9..a29ca19 100644 --- a/e310x/src/prci/hfxosccfg.rs +++ b/e310x/src/prci/hfxosccfg.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn enable(&mut self) -> EnableW { EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn ready(&mut self) -> ReadyW { ReadyW::new(self, 31) } diff --git a/e310x/src/prci/pllcfg.rs b/e310x/src/prci/pllcfg.rs index cd00cd4..4501cba 100644 --- a/e310x/src/prci/pllcfg.rs +++ b/e310x/src/prci/pllcfg.rs @@ -221,43 +221,36 @@ impl R { impl W { #[doc = "Bits 0:2"] #[inline(always)] - #[must_use] pub fn pllr(&mut self) -> PllrW { PllrW::new(self, 0) } #[doc = "Bits 4:9"] #[inline(always)] - #[must_use] pub fn pllf(&mut self) -> PllfW { PllfW::new(self, 4) } #[doc = "Bits 10:11"] #[inline(always)] - #[must_use] pub fn pllq(&mut self) -> PllqW { PllqW::new(self, 10) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn sel(&mut self) -> SelW { SelW::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn refsel(&mut self) -> RefselW { RefselW::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn bypass(&mut self) -> BypassW { BypassW::new(self, 18) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn lock(&mut self) -> LockW { LockW::new(self, 31) } diff --git a/e310x/src/prci/plloutdiv.rs b/e310x/src/prci/plloutdiv.rs index 44b4b49..b3fb059 100644 --- a/e310x/src/prci/plloutdiv.rs +++ b/e310x/src/prci/plloutdiv.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:5"] #[inline(always)] - #[must_use] pub fn div(&mut self) -> DivW { DivW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn divby1(&mut self) -> Divby1W { Divby1W::new(self, 8) } diff --git a/e310x/src/pwm0/cfg.rs b/e310x/src/pwm0/cfg.rs index 29adbd8..6916b32 100644 --- a/e310x/src/pwm0/cfg.rs +++ b/e310x/src/pwm0/cfg.rs @@ -169,109 +169,91 @@ impl R { impl W { #[doc = "Bits 0:3"] #[inline(always)] - #[must_use] pub fn scale(&mut self) -> ScaleW { ScaleW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn sticky(&mut self) -> StickyW { StickyW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn zerocmp(&mut self) -> ZerocmpW { ZerocmpW::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - #[must_use] pub fn deglitch(&mut self) -> DeglitchW { DeglitchW::new(self, 10) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn enalways(&mut self) -> EnalwaysW { EnalwaysW::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn enoneshot(&mut self) -> EnoneshotW { EnoneshotW::new(self, 13) } #[doc = "Bit 16"] #[inline(always)] - #[must_use] pub fn cmp0center(&mut self) -> Cmp0centerW { Cmp0centerW::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - #[must_use] pub fn cmp1center(&mut self) -> Cmp1centerW { Cmp1centerW::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - #[must_use] pub fn cmp2center(&mut self) -> Cmp2centerW { Cmp2centerW::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - #[must_use] pub fn cmp3center(&mut self) -> Cmp3centerW { Cmp3centerW::new(self, 19) } #[doc = "Bit 24"] #[inline(always)] - #[must_use] pub fn cmp0gang(&mut self) -> Cmp0gangW { Cmp0gangW::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - #[must_use] pub fn cmp1gang(&mut self) -> Cmp1gangW { Cmp1gangW::new(self, 25) } #[doc = "Bits 26:36"] #[inline(always)] - #[must_use] pub fn cmp2gang(&mut self) -> Cmp2gangW { Cmp2gangW::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - #[must_use] pub fn cmp3gang(&mut self) -> Cmp3gangW { Cmp3gangW::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn cmp0ip(&mut self) -> Cmp0ipW { Cmp0ipW::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - #[must_use] pub fn cmp1ip(&mut self) -> Cmp1ipW { Cmp1ipW::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - #[must_use] pub fn cmp2ip(&mut self) -> Cmp2ipW { Cmp2ipW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn cmp3ip(&mut self) -> Cmp3ipW { Cmp3ipW::new(self, 31) } diff --git a/e310x/src/pwm0/cmp0.rs b/e310x/src/pwm0/cmp0.rs index ae5e513..04be4bb 100644 --- a/e310x/src/pwm0/cmp0.rs +++ b/e310x/src/pwm0/cmp0.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/pwm0/cmp1.rs b/e310x/src/pwm0/cmp1.rs index ab2467e..f572068 100644 --- a/e310x/src/pwm0/cmp1.rs +++ b/e310x/src/pwm0/cmp1.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/pwm0/cmp2.rs b/e310x/src/pwm0/cmp2.rs index 4b8e903..09ebfe1 100644 --- a/e310x/src/pwm0/cmp2.rs +++ b/e310x/src/pwm0/cmp2.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/pwm0/cmp3.rs b/e310x/src/pwm0/cmp3.rs index c40bd1e..c3f60a7 100644 --- a/e310x/src/pwm0/cmp3.rs +++ b/e310x/src/pwm0/cmp3.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/qspi0/csmode.rs b/e310x/src/qspi0/csmode.rs index acad207..bc1621b 100644 --- a/e310x/src/qspi0/csmode.rs +++ b/e310x/src/qspi0/csmode.rs @@ -85,7 +85,6 @@ impl R { impl W { #[doc = "Bits 0:1 - Chip select mode"] #[inline(always)] - #[must_use] pub fn mode(&mut self) -> ModeW { ModeW::new(self, 0) } diff --git a/e310x/src/qspi0/delay0.rs b/e310x/src/qspi0/delay0.rs index 328caa7..dbf3898 100644 --- a/e310x/src/qspi0/delay0.rs +++ b/e310x/src/qspi0/delay0.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7 - CS to SCK Delay"] #[inline(always)] - #[must_use] pub fn cssck(&mut self) -> CssckW { CssckW::new(self, 0) } #[doc = "Bits 16:23 - SCK to CS Delay"] #[inline(always)] - #[must_use] pub fn sckcs(&mut self) -> SckcsW { SckcsW::new(self, 16) } diff --git a/e310x/src/qspi0/delay1.rs b/e310x/src/qspi0/delay1.rs index 83f393d..2b9a0a6 100644 --- a/e310x/src/qspi0/delay1.rs +++ b/e310x/src/qspi0/delay1.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7 - Minimum CS inactive time"] #[inline(always)] - #[must_use] pub fn intercs(&mut self) -> IntercsW { IntercsW::new(self, 0) } #[doc = "Bits 16:23 - Maximum interframe delay"] #[inline(always)] - #[must_use] pub fn interxfr(&mut self) -> InterxfrW { InterxfrW::new(self, 16) } diff --git a/e310x/src/qspi0/fctrl.rs b/e310x/src/qspi0/fctrl.rs index 9336ba8..9d3bd34 100644 --- a/e310x/src/qspi0/fctrl.rs +++ b/e310x/src/qspi0/fctrl.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bit 0 - SPI Flash Mode Select"] #[inline(always)] - #[must_use] pub fn en(&mut self) -> EnW { EnW::new(self, 0) } diff --git a/e310x/src/qspi0/ffmt.rs b/e310x/src/qspi0/ffmt.rs index e8493cf..a50a5a9 100644 --- a/e310x/src/qspi0/ffmt.rs +++ b/e310x/src/qspi0/ffmt.rs @@ -286,49 +286,41 @@ impl R { impl W { #[doc = "Bit 0 - Enable sending of command"] #[inline(always)] - #[must_use] pub fn cmd_en(&mut self) -> CmdEnW { CmdEnW::new(self, 0) } #[doc = "Bits 1:3 - Number of address bytes (0 to 4)"] #[inline(always)] - #[must_use] pub fn addr_len(&mut self) -> AddrLenW { AddrLenW::new(self, 1) } #[doc = "Bits 4:7 - Number of dummy cycles"] #[inline(always)] - #[must_use] pub fn pad_cnt(&mut self) -> PadCntW { PadCntW::new(self, 4) } #[doc = "Bits 8:9 - Protocol for transmitting command"] #[inline(always)] - #[must_use] pub fn cmd_proto(&mut self) -> CmdProtoW { CmdProtoW::new(self, 8) } #[doc = "Bits 10:11 - Protocol for transmitting address and padding"] #[inline(always)] - #[must_use] pub fn addr_proto(&mut self) -> AddrProtoW { AddrProtoW::new(self, 10) } #[doc = "Bits 12:13 - Protocol for receiving data bytes"] #[inline(always)] - #[must_use] pub fn data_proto(&mut self) -> DataProtoW { DataProtoW::new(self, 12) } #[doc = "Bits 16:23 - Value of command byte"] #[inline(always)] - #[must_use] pub fn cmd_code(&mut self) -> CmdCodeW { CmdCodeW::new(self, 16) } #[doc = "Bits 24:31 - First 8 bits to transmit during dummy cycles"] #[inline(always)] - #[must_use] pub fn pad_code(&mut self) -> PadCodeW { PadCodeW::new(self, 24) } diff --git a/e310x/src/qspi0/fmt.rs b/e310x/src/qspi0/fmt.rs index ae575bd..cdbefc3 100644 --- a/e310x/src/qspi0/fmt.rs +++ b/e310x/src/qspi0/fmt.rs @@ -210,25 +210,21 @@ impl R { impl W { #[doc = "Bits 0:1 - SPI protocol"] #[inline(always)] - #[must_use] pub fn proto(&mut self) -> ProtoW { ProtoW::new(self, 0) } #[doc = "Bit 2 - SPI endianness"] #[inline(always)] - #[must_use] pub fn endian(&mut self) -> EndianW { EndianW::new(self, 2) } #[doc = "Bit 3 - SPI I/O direction"] #[inline(always)] - #[must_use] pub fn dir(&mut self) -> DirW { DirW::new(self, 3) } #[doc = "Bits 16:19 - Number of bits per frame"] #[inline(always)] - #[must_use] pub fn len(&mut self) -> LenW { LenW::new(self, 16) } diff --git a/e310x/src/qspi0/ie.rs b/e310x/src/qspi0/ie.rs index cd5ebab..ff2bbad 100644 --- a/e310x/src/qspi0/ie.rs +++ b/e310x/src/qspi0/ie.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - #[must_use] pub fn txwm(&mut self) -> TxwmW { TxwmW::new(self, 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - #[must_use] pub fn rxwm(&mut self) -> RxwmW { RxwmW::new(self, 1) } diff --git a/e310x/src/qspi0/ip.rs b/e310x/src/qspi0/ip.rs index 5fffd47..9877dcc 100644 --- a/e310x/src/qspi0/ip.rs +++ b/e310x/src/qspi0/ip.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - #[must_use] pub fn txwm(&mut self) -> TxwmW { TxwmW::new(self, 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - #[must_use] pub fn rxwm(&mut self) -> RxwmW { RxwmW::new(self, 1) } diff --git a/e310x/src/qspi0/rxdata.rs b/e310x/src/qspi0/rxdata.rs index ae16b59..1a8339b 100644 --- a/e310x/src/qspi0/rxdata.rs +++ b/e310x/src/qspi0/rxdata.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7 - Received data"] #[inline(always)] - #[must_use] pub fn data(&mut self) -> DataW { DataW::new(self, 0) } #[doc = "Bit 31 - FIFO empty flag"] #[inline(always)] - #[must_use] pub fn empty(&mut self) -> EmptyW { EmptyW::new(self, 31) } diff --git a/e310x/src/qspi0/rxmark.rs b/e310x/src/qspi0/rxmark.rs index 36dc6df..7082ae4 100644 --- a/e310x/src/qspi0/rxmark.rs +++ b/e310x/src/qspi0/rxmark.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:2 - Receive watermark"] #[inline(always)] - #[must_use] pub fn rxmark(&mut self) -> RxmarkW { RxmarkW::new(self, 0) } diff --git a/e310x/src/qspi0/sckdiv.rs b/e310x/src/qspi0/sckdiv.rs index df80afe..5f9309b 100644 --- a/e310x/src/qspi0/sckdiv.rs +++ b/e310x/src/qspi0/sckdiv.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:11 - Divisor for serial clock"] #[inline(always)] - #[must_use] pub fn div(&mut self) -> DivW { DivW::new(self, 0) } diff --git a/e310x/src/qspi0/sckmode.rs b/e310x/src/qspi0/sckmode.rs index e4a274c..cabc433 100644 --- a/e310x/src/qspi0/sckmode.rs +++ b/e310x/src/qspi0/sckmode.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0 - Serial clock phase"] #[inline(always)] - #[must_use] pub fn pha(&mut self) -> PhaW { PhaW::new(self, 0) } #[doc = "Bit 1 - Serial clock polarity"] #[inline(always)] - #[must_use] pub fn pol(&mut self) -> PolW { PolW::new(self, 1) } diff --git a/e310x/src/qspi0/txdata.rs b/e310x/src/qspi0/txdata.rs index 6764a25..ea01657 100644 --- a/e310x/src/qspi0/txdata.rs +++ b/e310x/src/qspi0/txdata.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7 - Transmit data"] #[inline(always)] - #[must_use] pub fn data(&mut self) -> DataW { DataW::new(self, 0) } #[doc = "Bit 31 - FIFO full flag"] #[inline(always)] - #[must_use] pub fn full(&mut self) -> FullW { FullW::new(self, 31) } diff --git a/e310x/src/qspi0/txmark.rs b/e310x/src/qspi0/txmark.rs index 4f93a7b..4580df7 100644 --- a/e310x/src/qspi0/txmark.rs +++ b/e310x/src/qspi0/txmark.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:2 - Transmit watermark"] #[inline(always)] - #[must_use] pub fn txmark(&mut self) -> TxmarkW { TxmarkW::new(self, 0) } diff --git a/e310x/src/rtc/rtccfg.rs b/e310x/src/rtc/rtccfg.rs index 3c377a2..1f2fdf9 100644 --- a/e310x/src/rtc/rtccfg.rs +++ b/e310x/src/rtc/rtccfg.rs @@ -34,19 +34,16 @@ impl R { impl W { #[doc = "Bits 0:3"] #[inline(always)] - #[must_use] pub fn scale(&mut self) -> ScaleW { ScaleW::new(self, 0) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn enalways(&mut self) -> EnalwaysW { EnalwaysW::new(self, 12) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn cmpip(&mut self) -> CmpipW { CmpipW::new(self, 28) } diff --git a/e310x/src/rtc/rtchi.rs b/e310x/src/rtc/rtchi.rs index 948227e..285c5f7 100644 --- a/e310x/src/rtc/rtchi.rs +++ b/e310x/src/rtc/rtchi.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/uart0/div.rs b/e310x/src/uart0/div.rs index b319636..d977d54 100644 --- a/e310x/src/uart0/div.rs +++ b/e310x/src/uart0/div.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/src/uart0/ie.rs b/e310x/src/uart0/ie.rs index 23bed86..afedfaa 100644 --- a/e310x/src/uart0/ie.rs +++ b/e310x/src/uart0/ie.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn txwm(&mut self) -> TxwmW { TxwmW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn rxwm(&mut self) -> RxwmW { RxwmW::new(self, 1) } diff --git a/e310x/src/uart0/ip.rs b/e310x/src/uart0/ip.rs index e8a97e1..5dd9cfe 100644 --- a/e310x/src/uart0/ip.rs +++ b/e310x/src/uart0/ip.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn txwm(&mut self) -> TxwmW { TxwmW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn rxwm(&mut self) -> RxwmW { RxwmW::new(self, 1) } diff --git a/e310x/src/uart0/rxctrl.rs b/e310x/src/uart0/rxctrl.rs index 82e9f35..7748ff7 100644 --- a/e310x/src/uart0/rxctrl.rs +++ b/e310x/src/uart0/rxctrl.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn enable(&mut self) -> EnableW { EnableW::new(self, 0) } #[doc = "Bits 16:18"] #[inline(always)] - #[must_use] pub fn counter(&mut self) -> CounterW { CounterW::new(self, 16) } diff --git a/e310x/src/uart0/rxdata.rs b/e310x/src/uart0/rxdata.rs index 186129a..30fe1cb 100644 --- a/e310x/src/uart0/rxdata.rs +++ b/e310x/src/uart0/rxdata.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7"] #[inline(always)] - #[must_use] pub fn data(&mut self) -> DataW { DataW::new(self, 0) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn empty(&mut self) -> EmptyW { EmptyW::new(self, 31) } diff --git a/e310x/src/uart0/txctrl.rs b/e310x/src/uart0/txctrl.rs index de13546..53645e1 100644 --- a/e310x/src/uart0/txctrl.rs +++ b/e310x/src/uart0/txctrl.rs @@ -34,19 +34,16 @@ impl R { impl W { #[doc = "Bit 0"] #[inline(always)] - #[must_use] pub fn enable(&mut self) -> EnableW { EnableW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - #[must_use] pub fn nstop(&mut self) -> NstopW { NstopW::new(self, 1) } #[doc = "Bits 16:18"] #[inline(always)] - #[must_use] pub fn counter(&mut self) -> CounterW { CounterW::new(self, 16) } diff --git a/e310x/src/uart0/txdata.rs b/e310x/src/uart0/txdata.rs index e6e23e4..052cbc2 100644 --- a/e310x/src/uart0/txdata.rs +++ b/e310x/src/uart0/txdata.rs @@ -25,13 +25,11 @@ impl R { impl W { #[doc = "Bits 0:7"] #[inline(always)] - #[must_use] pub fn data(&mut self) -> DataW { DataW::new(self, 0) } #[doc = "Bit 31"] #[inline(always)] - #[must_use] pub fn full(&mut self) -> FullW { FullW::new(self, 31) } diff --git a/e310x/src/wdog/wdogcfg.rs b/e310x/src/wdog/wdogcfg.rs index 35fc668..deaca13 100644 --- a/e310x/src/wdog/wdogcfg.rs +++ b/e310x/src/wdog/wdogcfg.rs @@ -61,37 +61,31 @@ impl R { impl W { #[doc = "Bits 0:3"] #[inline(always)] - #[must_use] pub fn scale(&mut self) -> ScaleW { ScaleW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - #[must_use] pub fn rsten(&mut self) -> RstenW { RstenW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - #[must_use] pub fn zerocmp(&mut self) -> ZerocmpW { ZerocmpW::new(self, 9) } #[doc = "Bit 12"] #[inline(always)] - #[must_use] pub fn enalways(&mut self) -> EnalwaysW { EnalwaysW::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - #[must_use] pub fn encoreawake(&mut self) -> EncoreawakeW { EncoreawakeW::new(self, 13) } #[doc = "Bit 28"] #[inline(always)] - #[must_use] pub fn cmpip(&mut self) -> CmpipW { CmpipW::new(self, 28) } diff --git a/e310x/src/wdog/wdogcmp.rs b/e310x/src/wdog/wdogcmp.rs index 49dbb9a..204629d 100644 --- a/e310x/src/wdog/wdogcmp.rs +++ b/e310x/src/wdog/wdogcmp.rs @@ -16,7 +16,6 @@ impl R { impl W { #[doc = "Bits 0:15"] #[inline(always)] - #[must_use] pub fn value(&mut self) -> ValueW { ValueW::new(self, 0) } diff --git a/e310x/update.sh b/e310x/update.sh index f6b8e84..63cae82 100755 --- a/e310x/update.sh +++ b/e310x/update.sh @@ -2,10 +2,10 @@ set -x set -e -# used svd2rust v0.26.0 +# used svd2rust 8b809ac2c1e1a13f30af59ee41f4d66a4995d625 (unreleased) rm -rf src mkdir src -svd2rust --target riscv -g -i e310x.svd +../../svd2rust/target/release/svd2rust --target riscv --settings settings.yaml -g -i e310x.svd mv generic.rs src/ form -i lib.rs -o src/ rm lib.rs diff --git a/hifive1/CHANGELOG.md b/hifive1/CHANGELOG.md index 40286ad..06f6699 100644 --- a/hifive1/CHANGELOG.md +++ b/hifive1/CHANGELOG.md @@ -6,9 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] + - Replace static muts with Mutexes - Apply clippy changes -- Bump MSRV to 1.72 +- Bump MSRV to 1.76 - Adapt to new Cargo workspace - Use inline assembly instead of binary blobs for flash diff --git a/hifive1/Cargo.toml b/hifive1/Cargo.toml index ac01280..0b15885 100644 --- a/hifive1/Cargo.toml +++ b/hifive1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hifive1" -version = "0.13.0" +version = "0.14.0" repository = "https://github.com/riscv-rust/hifive1" authors = ["David Craven "] categories = ["embedded", "hardware-support", "no-std"] @@ -8,13 +8,13 @@ description = "Board support crate for HiFive1 and LoFive boards" keywords = ["riscv", "register", "peripheral"] license = "ISC" edition = "2021" -rust-version = "1.72" +rust-version = "1.76" [dependencies] critical-section = { version = "1.1.3" } -e310x-hal = { path = "../e310x-hal", version = "0.11.0" } +e310x-hal = { path = "../e310x-hal", version = "0.12.0" } embedded-hal = "0.2.7" -riscv = "0.10.1" +riscv = "0.12.1" nb = "1.0.0" [features] @@ -23,7 +23,7 @@ board-hifive1-revb = ["e310x-hal/g002"] board-redv = ["e310x-hal/g002"] board-lofive = [] board-lofive-r1 = ["e310x-hal/g002"] -virq = ["e310x-hal/virq"] +v-trap = ["e310x-hal/v-trap"] [package.metadata.docs.rs] features = ['board-hifive1-revb']