diff --git a/src/chips/nrf51/pac.rs b/src/chips/nrf51/pac.rs index c8806d3..a4424af 100644 --- a/src/chips/nrf51/pac.rs +++ b/src/chips/nrf51/pac.rs @@ -3837,13 +3837,19 @@ pub mod gpiote { } #[doc = "Interrupt enable set register."] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Interrupt enable clear register."] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Channel configuration registers."] #[inline(always)] diff --git a/src/chips/nrf52805/pac.rs b/src/chips/nrf52805/pac.rs index 581067f..417cdba 100644 --- a/src/chips/nrf52805/pac.rs +++ b/src/chips/nrf52805/pac.rs @@ -5452,13 +5452,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -13058,14 +13064,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -13074,34 +13079,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -13131,6 +13127,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -13222,15 +13291,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -13243,43 +13306,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -14085,14 +14111,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -14101,39 +14153,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -14142,24 +14190,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -14239,15 +14328,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -14265,43 +14348,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -16333,14 +16379,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16349,25 +16394,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16397,14 +16442,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16415,13 +16547,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -16513,15 +16682,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -16529,43 +16692,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -16982,13 +17108,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -17018,13 +17144,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -17061,10 +17187,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -17073,7 +17199,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -17363,14 +17489,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17379,25 +17504,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17427,6 +17552,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -17538,15 +17727,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -17570,43 +17753,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -19210,14 +19356,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19226,35 +19371,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19281,12 +19416,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19311,14 +19446,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19327,31 +19461,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -19367,21 +19675,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -19392,16 +19694,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -19447,15 +19739,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -19728,13 +20014,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -19752,13 +20038,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -19788,25 +20074,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -19834,13 +20120,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -19848,7 +20134,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52810/pac.rs b/src/chips/nrf52810/pac.rs index 3e15cfe..79856bf 100644 --- a/src/chips/nrf52810/pac.rs +++ b/src/chips/nrf52810/pac.rs @@ -6374,13 +6374,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\] and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -15410,14 +15416,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15426,34 +15431,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15483,6 +15479,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -15574,15 +15643,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -15595,43 +15658,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -16437,14 +16463,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16453,39 +16505,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16494,24 +16542,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -16591,15 +16680,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -16617,43 +16700,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -18685,14 +18731,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18701,25 +18746,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18749,14 +18794,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18767,13 +18899,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -18865,15 +19034,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -18881,43 +19044,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -19334,13 +19460,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -19370,13 +19496,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -19413,10 +19539,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -19425,7 +19551,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -19715,14 +19841,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19731,25 +19856,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19779,6 +19904,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -19890,15 +20079,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -19922,43 +20105,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -21562,14 +21708,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21578,35 +21723,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21633,12 +21768,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21663,14 +21798,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21679,31 +21813,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -21719,21 +22027,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -21744,16 +22046,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -21799,15 +22091,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -22080,13 +22366,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -22104,13 +22390,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -22140,25 +22426,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -22186,13 +22472,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -22200,7 +22486,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52811/pac.rs b/src/chips/nrf52811/pac.rs index 30f2491..b1fd866 100644 --- a/src/chips/nrf52811/pac.rs +++ b/src/chips/nrf52811/pac.rs @@ -6382,13 +6382,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\] and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -17416,14 +17422,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17432,34 +17437,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17489,6 +17485,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -17580,15 +17649,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -17601,43 +17664,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -18443,14 +18469,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18459,39 +18511,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18500,24 +18548,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -18597,15 +18686,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -18623,43 +18706,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -20691,14 +20737,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20707,25 +20752,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20755,14 +20800,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20773,13 +20905,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -20871,15 +21040,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -20887,43 +21050,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -21340,13 +21466,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -21376,13 +21502,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -21419,10 +21545,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -21431,7 +21557,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -21721,14 +21847,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21737,25 +21862,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21785,6 +21910,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -21896,15 +22085,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -21928,43 +22111,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -23568,14 +23714,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23584,35 +23729,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23639,12 +23774,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23669,14 +23804,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23685,31 +23819,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -23725,21 +24033,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -23750,16 +24052,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -23805,15 +24097,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -24086,13 +24372,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -24110,13 +24396,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -24146,25 +24432,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -24192,13 +24478,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -24206,7 +24492,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52820/pac.rs b/src/chips/nrf52820/pac.rs index facfac5..c0d8a12 100644 --- a/src/chips/nrf52820/pac.rs +++ b/src/chips/nrf52820/pac.rs @@ -6156,13 +6156,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -14574,14 +14580,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -14590,34 +14595,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -14647,6 +14643,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -14738,15 +14807,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -14759,43 +14822,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -15601,14 +15627,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15617,39 +15669,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15658,24 +15706,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -15755,15 +15844,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -15781,43 +15864,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -17849,14 +17895,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17865,25 +17910,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17913,14 +17958,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17931,13 +18063,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -18029,15 +18198,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -18045,43 +18208,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -18498,13 +18624,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -18534,13 +18660,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -18577,10 +18703,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -18589,7 +18715,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -18879,14 +19005,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18895,25 +19020,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18943,6 +19068,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -19054,15 +19243,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -19086,43 +19269,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -20771,14 +20917,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20787,35 +20932,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20842,12 +20977,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20872,14 +21007,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20888,31 +21022,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -20928,21 +21236,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -20953,16 +21255,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -21008,15 +21300,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -21303,13 +21589,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -21327,13 +21613,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -21363,25 +21649,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -21409,13 +21695,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -21423,7 +21709,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52832/pac.rs b/src/chips/nrf52832/pac.rs index 0a5a478..e2fd375 100644 --- a/src/chips/nrf52832/pac.rs +++ b/src/chips/nrf52832/pac.rs @@ -8060,13 +8060,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\] and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -22429,14 +22435,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -22445,34 +22450,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -22502,6 +22498,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -22593,15 +22662,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -22614,43 +22677,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -23464,14 +23490,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23480,39 +23532,62 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transmitted in last granted transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct Psel { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23521,21 +23596,30 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "Pin select for SCK"] #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { + pub const fn sck(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Pin select for MISO signal"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn miso( + self, + ) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Pin select for MOSI signal"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn mosi( + self, + ) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } } #[doc = "SPI Slave 0"] #[derive(Copy, Clone, Eq, PartialEq)] @@ -23613,15 +23697,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -23639,38 +23717,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -25632,14 +25678,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25648,25 +25693,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25696,14 +25741,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25714,13 +25846,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -25812,15 +25981,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -25828,43 +25991,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -26281,13 +26407,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -26317,13 +26443,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task STOP"] @@ -26348,10 +26474,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_stop", &self.lastrx_stop()) .finish() } @@ -26359,7 +26485,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -26649,14 +26775,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26665,25 +26790,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26708,14 +26833,14 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twis {} - unsafe impl Sync for Twis {} - impl Twis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26724,27 +26849,86 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Stop TWI transaction"] + #[doc = "TXD Data pointer"] #[inline(always)] - pub const fn tasks_stop(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Suspend TWI transaction"] + #[doc = "Maximum number of bytes in TXD buffer"] #[inline(always)] - pub const fn tasks_suspend(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Resume TWI transaction"] + #[doc = "Number of bytes transferred in the last TXD transaction"] #[inline(always)] - pub const fn tasks_resume(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Prepare the TWI slave to respond to a write command"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] - pub const fn tasks_preparerx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } } - #[doc = "Prepare the TWI slave to respond to a read command"] + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twis { + ptr: *mut u8, + } + unsafe impl Send for Twis {} + unsafe impl Sync for Twis {} + impl Twis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Stop TWI transaction"] + #[inline(always)] + pub const fn tasks_stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + } + #[doc = "Suspend TWI transaction"] + #[inline(always)] + pub const fn tasks_suspend(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + } + #[doc = "Resume TWI transaction"] + #[inline(always)] + pub const fn tasks_resume(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a write command"] + #[inline(always)] + pub const fn tasks_preparerx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a read command"] #[inline(always)] pub const fn tasks_preparetx(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x34usize) as _) } @@ -26819,15 +27003,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -26851,38 +27029,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -28463,14 +28609,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28479,35 +28624,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28534,12 +28669,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28564,14 +28699,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28580,31 +28714,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -28620,21 +28928,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -28645,16 +28947,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -28700,15 +28992,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -28967,13 +29253,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -28991,13 +29277,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -29027,25 +29313,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -29073,13 +29359,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -29087,7 +29373,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52833/pac.rs b/src/chips/nrf52833/pac.rs index 67ba593..18ea49c 100644 --- a/src/chips/nrf52833/pac.rs +++ b/src/chips/nrf52833/pac.rs @@ -6792,13 +6792,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -23428,14 +23434,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Iftiming { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Iftiming {} - unsafe impl Sync for Iftiming {} - impl Iftiming { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23444,25 +23449,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Sample delay for input serial data on MISO"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxdelay(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Minimum duration between edge of CSN and edge of SCK and minimum duration CSN must stay high between transactions"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn csndur(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } - #[doc = "Unspecified"] + #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23471,39 +23476,35 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "Data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "RXD EasyDMA channel"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -23517,19 +23518,87 @@ pub mod spim { pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Iftiming { + ptr: *mut u8, + } + unsafe impl Send for Iftiming {} + unsafe impl Sync for Iftiming {} + impl Iftiming { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Sample delay for input serial data on MISO"] + #[inline(always)] + pub const fn rxdelay(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Minimum duration between edge of CSN and edge of SCK and minimum duration CSN must stay high between transactions"] + #[inline(always)] + pub const fn csndur(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -23629,15 +23698,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -23672,43 +23735,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -24756,14 +24782,13 @@ pub mod spim { } } pub mod spis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -24772,39 +24797,25 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MISO signal"] - #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -24834,14 +24845,14 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "SPI Slave 0"] + #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Spis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Spis {} - unsafe impl Sync for Spis {} - impl Spis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -24850,40 +24861,118 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Acquire SPI semaphore"] + #[doc = "TXD data pointer"] #[inline(always)] - pub const fn tasks_acquire(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn tasks_release(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Granted transaction completed"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn events_end(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "End of RXD buffer reached"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Semaphore acquired"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] - pub const fn events_acquired(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } } - #[doc = "Shortcuts between local events and tasks"] #[inline(always)] - pub const fn shorts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0200usize) as _) } + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ } - #[doc = "Enable interrupt"] + #[doc = "Pin select for SCK"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "SPI Slave 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Spis { + ptr: *mut u8, + } + unsafe impl Send for Spis {} + unsafe impl Sync for Spis {} + impl Spis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Acquire SPI semaphore"] + #[inline(always)] + pub const fn tasks_acquire(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + } + #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[inline(always)] + pub const fn tasks_release(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + } + #[doc = "Granted transaction completed"] + #[inline(always)] + pub const fn events_end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + } + #[doc = "End of RXD buffer reached"] + #[inline(always)] + pub const fn events_endrx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + } + #[doc = "Semaphore acquired"] + #[inline(always)] + pub const fn events_acquired(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + } + #[doc = "Shortcuts between local events and tasks"] + #[inline(always)] + pub const fn shorts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0200usize) as _) } + } + #[doc = "Enable interrupt"] + #[inline(always)] + pub const fn intenset(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } } #[doc = "Disable interrupt"] #[inline(always)] @@ -24910,15 +24999,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -24936,43 +25019,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -27004,14 +27050,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -27020,25 +27065,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -27068,14 +27113,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -27086,13 +27218,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -27184,15 +27353,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -27200,43 +27363,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -27653,13 +27779,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -27689,13 +27815,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -27732,10 +27858,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -27744,7 +27870,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -28034,14 +28160,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28050,25 +28175,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -28098,6 +28223,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -28209,15 +28398,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -28241,43 +28424,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -29926,14 +30072,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -29942,35 +30087,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -29997,12 +30132,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -30027,14 +30162,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -30043,31 +30177,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -30083,21 +30391,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -30108,16 +30410,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -30163,15 +30455,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -30458,13 +30744,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -30482,13 +30768,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -30518,25 +30804,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -30564,13 +30850,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -30578,7 +30864,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf52840/pac.rs b/src/chips/nrf52840/pac.rs index 2d969e9..1edab14 100644 --- a/src/chips/nrf52840/pac.rs +++ b/src/chips/nrf52840/pac.rs @@ -15040,13 +15040,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -31798,14 +31804,13 @@ pub mod spi { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Iftiming { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Iftiming {} - unsafe impl Sync for Iftiming {} - impl Iftiming { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -31814,25 +31819,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Sample delay for input serial data on MISO"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxdelay(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Minimum duration between edge of CSN and edge of SCK at the start and the end of a transaction, and minimum duration CSN will stay high between transactions if END-START shortcut is used"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn csndur(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } - #[doc = "Unspecified"] + #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -31841,39 +31846,35 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "Data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "RXD EasyDMA channel"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -31887,19 +31888,87 @@ pub mod spim { pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Iftiming { + ptr: *mut u8, + } + unsafe impl Send for Iftiming {} + unsafe impl Sync for Iftiming {} + impl Iftiming { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Sample delay for input serial data on MISO"] + #[inline(always)] + pub const fn rxdelay(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Minimum duration between edge of CSN and edge of SCK at the start and the end of a transaction, and minimum duration CSN will stay high between transactions if END-START shortcut is used"] + #[inline(always)] + pub const fn csndur(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -31999,15 +32068,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -32042,43 +32105,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -33126,14 +33152,13 @@ pub mod spim { } } pub mod spis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33142,39 +33167,25 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MISO signal"] - #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33204,14 +33215,14 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "SPI Slave 0"] + #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Spis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Spis {} - unsafe impl Sync for Spis {} - impl Spis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33220,40 +33231,118 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Acquire SPI semaphore"] + #[doc = "TXD data pointer"] #[inline(always)] - pub const fn tasks_acquire(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn tasks_release(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Granted transaction completed"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn events_end(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "End of RXD buffer reached"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Semaphore acquired"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] - pub const fn events_acquired(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } } - #[doc = "Shortcuts between local events and tasks"] #[inline(always)] - pub const fn shorts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0200usize) as _) } + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ } - #[doc = "Enable interrupt"] + #[doc = "Pin select for SCK"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "SPI Slave 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Spis { + ptr: *mut u8, + } + unsafe impl Send for Spis {} + unsafe impl Sync for Spis {} + impl Spis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Acquire SPI semaphore"] + #[inline(always)] + pub const fn tasks_acquire(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + } + #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[inline(always)] + pub const fn tasks_release(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + } + #[doc = "Granted transaction completed"] + #[inline(always)] + pub const fn events_end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + } + #[doc = "End of RXD buffer reached"] + #[inline(always)] + pub const fn events_endrx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + } + #[doc = "Semaphore acquired"] + #[inline(always)] + pub const fn events_acquired(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + } + #[doc = "Shortcuts between local events and tasks"] + #[inline(always)] + pub const fn shorts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0200usize) as _) } + } + #[doc = "Enable interrupt"] + #[inline(always)] + pub const fn intenset(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } } #[doc = "Disable interrupt"] #[inline(always)] @@ -33280,15 +33369,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -33306,43 +33389,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -35374,14 +35420,13 @@ pub mod twi { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -35390,25 +35435,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -35438,14 +35483,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -35456,13 +35588,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -35554,15 +35723,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -35570,43 +35733,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -36023,13 +36149,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -36059,13 +36185,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -36102,10 +36228,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -36114,7 +36240,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -36404,14 +36530,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -36420,25 +36545,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -36468,6 +36593,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -36579,15 +36768,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -36611,43 +36794,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -38251,14 +38397,13 @@ pub mod uart { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -38267,35 +38412,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -38322,12 +38457,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -38352,14 +38487,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -38368,31 +38502,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "CTS is activated (set low). Clear To Send."] #[inline(always)] pub const fn events_cts(self) -> crate::common::Reg { @@ -38408,21 +38716,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -38433,16 +38735,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -38488,15 +38780,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -38769,13 +39055,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -38793,13 +39079,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -38829,25 +39115,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -38875,13 +39161,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -38889,7 +39175,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf5340-app/pac.rs b/src/chips/nrf5340-app/pac.rs index d1786f2..5848406 100644 --- a/src/chips/nrf5340-app/pac.rs +++ b/src/chips/nrf5340-app/pac.rs @@ -10842,13 +10842,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Latency selection for Event mode (MODE=Event) with rising or falling edge detection on the pin."] #[inline(always)] @@ -25011,14 +25017,13 @@ pub mod shared { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Iftiming { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Iftiming {} - unsafe impl Sync for Iftiming {} - impl Iftiming { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25027,25 +25032,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Sample delay for input serial data on MISO"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxdelay(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Minimum duration between edge of CSN and edge of SCK. When SHORTS.END_START is used, this is also the minimum duration CSN must stay high between transactions."] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn csndur(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } - #[doc = "Unspecified"] + #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25054,39 +25059,35 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "Data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "RXD EasyDMA channel"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -25100,19 +25101,87 @@ pub mod spim { pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Iftiming { + ptr: *mut u8, + } + unsafe impl Send for Iftiming {} + unsafe impl Sync for Iftiming {} + impl Iftiming { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Sample delay for input serial data on MISO"] + #[inline(always)] + pub const fn rxdelay(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Minimum duration between edge of CSN and edge of SCK. When SHORTS.END_START is used, this is also the minimum duration CSN must stay high between transactions."] + #[inline(always)] + pub const fn csndur(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -25275,15 +25344,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -25318,43 +25381,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -26402,14 +26428,13 @@ pub mod spim { } } pub mod spis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26418,39 +26443,25 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MISO signal"] - #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26480,14 +26491,14 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "SPI Slave 0"] + #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Spis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Spis {} - unsafe impl Sync for Spis {} - impl Spis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -26496,39 +26507,117 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Acquire SPI semaphore"] + #[doc = "TXD data pointer"] #[inline(always)] - pub const fn tasks_acquire(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn tasks_release(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Subscribe configuration for task ACQUIRE"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn subscribe_acquire( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa4usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Subscribe configuration for task RELEASE"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn subscribe_release( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa8usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Granted transaction completed"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] - pub const fn events_end(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } } - #[doc = "End of RXD buffer reached"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "SPI Slave 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Spis { + ptr: *mut u8, + } + unsafe impl Send for Spis {} + unsafe impl Sync for Spis {} + impl Spis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Acquire SPI semaphore"] + #[inline(always)] + pub const fn tasks_acquire(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + } + #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[inline(always)] + pub const fn tasks_release(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + } + #[doc = "Subscribe configuration for task ACQUIRE"] + #[inline(always)] + pub const fn subscribe_acquire( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa4usize) as _) } + } + #[doc = "Subscribe configuration for task RELEASE"] + #[inline(always)] + pub const fn subscribe_release( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa8usize) as _) } + } + #[doc = "Granted transaction completed"] + #[inline(always)] + pub const fn events_end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + } + #[doc = "End of RXD buffer reached"] + #[inline(always)] + pub const fn events_endrx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Semaphore acquired"] #[inline(always)] @@ -26591,15 +26680,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -26617,43 +26700,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -30873,14 +30919,13 @@ pub mod timer { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -30889,25 +30934,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -30937,14 +30982,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -30955,13 +31087,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -31137,59 +31306,16 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } - } - #[doc = "Address used in the TWI transfer"] + #[doc = "Address used in the TWI transfer"] #[inline(always)] pub const fn address(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -31606,13 +31732,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -31642,13 +31768,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task STOP"] @@ -31673,10 +31799,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_stop", &self.lastrx_stop()) .finish() } @@ -31684,7 +31810,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -31978,14 +32104,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -31994,25 +32119,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -32042,6 +32167,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -32230,15 +32419,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -32262,43 +32445,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -33065,14 +33211,13 @@ pub mod twis { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33081,35 +33226,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33136,12 +33271,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33166,14 +33301,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -33182,31 +33316,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "Subscribe configuration for task STARTRX"] #[inline(always)] pub const fn subscribe_startrx( @@ -33257,21 +33565,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -33282,16 +33584,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -33414,15 +33706,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -33709,13 +33995,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -33733,13 +34019,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -33769,25 +34055,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -33815,13 +34101,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -33829,7 +34115,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf5340-net/pac.rs b/src/chips/nrf5340-net/pac.rs index 6a79035..1a95d90 100644 --- a/src/chips/nrf5340-net/pac.rs +++ b/src/chips/nrf5340-net/pac.rs @@ -8088,13 +8088,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Latency selection for Event mode (MODE=Event) with rising or falling edge detection on the pin."] #[inline(always)] @@ -15849,14 +15855,13 @@ pub mod shared { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Iftiming { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Iftiming {} - unsafe impl Sync for Iftiming {} - impl Iftiming { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15865,25 +15870,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Sample delay for input serial data on MISO"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxdelay(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Minimum duration between edge of CSN and edge of SCK. When SHORTS.END_START is used, this is also the minimum duration CSN must stay high between transactions."] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn csndur(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } - #[doc = "Unspecified"] + #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15892,39 +15897,35 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "Data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "RXD EasyDMA channel"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -15938,19 +15939,87 @@ pub mod spim { pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } #[doc = "Number of bytes transferred in the last transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Iftiming { + ptr: *mut u8, + } + unsafe impl Send for Iftiming {} + unsafe impl Sync for Iftiming {} + impl Iftiming { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Sample delay for input serial data on MISO"] + #[inline(always)] + pub const fn rxdelay(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Minimum duration between edge of CSN and edge of SCK. When SHORTS.END_START is used, this is also the minimum duration CSN must stay high between transactions."] + #[inline(always)] + pub const fn csndur(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -16113,15 +16182,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -16156,43 +16219,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -17240,14 +17266,13 @@ pub mod spim { } } pub mod spis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17256,39 +17281,25 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MISO signal"] - #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "Unspecified"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17318,14 +17329,14 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "SPI Slave"] + #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Spis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Spis {} - unsafe impl Sync for Spis {} - impl Spis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17334,51 +17345,129 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Acquire SPI semaphore"] + #[doc = "TXD data pointer"] #[inline(always)] - pub const fn tasks_acquire(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn tasks_release(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Subscribe configuration for task ACQUIRE"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn subscribe_acquire( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa4usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Subscribe configuration for task RELEASE"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn subscribe_release( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa8usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Granted transaction completed"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { #[inline(always)] - pub const fn events_end(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } } - #[doc = "End of RXD buffer reached"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ } - #[doc = "Semaphore acquired"] + #[doc = "Pin select for SCK"] #[inline(always)] - pub const fn events_acquired(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Publish configuration for event END"] + #[doc = "Pin select for MISO signal"] #[inline(always)] - pub const fn publish_end( + pub const fn miso( self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0184usize) as _) } + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "SPI Slave"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Spis { + ptr: *mut u8, + } + unsafe impl Send for Spis {} + unsafe impl Sync for Spis {} + impl Spis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Acquire SPI semaphore"] + #[inline(always)] + pub const fn tasks_acquire(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x24usize) as _) } + } + #[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] + #[inline(always)] + pub const fn tasks_release(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x28usize) as _) } + } + #[doc = "Subscribe configuration for task ACQUIRE"] + #[inline(always)] + pub const fn subscribe_acquire( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa4usize) as _) } + } + #[doc = "Subscribe configuration for task RELEASE"] + #[inline(always)] + pub const fn subscribe_release( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0xa8usize) as _) } + } + #[doc = "Granted transaction completed"] + #[inline(always)] + pub const fn events_end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0104usize) as _) } + } + #[doc = "End of RXD buffer reached"] + #[inline(always)] + pub const fn events_endrx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + } + #[doc = "Semaphore acquired"] + #[inline(always)] + pub const fn events_acquired(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0128usize) as _) } + } + #[doc = "Publish configuration for event END"] + #[inline(always)] + pub const fn publish_end( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0184usize) as _) } } #[doc = "Publish configuration for event ENDRX"] #[inline(always)] @@ -17429,15 +17518,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -17455,43 +17538,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -19000,14 +19046,13 @@ pub mod timer { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19016,25 +19061,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19064,14 +19109,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19082,13 +19214,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -19264,15 +19433,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -19280,43 +19443,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -19733,13 +19859,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -19769,13 +19895,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task STOP"] @@ -19800,10 +19926,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_stop", &self.lastrx_stop()) .finish() } @@ -19811,7 +19937,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -20105,14 +20231,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20121,25 +20246,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -20169,6 +20294,70 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "TXD Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Twis { @@ -20357,15 +20546,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -20389,43 +20572,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -21192,14 +21338,13 @@ pub mod twis { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21208,35 +21353,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21263,12 +21398,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21293,14 +21428,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -21309,31 +21443,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "Subscribe configuration for task STARTRX"] #[inline(always)] pub const fn subscribe_startrx( @@ -21384,21 +21692,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -21409,16 +21711,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -21541,15 +21833,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] - #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -21836,13 +22122,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -21860,13 +22146,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -21896,25 +22182,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -21942,13 +22228,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -21956,7 +22242,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf9120/pac.rs b/src/chips/nrf9120/pac.rs index 3313889..1ce1c50 100644 --- a/src/chips/nrf9120/pac.rs +++ b/src/chips/nrf9120/pac.rs @@ -4417,13 +4417,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -11671,14 +11677,13 @@ pub mod shared { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -11687,34 +11692,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -11744,6 +11740,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -11898,15 +11967,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -11919,43 +11982,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -12761,14 +12787,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -12777,39 +12829,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -12818,24 +12866,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -12950,15 +13039,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -12976,43 +13059,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -16855,14 +16901,13 @@ pub mod timer { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16871,25 +16916,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16919,14 +16964,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16937,13 +17069,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -17119,15 +17288,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -17135,43 +17298,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -17588,13 +17714,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -17624,13 +17750,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task STOP"] @@ -17655,10 +17781,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_stop", &self.lastrx_stop()) .finish() } @@ -17666,7 +17792,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -17948,14 +18074,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17964,25 +18089,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18012,14 +18137,14 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twis {} - unsafe impl Sync for Twis {} - impl Twis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18028,27 +18153,91 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Stop TWI transaction"] + #[doc = "TXD Data pointer"] #[inline(always)] - pub const fn tasks_stop(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Suspend TWI transaction"] + #[doc = "Maximum number of bytes in TXD buffer"] #[inline(always)] - pub const fn tasks_suspend(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Resume TWI transaction"] + #[doc = "Number of bytes transferred in the last TXD transaction"] #[inline(always)] - pub const fn tasks_resume(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Prepare the TWI slave to respond to a write command"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn tasks_preparerx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Prepare the TWI slave to respond to a read command"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twis { + ptr: *mut u8, + } + unsafe impl Send for Twis {} + unsafe impl Sync for Twis {} + impl Twis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Stop TWI transaction"] + #[inline(always)] + pub const fn tasks_stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + } + #[doc = "Suspend TWI transaction"] + #[inline(always)] + pub const fn tasks_suspend(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + } + #[doc = "Resume TWI transaction"] + #[inline(always)] + pub const fn tasks_resume(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a write command"] + #[inline(always)] + pub const fn tasks_preparerx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a read command"] #[inline(always)] pub const fn tasks_preparetx(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x34usize) as _) } @@ -18200,15 +18389,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -18232,43 +18415,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -19035,14 +19181,13 @@ pub mod twis { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19051,35 +19196,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19106,12 +19241,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19136,14 +19271,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -19152,31 +19286,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "Subscribe configuration for task STARTRX"] #[inline(always)] pub const fn subscribe_startrx( @@ -19227,21 +19535,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -19252,16 +19554,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -19384,15 +19676,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -19665,13 +19951,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -19689,13 +19975,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -19725,25 +20011,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -19771,13 +20057,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -19785,7 +20071,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/src/chips/nrf9160/pac.rs b/src/chips/nrf9160/pac.rs index 772f443..7a33a7f 100644 --- a/src/chips/nrf9160/pac.rs +++ b/src/chips/nrf9160/pac.rs @@ -4070,13 +4070,19 @@ pub mod gpiote { } #[doc = "Enable interrupt"] #[inline(always)] - pub const fn intenset(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize) as _) } + pub const fn intenset(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0304usize + n * 0usize) as _) + } } #[doc = "Disable interrupt"] #[inline(always)] - pub const fn intenclr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize) as _) } + pub const fn intenclr(self, n: usize) -> crate::common::Reg { + assert!(n < 1usize); + unsafe { + crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0308usize + n * 0usize) as _) + } } #[doc = "Description collection: Configuration for OUT\\[n\\], SET\\[n\\], and CLR\\[n\\] tasks and IN\\[n\\] event"] #[inline(always)] @@ -11300,14 +11306,13 @@ pub mod shared { } } pub mod spim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -11316,34 +11321,25 @@ pub mod spim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] - #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for MOSI signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -11373,6 +11369,79 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } + #[doc = "TXD EasyDMA channel"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct DmaTx { + ptr: *mut u8, + } + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } #[doc = "Serial Peripheral Interface Master with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] pub struct Spim { @@ -11527,15 +11596,9 @@ pub mod spim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -11548,43 +11611,6 @@ pub mod spim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -12390,14 +12416,40 @@ pub mod spim { } } pub mod spis { + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Dma { + ptr: *mut u8, + } + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Unspecified"] + #[inline(always)] + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -12406,39 +12458,35 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCK"] + #[doc = "RXD data pointer"] #[inline(always)] - pub const fn sck(self) -> crate::common::Reg { + pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for MISO signal"] + #[doc = "Maximum number of bytes in receive buffer"] #[inline(always)] - pub const fn miso( - self, - ) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Pin select for MOSI signal"] + #[doc = "Number of bytes received in last granted transaction"] #[inline(always)] - pub const fn mosi( - self, - ) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Pin select for CSN signal"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn csn(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -12447,24 +12495,65 @@ pub mod spis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "RXD data pointer"] + #[doc = "TXD data pointer"] #[inline(always)] pub const fn ptr(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Maximum number of bytes in receive buffer"] + #[doc = "Maximum number of bytes in transmit buffer"] #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { + pub const fn maxcnt(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Number of bytes received in last granted transaction"] + #[doc = "Number of bytes transmitted in last granted transaction"] #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { + pub const fn amount(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn list(self) -> crate::common::Reg { + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCK"] + #[inline(always)] + pub const fn sck(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for MISO signal"] + #[inline(always)] + pub const fn miso( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Pin select for MOSI signal"] + #[inline(always)] + pub const fn mosi( + self, + ) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "Pin select for CSN signal"] + #[inline(always)] + pub const fn csn(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } @@ -12579,15 +12668,9 @@ pub mod spis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "Unspecified"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "Unspecified"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration register"] #[inline(always)] @@ -12605,43 +12688,6 @@ pub mod spis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "Unspecified"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transmitted in last granted transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Configuration register"] #[repr(transparent)] @@ -16484,14 +16530,13 @@ pub mod timer { } } pub mod twim { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16500,25 +16545,25 @@ pub mod twim { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16548,14 +16593,101 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twim { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twim {} - unsafe impl Sync for Twim {} - impl Twim { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Data pointer"] + #[inline(always)] + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + #[doc = "Number of bytes transferred in the last transaction"] + #[inline(always)] + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + #[doc = "EasyDMA list type"] + #[inline(always)] + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -16566,13 +16698,50 @@ pub mod twim { } #[doc = "Start TWI receive sequence"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn start(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } #[doc = "Start TWI transmit sequence"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twim { + ptr: *mut u8, + } + unsafe impl Send for Twim {} + unsafe impl Sync for Twim {} + impl Twim { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } #[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] #[inline(always)] @@ -16748,15 +16917,9 @@ pub mod twim { pub const fn frequency(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Address used in the TWI transfer"] #[inline(always)] @@ -16764,43 +16927,6 @@ pub mod twim { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0588usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in transmit buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Address used in the TWI transfer"] #[repr(transparent)] @@ -17217,13 +17343,13 @@ pub mod twim { #[doc = "Shortcut between event LASTTX and task STARTRX"] #[must_use] #[inline(always)] - pub const fn lasttx_startrx(&self) -> bool { + pub const fn lasttx_dma_rx_start(&self) -> bool { let val = (self.0 >> 7usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTTX and task STARTRX"] #[inline(always)] - pub const fn set_lasttx_startrx(&mut self, val: bool) { + pub const fn set_lasttx_dma_rx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); } #[doc = "Shortcut between event LASTTX and task SUSPEND"] @@ -17253,13 +17379,13 @@ pub mod twim { #[doc = "Shortcut between event LASTRX and task STARTTX"] #[must_use] #[inline(always)] - pub const fn lastrx_starttx(&self) -> bool { + pub const fn lastrx_dma_tx_start(&self) -> bool { let val = (self.0 >> 10usize) & 0x01; val != 0 } #[doc = "Shortcut between event LASTRX and task STARTTX"] #[inline(always)] - pub const fn set_lastrx_starttx(&mut self, val: bool) { + pub const fn set_lastrx_dma_tx_start(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); } #[doc = "Shortcut between event LASTRX and task SUSPEND"] @@ -17296,10 +17422,10 @@ pub mod twim { impl core::fmt::Debug for Shorts { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Shorts") - .field("lasttx_startrx", &self.lasttx_startrx()) + .field("lasttx_dma_rx_start", &self.lasttx_dma_rx_start()) .field("lasttx_suspend", &self.lasttx_suspend()) .field("lasttx_stop", &self.lasttx_stop()) - .field("lastrx_starttx", &self.lastrx_starttx()) + .field("lastrx_dma_tx_start", &self.lastrx_dma_tx_start()) .field("lastrx_suspend", &self.lastrx_suspend()) .field("lastrx_stop", &self.lastrx_stop()) .finish() @@ -17308,7 +17434,7 @@ pub mod twim { #[cfg(feature = "defmt")] impl defmt::Format for Shorts { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Shorts {{ lasttx_startrx: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_starttx: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_startrx () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_starttx () , self . lastrx_suspend () , self . lastrx_stop ()) + defmt :: write ! (f , "Shorts {{ lasttx_dma_rx_start: {=bool:?}, lasttx_suspend: {=bool:?}, lasttx_stop: {=bool:?}, lastrx_dma_tx_start: {=bool:?}, lastrx_suspend: {=bool:?}, lastrx_stop: {=bool:?} }}" , self . lasttx_dma_rx_start () , self . lasttx_suspend () , self . lasttx_stop () , self . lastrx_dma_tx_start () , self . lastrx_suspend () , self . lastrx_stop ()) } } #[doc = "Number of bytes transferred in the last transaction"] @@ -17590,14 +17716,13 @@ pub mod twim { } } pub mod twis { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17606,25 +17731,25 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for SCL signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn scl(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for SDA signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn sda(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17654,14 +17779,14 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } } - #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Twis { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Twis {} - unsafe impl Sync for Twis {} - impl Twis { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -17670,27 +17795,91 @@ pub mod twis { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Stop TWI transaction"] + #[doc = "TXD Data pointer"] #[inline(always)] - pub const fn tasks_stop(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + pub const fn ptr(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Suspend TWI transaction"] + #[doc = "Maximum number of bytes in TXD buffer"] #[inline(always)] - pub const fn tasks_suspend(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + pub const fn maxcnt(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Resume TWI transaction"] + #[doc = "Number of bytes transferred in the last TXD transaction"] #[inline(always)] - pub const fn tasks_resume(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + pub const fn amount(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Prepare the TWI slave to respond to a write command"] + #[doc = "EasyDMA list type"] #[inline(always)] - pub const fn tasks_preparerx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + pub const fn list(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } - #[doc = "Prepare the TWI slave to respond to a read command"] + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for SCL signal"] + #[inline(always)] + pub const fn scl(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for SDA signal"] + #[inline(always)] + pub const fn sda(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Twis { + ptr: *mut u8, + } + unsafe impl Send for Twis {} + unsafe impl Sync for Twis {} + impl Twis { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Stop TWI transaction"] + #[inline(always)] + pub const fn tasks_stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x14usize) as _) } + } + #[doc = "Suspend TWI transaction"] + #[inline(always)] + pub const fn tasks_suspend(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x1cusize) as _) } + } + #[doc = "Resume TWI transaction"] + #[inline(always)] + pub const fn tasks_resume(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x20usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a write command"] + #[inline(always)] + pub const fn tasks_preparerx(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + #[doc = "Prepare the TWI slave to respond to a read command"] #[inline(always)] pub const fn tasks_preparetx(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x34usize) as _) } @@ -17842,15 +18031,9 @@ pub mod twis { pub const fn psel(self) -> Psel { unsafe { Psel::from_ptr(self.ptr.wrapping_add(0x0508usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Description collection: TWI slave address n"] #[inline(always)] @@ -17874,43 +18057,6 @@ pub mod twis { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x05c0usize) as _) } } } - #[doc = "TXD EasyDMA channel"] - #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { - ptr: *mut u8, - } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { - #[inline(always)] - pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { - Self { ptr: ptr as _ } - } - #[inline(always)] - pub const fn as_ptr(&self) -> *mut () { - self.ptr as _ - } - #[doc = "TXD Data pointer"] - #[inline(always)] - pub const fn ptr(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Maximum number of bytes in TXD buffer"] - #[inline(always)] - pub const fn maxcnt(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Number of bytes transferred in the last TXD transaction"] - #[inline(always)] - pub const fn amount(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } - } - #[doc = "EasyDMA list type"] - #[inline(always)] - pub const fn list(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } - } - } pub mod regs { #[doc = "Description collection: TWI slave address n"] #[repr(transparent)] @@ -18677,14 +18823,13 @@ pub mod twis { } } pub mod uarte { - #[doc = "Unspecified"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Psel { + pub struct Dma { ptr: *mut u8, } - unsafe impl Send for Psel {} - unsafe impl Sync for Psel {} - impl Psel { + unsafe impl Send for Dma {} + unsafe impl Sync for Dma {} + impl Dma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18693,35 +18838,25 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Pin select for RTS signal"] - #[inline(always)] - pub const fn rts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } - } - #[doc = "Pin select for TXD signal"] - #[inline(always)] - pub const fn txd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } - } - #[doc = "Pin select for CTS signal"] + #[doc = "RXD EasyDMA channel"] #[inline(always)] - pub const fn cts(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + pub const fn rx(self) -> DmaRx { + unsafe { DmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Pin select for RXD signal"] + #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn rxd(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } + pub const fn tx(self) -> DmaTx { + unsafe { DmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } } } #[doc = "RXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Rxd { + pub struct DmaRx { ptr: *mut u8, } - unsafe impl Send for Rxd {} - unsafe impl Sync for Rxd {} - impl Rxd { + unsafe impl Send for DmaRx {} + unsafe impl Sync for DmaRx {} + impl DmaRx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18748,12 +18883,12 @@ pub mod uarte { } #[doc = "TXD EasyDMA channel"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Txd { + pub struct DmaTx { ptr: *mut u8, } - unsafe impl Send for Txd {} - unsafe impl Sync for Txd {} - impl Txd { + unsafe impl Send for DmaTx {} + unsafe impl Sync for DmaTx {} + impl DmaTx { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18778,14 +18913,13 @@ pub mod uarte { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } } - #[doc = "UART with EasyDMA 0"] #[derive(Copy, Clone, Eq, PartialEq)] - pub struct Uarte { + pub struct EventsDma { ptr: *mut u8, } - unsafe impl Send for Uarte {} - unsafe impl Sync for Uarte {} - impl Uarte { + unsafe impl Send for EventsDma {} + unsafe impl Sync for EventsDma {} + impl EventsDma { #[inline(always)] pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { Self { ptr: ptr as _ } @@ -18794,31 +18928,205 @@ pub mod uarte { pub const fn as_ptr(&self) -> *mut () { self.ptr as _ } - #[doc = "Start UART receiver"] #[inline(always)] - pub const fn tasks_startrx(self) -> crate::common::Reg { + pub const fn rx(self) -> EventsDmaRx { + unsafe { EventsDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> EventsDmaTx { + unsafe { EventsDmaTx::from_ptr(self.ptr.wrapping_add(0x10usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaRx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaRx {} + unsafe impl Sync for EventsDmaRx {} + impl EventsDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Receive buffer is filled up"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } } - #[doc = "Stop UART receiver"] + #[doc = "UART receiver has started"] #[inline(always)] - pub const fn tasks_stoprx(self) -> crate::common::Reg { + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x3cusize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct EventsDmaTx { + ptr: *mut u8, + } + unsafe impl Send for EventsDmaTx {} + unsafe impl Sync for EventsDmaTx {} + impl EventsDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Last TX byte transmitted"] + #[inline(always)] + pub const fn end(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "UART transmitter has started"] + #[inline(always)] + pub const fn ready(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x30usize) as _) } + } + } + #[doc = "Unspecified"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Psel { + ptr: *mut u8, + } + unsafe impl Send for Psel {} + unsafe impl Sync for Psel {} + impl Psel { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Pin select for RTS signal"] + #[inline(always)] + pub const fn rts(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Pin select for TXD signal"] + #[inline(always)] + pub const fn txd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } } - #[doc = "Start UART transmitter"] + #[doc = "Pin select for CTS signal"] #[inline(always)] - pub const fn tasks_starttx(self) -> crate::common::Reg { + pub const fn cts(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } } - #[doc = "Stop UART transmitter"] + #[doc = "Pin select for RXD signal"] #[inline(always)] - pub const fn tasks_stoptx(self) -> crate::common::Reg { + pub const fn rxd(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDma { + ptr: *mut u8, + } + unsafe impl Send for TasksDma {} + unsafe impl Sync for TasksDma {} + impl TasksDma { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn rx(self) -> TasksDmaRx { + unsafe { TasksDmaRx::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[inline(always)] + pub const fn tx(self) -> TasksDmaTx { + unsafe { TasksDmaTx::from_ptr(self.ptr.wrapping_add(0x08usize) as _) } + } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaRx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaRx {} + unsafe impl Sync for TasksDmaRx {} + impl TasksDmaRx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART receiver"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART receiver"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } #[doc = "Flush RX FIFO into RX buffer"] #[inline(always)] - pub const fn tasks_flushrx(self) -> crate::common::Reg { + pub const fn flush(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x2cusize) as _) } } + } + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct TasksDmaTx { + ptr: *mut u8, + } + unsafe impl Send for TasksDmaTx {} + unsafe impl Sync for TasksDmaTx {} + impl TasksDmaTx { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[doc = "Start UART transmitter"] + #[inline(always)] + pub const fn start(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } + #[doc = "Stop UART transmitter"] + #[inline(always)] + pub const fn stop(self) -> crate::common::Reg { + unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x04usize) as _) } + } + } + #[doc = "UART with EasyDMA 0"] + #[derive(Copy, Clone, Eq, PartialEq)] + pub struct Uarte { + ptr: *mut u8, + } + unsafe impl Send for Uarte {} + unsafe impl Sync for Uarte {} + impl Uarte { + #[inline(always)] + pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { + Self { ptr: ptr as _ } + } + #[inline(always)] + pub const fn as_ptr(&self) -> *mut () { + self.ptr as _ + } + #[inline(always)] + pub const fn tasks_dma(self) -> TasksDma { + unsafe { TasksDma::from_ptr(self.ptr.wrapping_add(0x0usize) as _) } + } #[doc = "Subscribe configuration for task STARTRX"] #[inline(always)] pub const fn subscribe_startrx( @@ -18869,21 +19177,15 @@ pub mod uarte { pub const fn events_rxdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0108usize) as _) } } - #[doc = "Receive buffer is filled up"] #[inline(always)] - pub const fn events_endrx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } + pub const fn events_dma(self) -> EventsDma { + unsafe { EventsDma::from_ptr(self.ptr.wrapping_add(0x0110usize) as _) } } #[doc = "Data sent from TXD"] #[inline(always)] pub const fn events_txdrdy(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x011cusize) as _) } } - #[doc = "Last TX byte transmitted"] - #[inline(always)] - pub const fn events_endtx(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0120usize) as _) } - } #[doc = "Error detected"] #[inline(always)] pub const fn events_error(self) -> crate::common::Reg { @@ -18894,16 +19196,6 @@ pub mod uarte { pub const fn events_rxto(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0144usize) as _) } } - #[doc = "UART receiver has started"] - #[inline(always)] - pub const fn events_rxstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x014cusize) as _) } - } - #[doc = "UART transmitter has started"] - #[inline(always)] - pub const fn events_txstarted(self) -> crate::common::Reg { - unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0150usize) as _) } - } #[doc = "Transmitter stopped"] #[inline(always)] pub const fn events_txstopped(self) -> crate::common::Reg { @@ -19026,15 +19318,9 @@ pub mod uarte { pub const fn baudrate(self) -> crate::common::Reg { unsafe { crate::common::Reg::from_ptr(self.ptr.wrapping_add(0x0524usize) as _) } } - #[doc = "RXD EasyDMA channel"] - #[inline(always)] - pub const fn rxd(self) -> Rxd { - unsafe { Rxd::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } - } - #[doc = "TXD EasyDMA channel"] #[inline(always)] - pub const fn txd(self) -> Txd { - unsafe { Txd::from_ptr(self.ptr.wrapping_add(0x0544usize) as _) } + pub const fn dma(self) -> Dma { + unsafe { Dma::from_ptr(self.ptr.wrapping_add(0x0534usize) as _) } } #[doc = "Configuration of parity and hardware flow control"] #[inline(always)] @@ -19307,13 +19593,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDRX"] #[must_use] #[inline(always)] - pub const fn endrx(&self) -> bool { + pub const fn dmarxend(&self) -> bool { let val = (self.0 >> 4usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDRX"] #[inline(always)] - pub const fn set_endrx(&mut self, val: bool) { + pub const fn set_dmarxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); } #[doc = "Enable or disable interrupt for event TXDRDY"] @@ -19331,13 +19617,13 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event ENDTX"] #[must_use] #[inline(always)] - pub const fn endtx(&self) -> bool { + pub const fn dmatxend(&self) -> bool { let val = (self.0 >> 8usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event ENDTX"] #[inline(always)] - pub const fn set_endtx(&mut self, val: bool) { + pub const fn set_dmatxend(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); } #[doc = "Enable or disable interrupt for event ERROR"] @@ -19367,25 +19653,25 @@ pub mod uarte { #[doc = "Enable or disable interrupt for event RXSTARTED"] #[must_use] #[inline(always)] - pub const fn rxstarted(&self) -> bool { + pub const fn dmarxready(&self) -> bool { let val = (self.0 >> 19usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event RXSTARTED"] #[inline(always)] - pub const fn set_rxstarted(&mut self, val: bool) { + pub const fn set_dmarxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[must_use] #[inline(always)] - pub const fn txstarted(&self) -> bool { + pub const fn dmatxready(&self) -> bool { let val = (self.0 >> 20usize) & 0x01; val != 0 } #[doc = "Enable or disable interrupt for event TXSTARTED"] #[inline(always)] - pub const fn set_txstarted(&mut self, val: bool) { + pub const fn set_dmatxready(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); } #[doc = "Enable or disable interrupt for event TXSTOPPED"] @@ -19413,13 +19699,13 @@ pub mod uarte { .field("cts", &self.cts()) .field("ncts", &self.ncts()) .field("rxdrdy", &self.rxdrdy()) - .field("endrx", &self.endrx()) + .field("dmarxend", &self.dmarxend()) .field("txdrdy", &self.txdrdy()) - .field("endtx", &self.endtx()) + .field("dmatxend", &self.dmatxend()) .field("error", &self.error()) .field("rxto", &self.rxto()) - .field("rxstarted", &self.rxstarted()) - .field("txstarted", &self.txstarted()) + .field("dmarxready", &self.dmarxready()) + .field("dmatxready", &self.dmatxready()) .field("txstopped", &self.txstopped()) .finish() } @@ -19427,7 +19713,7 @@ pub mod uarte { #[cfg(feature = "defmt")] impl defmt::Format for Int { fn format(&self, f: defmt::Formatter) { - defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, endrx: {=bool:?}, txdrdy: {=bool:?}, endtx: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, rxstarted: {=bool:?}, txstarted: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . endrx () , self . txdrdy () , self . endtx () , self . error () , self . rxto () , self . rxstarted () , self . txstarted () , self . txstopped ()) + defmt :: write ! (f , "Int {{ cts: {=bool:?}, ncts: {=bool:?}, rxdrdy: {=bool:?}, dmarxend: {=bool:?}, txdrdy: {=bool:?}, dmatxend: {=bool:?}, error: {=bool:?}, rxto: {=bool:?}, dmarxready: {=bool:?}, dmatxready: {=bool:?}, txstopped: {=bool:?} }}" , self . cts () , self . ncts () , self . rxdrdy () , self . dmarxend () , self . txdrdy () , self . dmatxend () , self . error () , self . rxto () , self . dmarxready () , self . dmatxready () , self . txstopped ()) } } #[doc = "Number of bytes transferred in the last transaction"] diff --git a/transform-extra.yaml b/transform-extra.yaml new file mode 100644 index 0000000..1feb6cc --- /dev/null +++ b/transform-extra.yaml @@ -0,0 +1,275 @@ +# ======= Aligning nrf52/nrf53 with nrf54 + - !RenameFields + fieldset: .*::regs::Shorts.* + from: lastrx_starttx + to: lastrx_dma_tx_start + - !RenameFields + fieldset: .*::regs::Shorts.* + from: lasttx_startrx + to: lasttx_dma_rx_start +# ======= Aligning nrf52/nrf53 with nrf54 spim + - !MakeBlock + blocks: spim::Spim + from: (txd|rxd) + to_outer: dma + to_inner: $1$2 + to_block: spim::Dma + - !RenameRegisters + block: spim::Dma + from: rxd + to: rx + - !RenameRegisters + block: spim::Dma + from: txd + to: tx + - !Rename + from: spim::Txd + to: spim::DmaTx + - !Rename + from: spim::Rxd + to: spim::DmaRx + - !MakeBlock + blocks: spim::Spim + from: tasks_(.+)(tx|rx) + to_outer: tasks_dma + to_inner: $1$2 + to_block: spim::TasksDma + - !MakeBlock + blocks: spim::TasksDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: spim::TasksDmaTx + - !MakeBlock + blocks: spim::TasksDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: spim::TasksDmaRx +# ======= Aligning nrf52/nrf53 with nrf54 spis + - !MakeBlock + blocks: spis::Spis + from: (txd|rxd) + to_outer: dma + to_inner: $1$2 + to_block: spis::Dma + - !RenameRegisters + block: spis::Dma + from: rxd + to: rx + - !RenameRegisters + block: spis::Dma + from: txd + to: tx + - !Rename + from: spis::Txd + to: spis::DmaTx + - !Rename + from: spis::Rxd + to: spis::DmaRx + - !MakeBlock + blocks: spis::Spis + from: tasks_(.+)(tx|rx) + to_outer: tasks_dma + to_inner: $1$2 + to_block: spis::TasksDma + - !MakeBlock + blocks: spis::TasksDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: spis::TasksDmaTx + - !MakeBlock + blocks: spis::TasksDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: spis::TasksDmaRx +# ======= Aligning nrf52/nrf53 with nrf54 twim + - !MakeBlock + blocks: twim::Twim + from: (txd|rxd) + to_outer: dma + to_inner: $1$2 + to_block: twim::Dma + - !RenameRegisters + block: twim::Dma + from: rxd + to: rx + - !RenameRegisters + block: twim::Dma + from: txd + to: tx + - !Rename + from: twim::Txd + to: twim::DmaTx + - !Rename + from: twim::Rxd + to: twim::DmaRx + - !MakeBlock + blocks: twim::Twim + from: tasks_(.+)(tx|rx) + to_outer: tasks_dma + to_inner: $1$2 + to_block: twim::TasksDma + - !MakeBlock + blocks: twim::TasksDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: twim::TasksDmaTx + - !MakeBlock + blocks: twim::TasksDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: twim::TasksDmaRx +# ======= Aligning nrf52/nrf53 with nrf54 twis + - !MakeBlock + blocks: twis::Twis + from: (txd|rxd) + to_outer: dma + to_inner: $1$2 + to_block: twis::Dma + - !RenameRegisters + block: twis::Dma + from: rxd + to: rx + - !RenameRegisters + block: twis::Dma + from: txd + to: tx + - !Rename + from: twis::Txd + to: twis::DmaTx + - !Rename + from: twis::Rxd + to: twis::DmaRx + - !MakeBlock + blocks: twis::Twis + from: tasks_(enablematch|disablematch) + to_outer: tasks_dma + to_inner: $1$2 + to_block: twis::TasksDma + - !MakeBlock + blocks: twis::TasksDma + from: (.+) + to_outer: rx + to_inner: $1 + to_block: twis::TasksDmaRx + - !MakeBlock + blocks: twis::Twis + from: events_(.+)(tx|rx) + to_outer: events_dma + to_inner: $1$2 + to_block: twis::EventsDma + - !MakeBlock + blocks: twis::EventsDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: twis::EventsDmaTx + - !MakeBlock + blocks: twis::EventsDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: twis::EventsDmaRx +# ======= Aligning nrf52/nrf53 with nrf54 uarte + - !MakeBlock + blocks: uarte::Uarte + from: (txd|rxd) + to_outer: dma + to_inner: $1$2 + to_block: uarte::Dma + - !RenameRegisters + block: uarte::Dma + from: rxd + to: rx + - !RenameRegisters + block: uarte::Dma + from: txd + to: tx + - !Rename + from: uarte::Txd + to: uarte::DmaTx + - !Rename + from: uarte::Rxd + to: uarte::DmaRx + - !MakeBlock + blocks: uarte::Uarte + from: tasks_(.+)(tx|rx) + to_outer: tasks_dma + to_inner: $1$2 + to_block: uarte::TasksDma + - !MakeBlock + blocks: uarte::TasksDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: uarte::TasksDmaTx + - !MakeBlock + blocks: uarte::TasksDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: uarte::TasksDmaRx + - !RenameRegisters + block: uarte::Uarte + from: events_txstarted + to: events_readytx + - !RenameRegisters + block: uarte::Uarte + from: events_rxstarted + to: events_readyrx + - !RenameFields + fieldset: uarte::regs::Int + from: endrx + to: dmarxend + - !RenameFields + fieldset: uarte::regs::Int + from: rxstarted + to: dmarxready + - !RenameFields + fieldset: uarte::regs::Int + from: txstarted + to: dmatxready + - !RenameFields + fieldset: uarte::regs::Int + from: endtx + to: dmatxend + - !RenameFields + fieldset: uarte::regs::Int + from: set_endrx + to: set_dmarxend + - !RenameFields + fieldset: uarte::regs::Int + from: set_endtx + to: set_dmatxend + - !MakeBlock + blocks: uarte::Uarte + from: events_(.+)(tx|rx) + to_outer: events_dma + to_inner: $1$2 + to_block: uarte::EventsDma + - !MakeBlock + blocks: uarte::EventsDma + from: (.+)tx + to_outer: tx + to_inner: $1 + to_block: uarte::EventsDmaTx + - !MakeBlock + blocks: uarte::EventsDma + from: (.+)rx + to_outer: rx + to_inner: $1 + to_block: uarte::EventsDmaRx +# ======= Aligning nrf52/nrf53 with nrf54 twim + - !MakeRegisterArray + blocks: gpiote::Gpiote + from: inten(.+) + to: inten$1 + - !MakeRegisterArray + blocks: gpiote::Gpiote + from: events_port + to: events_port diff --git a/transform.yaml b/transform.yaml index a3111a6..471304f 100644 --- a/transform.yaml +++ b/transform.yaml @@ -315,6 +315,103 @@ transforms: from: (oneshot|enable)\d+ to: $1 +# ======= Make DMA clusters for SPIM/SPIS (nRF52/53 only, nRF54 already has them) +# - !MakeCluster +# block: +# include: spi[ms]::.* +# clusters: +# - name: events_dma +# subclusters: +# - name: rx +# registers: +# - name: end +# from: events_endrx +# - name: tx +# registers: +# - name: end +# from: events_endtx +# +## ======= Make DMA clusters for UARTE +# - !MakeCluster +# block: +# include: uarte::.* +# clusters: +# - name: events_dma +# subclusters: +# - name: rx +# registers: +# - name: end +# from: events_endrx +# - name: ready +# from: events_rxstarted +# - name: tx +# registers: +# - name: end +# from: events_endtx +# - name: ready +# from: events_txstarted +# - name: tasks_dma +# subclusters: +# - name: rx +# registers: +# - name: start +# from: tasks_startrx +# - name: stop +# from: tasks_stoprx +# - name: tx +# registers: +# - name: start +# from: tasks_starttx +# - name: stop +# from: tasks_stoptx +# +## ======= Make DMA clusters for TWIM +# +# - !MakeCluster +# block: +# include: twim::.* +# clusters: +# - name: events_dma +# subclusters: +# - name: rx +# registers: +# - name: error +# from: events_error +# - name: stopped +# from: events_stopped +# - name: suspended +# from: events_suspended +# - name: tasks_dma +# subclusters: +# - name: rx +# registers: +# - name: start +# from: tasks_startrx +# - name: tx +# registers: +# - name: start +# from: tasks_starttx +# +## ======= Make DMA clusters for TWIS +# - !MakeCluster +# block: +# include: twis::.* +# clusters: +# - name: events_dma +# subclusters: +# - name: rx +# registers: +# - name: write +# from: events_write +# - name: error +# from: events_error +# - name: stopped +# from: events_stopped +# - name: tx +# registers: +# - name: read +# from: events_read + # ======= SPIS - !DeleteEnums from: spis::vals::(Overflow|Overread) @@ -463,4 +560,3 @@ transforms: fieldsets: pwm::regs::Int from: comparematch\d+ to: comparematch - diff --git a/update.sh b/update.sh index ac0263f..16ba466 100755 --- a/update.sh +++ b/update.sh @@ -3,7 +3,12 @@ set -euxo pipefail -if ! command -v chiptool &> /dev/null; then +# Use local chiptool if available, otherwise use system one +if [ -x ../chiptool/target/release/chiptool ]; then + CHIPTOOL=../chiptool/target/release/chiptool +elif command -v chiptool &> /dev/null; then + CHIPTOOL=chiptool +else echo "chiptool could not be found. Install it with the following command:" echo "" echo " cargo install --git https://github.com/embassy-rs/chiptool --locked" @@ -14,11 +19,22 @@ fi rm -rf src/chips export RUST_BACKTRACE=1 -#export RUST_LOG=info +export RUST_LOG=info -for chip in $(ls svd); do +cat transform.yaml > transform-compat.yaml +cat transform-extra.yaml >> transform-compat.yaml + +#for chip in nrf52840.svd; do +#for chip in nrf52840.svd nrf54l15-app.svd; do +for chip in $(ls svd); do chip=${chip%.*} - chiptool generate --svd svd/$chip.svd --transform transform.yaml + + if [[ "$chip" == *nrf54* ]]; then + $CHIPTOOL generate --svd svd/$chip.svd --transform transform.yaml + else + $CHIPTOOL generate --svd svd/$chip.svd --transform transform-compat.yaml + fi + rustfmt lib.rs sed -i '/#!\[no_std]/d' lib.rs