#[doc = "General Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ctrl(pub u32);
impl Ctrl {
#[doc = "ID Transition Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn idte(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "ID Transition Interrupt Enable"]
#[inline(always)]
pub const fn set_idte(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "VBus Transition Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn vbuste(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "VBus Transition Interrupt Enable"]
#[inline(always)]
pub const fn set_vbuste(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "SRP Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn srpe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "SRP Interrupt Enable"]
#[inline(always)]
pub const fn set_srpe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "VBus Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn vberre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "VBus Error Interrupt Enable"]
#[inline(always)]
pub const fn set_vberre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "B-Connection Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn bcerre(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "B-Connection Error Interrupt Enable"]
#[inline(always)]
pub const fn set_bcerre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Role Exchange Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn roleexe(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Role Exchange Interrupt Enable"]
#[inline(always)]
pub const fn set_roleexe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "HNP Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hnperre(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "HNP Error Interrupt Enable"]
#[inline(always)]
pub const fn set_hnperre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Suspend Time-Out Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn stoe(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Suspend Time-Out Interrupt Enable"]
#[inline(always)]
pub const fn set_stoe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "VBus Hardware Control"]
#[must_use]
#[inline(always)]
pub const fn vbushwc(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "VBus Hardware Control"]
#[inline(always)]
pub const fn set_vbushwc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "SRP Selection"]
#[must_use]
#[inline(always)]
pub const fn srpsel(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "SRP Selection"]
#[inline(always)]
pub const fn set_srpsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "SRP Request"]
#[must_use]
#[inline(always)]
pub const fn srpreq(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "SRP Request"]
#[inline(always)]
pub const fn set_srpreq(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "HNP Request"]
#[must_use]
#[inline(always)]
pub const fn hnpreq(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "HNP Request"]
#[inline(always)]
pub const fn set_hnpreq(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "OTG Pad Enable"]
#[must_use]
#[inline(always)]
pub const fn otgpade(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "OTG Pad Enable"]
#[inline(always)]
pub const fn set_otgpade(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "VBus Polarity Off"]
#[must_use]
#[inline(always)]
pub const fn vbuspo(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "VBus Polarity Off"]
#[inline(always)]
pub const fn set_vbuspo(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Freeze USB Clock"]
#[must_use]
#[inline(always)]
pub const fn frzclk(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Freeze USB Clock"]
#[inline(always)]
pub const fn set_frzclk(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "UOTGHS Enable"]
#[must_use]
#[inline(always)]
pub const fn usbe(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "UOTGHS Enable"]
#[inline(always)]
pub const fn set_usbe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Timer Value"]
#[must_use]
#[inline(always)]
pub const fn timvalue(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x03;
val as u8
}
#[doc = "Timer Value"]
#[inline(always)]
pub const fn set_timvalue(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 16usize)) | (((val as u32) & 0x03) << 16usize);
}
#[doc = "Timer Page"]
#[must_use]
#[inline(always)]
pub const fn timpage(&self) -> u8 {
let val = (self.0 >> 20usize) & 0x03;
val as u8
}
#[doc = "Timer Page"]
#[inline(always)]
pub const fn set_timpage(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize);
}
#[doc = "Timer Access Unlock"]
#[must_use]
#[inline(always)]
pub const fn unlock(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Timer Access Unlock"]
#[inline(always)]
pub const fn set_unlock(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "UOTGID Pin Enable"]
#[must_use]
#[inline(always)]
pub const fn uide(&self) -> super::vals::Uide {
let val = (self.0 >> 24usize) & 0x01;
super::vals::Uide::from_bits(val as u8)
}
#[doc = "UOTGID Pin Enable"]
#[inline(always)]
pub const fn set_uide(&mut self, val: super::vals::Uide) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val.to_bits() as u32) & 0x01) << 24usize);
}
#[doc = "UOTGHS Mode"]
#[must_use]
#[inline(always)]
pub const fn uimod(&self) -> super::vals::Uimod {
let val = (self.0 >> 25usize) & 0x01;
super::vals::Uimod::from_bits(val as u8)
}
#[doc = "UOTGHS Mode"]
#[inline(always)]
pub const fn set_uimod(&mut self, val: super::vals::Uimod) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val.to_bits() as u32) & 0x01) << 25usize);
}
}
impl Default for Ctrl {
#[inline(always)]
fn default() -> Ctrl {
Ctrl(0)
}
}
impl core::fmt::Debug for Ctrl {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ctrl")
.field("idte", &self.idte())
.field("vbuste", &self.vbuste())
.field("srpe", &self.srpe())
.field("vberre", &self.vberre())
.field("bcerre", &self.bcerre())
.field("roleexe", &self.roleexe())
.field("hnperre", &self.hnperre())
.field("stoe", &self.stoe())
.field("vbushwc", &self.vbushwc())
.field("srpsel", &self.srpsel())
.field("srpreq", &self.srpreq())
.field("hnpreq", &self.hnpreq())
.field("otgpade", &self.otgpade())
.field("vbuspo", &self.vbuspo())
.field("frzclk", &self.frzclk())
.field("usbe", &self.usbe())
.field("timvalue", &self.timvalue())
.field("timpage", &self.timpage())
.field("unlock", &self.unlock())
.field("uide", &self.uide())
.field("uimod", &self.uimod())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ctrl {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ctrl {{ idte: {=bool:?}, vbuste: {=bool:?}, srpe: {=bool:?}, vberre: {=bool:?}, bcerre: {=bool:?}, roleexe: {=bool:?}, hnperre: {=bool:?}, stoe: {=bool:?}, vbushwc: {=bool:?}, srpsel: {=bool:?}, srpreq: {=bool:?}, hnpreq: {=bool:?}, otgpade: {=bool:?}, vbuspo: {=bool:?}, frzclk: {=bool:?}, usbe: {=bool:?}, timvalue: {=u8:?}, timpage: {=u8:?}, unlock: {=bool:?}, uide: {:?}, uimod: {:?} }}",
self.idte(),
self.vbuste(),
self.srpe(),
self.vberre(),
self.bcerre(),
self.roleexe(),
self.hnperre(),
self.stoe(),
self.vbushwc(),
self.srpsel(),
self.srpreq(),
self.hnpreq(),
self.otgpade(),
self.vbuspo(),
self.frzclk(),
self.usbe(),
self.timvalue(),
self.timpage(),
self.unlock(),
self.uide(),
self.uimod()
)
}
}
#[doc = "Device General Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devctrl(pub u32);
impl Devctrl {
#[doc = "USB Address"]
#[must_use]
#[inline(always)]
pub const fn uadd(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "USB Address"]
#[inline(always)]
pub const fn set_uadd(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "Address Enable"]
#[must_use]
#[inline(always)]
pub const fn adden(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Address Enable"]
#[inline(always)]
pub const fn set_adden(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Detach"]
#[must_use]
#[inline(always)]
pub const fn detach(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Detach"]
#[inline(always)]
pub const fn set_detach(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Remote Wake-Up"]
#[must_use]
#[inline(always)]
pub const fn rmwkup(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Remote Wake-Up"]
#[inline(always)]
pub const fn set_rmwkup(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Mode Configuration"]
#[must_use]
#[inline(always)]
pub const fn spdconf(&self) -> super::vals::DevctrlSpdconf {
let val = (self.0 >> 10usize) & 0x03;
super::vals::DevctrlSpdconf::from_bits(val as u8)
}
#[doc = "Mode Configuration"]
#[inline(always)]
pub const fn set_spdconf(&mut self, val: super::vals::DevctrlSpdconf) {
self.0 = (self.0 & !(0x03 << 10usize)) | (((val.to_bits() as u32) & 0x03) << 10usize);
}
#[doc = "Low-Speed Mode Force"]
#[must_use]
#[inline(always)]
pub const fn ls(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Low-Speed Mode Force"]
#[inline(always)]
pub const fn set_ls(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Test mode J"]
#[must_use]
#[inline(always)]
pub const fn tstj(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Test mode J"]
#[inline(always)]
pub const fn set_tstj(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Test mode K"]
#[must_use]
#[inline(always)]
pub const fn tstk(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Test mode K"]
#[inline(always)]
pub const fn set_tstk(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Test packet mode"]
#[must_use]
#[inline(always)]
pub const fn tstpckt(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Test packet mode"]
#[inline(always)]
pub const fn set_tstpckt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Specific Operational mode"]
#[must_use]
#[inline(always)]
pub const fn opmode2(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Specific Operational mode"]
#[inline(always)]
pub const fn set_opmode2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
}
impl Default for Devctrl {
#[inline(always)]
fn default() -> Devctrl {
Devctrl(0)
}
}
impl core::fmt::Debug for Devctrl {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devctrl")
.field("uadd", &self.uadd())
.field("adden", &self.adden())
.field("detach", &self.detach())
.field("rmwkup", &self.rmwkup())
.field("spdconf", &self.spdconf())
.field("ls", &self.ls())
.field("tstj", &self.tstj())
.field("tstk", &self.tstk())
.field("tstpckt", &self.tstpckt())
.field("opmode2", &self.opmode2())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devctrl {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devctrl {{ uadd: {=u8:?}, adden: {=bool:?}, detach: {=bool:?}, rmwkup: {=bool:?}, spdconf: {:?}, ls: {=bool:?}, tstj: {=bool:?}, tstk: {=bool:?}, tstpckt: {=bool:?}, opmode2: {=bool:?} }}",
self.uadd(),
self.adden(),
self.detach(),
self.rmwkup(),
self.spdconf(),
self.ls(),
self.tstj(),
self.tstk(),
self.tstpckt(),
self.opmode2()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress1(pub u32);
impl Devdmaaddress1 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress1 {
#[inline(always)]
fn default() -> Devdmaaddress1 {
Devdmaaddress1(0)
}
}
impl core::fmt::Debug for Devdmaaddress1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress1")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress1 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress2(pub u32);
impl Devdmaaddress2 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress2 {
#[inline(always)]
fn default() -> Devdmaaddress2 {
Devdmaaddress2(0)
}
}
impl core::fmt::Debug for Devdmaaddress2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress2")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress2 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress3(pub u32);
impl Devdmaaddress3 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress3 {
#[inline(always)]
fn default() -> Devdmaaddress3 {
Devdmaaddress3(0)
}
}
impl core::fmt::Debug for Devdmaaddress3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress3")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress3 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress4(pub u32);
impl Devdmaaddress4 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress4 {
#[inline(always)]
fn default() -> Devdmaaddress4 {
Devdmaaddress4(0)
}
}
impl core::fmt::Debug for Devdmaaddress4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress4")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress4 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress5(pub u32);
impl Devdmaaddress5 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress5 {
#[inline(always)]
fn default() -> Devdmaaddress5 {
Devdmaaddress5(0)
}
}
impl core::fmt::Debug for Devdmaaddress5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress5")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress5 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress6(pub u32);
impl Devdmaaddress6 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress6 {
#[inline(always)]
fn default() -> Devdmaaddress6 {
Devdmaaddress6(0)
}
}
impl core::fmt::Debug for Devdmaaddress6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress6")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress6 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Address Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmaaddress7(pub u32);
impl Devdmaaddress7 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmaaddress7 {
#[inline(always)]
fn default() -> Devdmaaddress7 {
Devdmaaddress7(0)
}
}
impl core::fmt::Debug for Devdmaaddress7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmaaddress7")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmaaddress7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmaaddress7 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol1(pub u32);
impl Devdmacontrol1 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol1 {
#[inline(always)]
fn default() -> Devdmacontrol1 {
Devdmacontrol1(0)
}
}
impl core::fmt::Debug for Devdmacontrol1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol1")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol1 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol2(pub u32);
impl Devdmacontrol2 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol2 {
#[inline(always)]
fn default() -> Devdmacontrol2 {
Devdmacontrol2(0)
}
}
impl core::fmt::Debug for Devdmacontrol2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol2")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol2 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol3(pub u32);
impl Devdmacontrol3 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol3 {
#[inline(always)]
fn default() -> Devdmacontrol3 {
Devdmacontrol3(0)
}
}
impl core::fmt::Debug for Devdmacontrol3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol3")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol3 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol4(pub u32);
impl Devdmacontrol4 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol4 {
#[inline(always)]
fn default() -> Devdmacontrol4 {
Devdmacontrol4(0)
}
}
impl core::fmt::Debug for Devdmacontrol4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol4")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol4 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol5(pub u32);
impl Devdmacontrol5 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol5 {
#[inline(always)]
fn default() -> Devdmacontrol5 {
Devdmacontrol5(0)
}
}
impl core::fmt::Debug for Devdmacontrol5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol5")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol5 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol6(pub u32);
impl Devdmacontrol6 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol6 {
#[inline(always)]
fn default() -> Devdmacontrol6 {
Devdmacontrol6(0)
}
}
impl core::fmt::Debug for Devdmacontrol6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol6")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol6 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Control Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmacontrol7(pub u32);
impl Devdmacontrol7 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable Control"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmacontrol7 {
#[inline(always)]
fn default() -> Devdmacontrol7 {
Devdmacontrol7(0)
}
}
impl core::fmt::Debug for Devdmacontrol7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmacontrol7")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmacontrol7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmacontrol7 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc1(pub u32);
impl Devdmanxtdsc1 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc1 {
#[inline(always)]
fn default() -> Devdmanxtdsc1 {
Devdmanxtdsc1(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc1")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc1 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc2(pub u32);
impl Devdmanxtdsc2 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc2 {
#[inline(always)]
fn default() -> Devdmanxtdsc2 {
Devdmanxtdsc2(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc2")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc2 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc3(pub u32);
impl Devdmanxtdsc3 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc3 {
#[inline(always)]
fn default() -> Devdmanxtdsc3 {
Devdmanxtdsc3(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc3")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc3 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc4(pub u32);
impl Devdmanxtdsc4 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc4 {
#[inline(always)]
fn default() -> Devdmanxtdsc4 {
Devdmanxtdsc4(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc4")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc4 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc5(pub u32);
impl Devdmanxtdsc5 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc5 {
#[inline(always)]
fn default() -> Devdmanxtdsc5 {
Devdmanxtdsc5(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc5")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc5 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc6(pub u32);
impl Devdmanxtdsc6 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc6 {
#[inline(always)]
fn default() -> Devdmanxtdsc6 {
Devdmanxtdsc6(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc6")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc6 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Next Descriptor Address Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmanxtdsc7(pub u32);
impl Devdmanxtdsc7 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Devdmanxtdsc7 {
#[inline(always)]
fn default() -> Devdmanxtdsc7 {
Devdmanxtdsc7(0)
}
}
impl core::fmt::Debug for Devdmanxtdsc7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmanxtdsc7")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmanxtdsc7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmanxtdsc7 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus1(pub u32);
impl Devdmastatus1 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus1 {
#[inline(always)]
fn default() -> Devdmastatus1 {
Devdmastatus1(0)
}
}
impl core::fmt::Debug for Devdmastatus1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus1")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus1 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus2(pub u32);
impl Devdmastatus2 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus2 {
#[inline(always)]
fn default() -> Devdmastatus2 {
Devdmastatus2(0)
}
}
impl core::fmt::Debug for Devdmastatus2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus2")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus2 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus3(pub u32);
impl Devdmastatus3 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus3 {
#[inline(always)]
fn default() -> Devdmastatus3 {
Devdmastatus3(0)
}
}
impl core::fmt::Debug for Devdmastatus3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus3")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus3 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus4(pub u32);
impl Devdmastatus4 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus4 {
#[inline(always)]
fn default() -> Devdmastatus4 {
Devdmastatus4(0)
}
}
impl core::fmt::Debug for Devdmastatus4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus4")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus4 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus5(pub u32);
impl Devdmastatus5 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus5 {
#[inline(always)]
fn default() -> Devdmastatus5 {
Devdmastatus5(0)
}
}
impl core::fmt::Debug for Devdmastatus5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus5")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus5 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus6(pub u32);
impl Devdmastatus6 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus6 {
#[inline(always)]
fn default() -> Devdmastatus6 {
Devdmastatus6(0)
}
}
impl core::fmt::Debug for Devdmastatus6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus6")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus6 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device DMA Channel Status Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devdmastatus7(pub u32);
impl Devdmastatus7 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Devdmastatus7 {
#[inline(always)]
fn default() -> Devdmastatus7 {
Devdmastatus7(0)
}
}
impl core::fmt::Debug for Devdmastatus7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devdmastatus7")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devdmastatus7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devdmastatus7 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Device Endpoint Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devept(pub u32);
impl Devept {
#[doc = "Endpoint 0 Enable"]
#[must_use]
#[inline(always)]
pub const fn epen(&self, n: usize) -> bool {
assert!(n < 9usize);
let offs = 0usize + n * 1usize;
let val = (self.0 >> offs) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Enable"]
#[inline(always)]
pub const fn set_epen(&mut self, n: usize, val: bool) {
assert!(n < 9usize);
let offs = 0usize + n * 1usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
}
#[doc = "Endpoint 0 Reset"]
#[must_use]
#[inline(always)]
pub const fn eprst(&self, n: usize) -> bool {
assert!(n < 9usize);
let offs = 16usize + n * 1usize;
let val = (self.0 >> offs) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Reset"]
#[inline(always)]
pub const fn set_eprst(&mut self, n: usize, val: bool) {
assert!(n < 9usize);
let offs = 16usize + n * 1usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
}
}
impl Default for Devept {
#[inline(always)]
fn default() -> Devept {
Devept(0)
}
}
impl core::fmt::Debug for Devept {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devept")
.field("epen[0]", &self.epen(0usize))
.field("epen[1]", &self.epen(1usize))
.field("epen[2]", &self.epen(2usize))
.field("epen[3]", &self.epen(3usize))
.field("epen[4]", &self.epen(4usize))
.field("epen[5]", &self.epen(5usize))
.field("epen[6]", &self.epen(6usize))
.field("epen[7]", &self.epen(7usize))
.field("epen[8]", &self.epen(8usize))
.field("eprst[0]", &self.eprst(0usize))
.field("eprst[1]", &self.eprst(1usize))
.field("eprst[2]", &self.eprst(2usize))
.field("eprst[3]", &self.eprst(3usize))
.field("eprst[4]", &self.eprst(4usize))
.field("eprst[5]", &self.eprst(5usize))
.field("eprst[6]", &self.eprst(6usize))
.field("eprst[7]", &self.eprst(7usize))
.field("eprst[8]", &self.eprst(8usize))
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devept {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devept {{ epen[0]: {=bool:?}, epen[1]: {=bool:?}, epen[2]: {=bool:?}, epen[3]: {=bool:?}, epen[4]: {=bool:?}, epen[5]: {=bool:?}, epen[6]: {=bool:?}, epen[7]: {=bool:?}, epen[8]: {=bool:?}, eprst[0]: {=bool:?}, eprst[1]: {=bool:?}, eprst[2]: {=bool:?}, eprst[3]: {=bool:?}, eprst[4]: {=bool:?}, eprst[5]: {=bool:?}, eprst[6]: {=bool:?}, eprst[7]: {=bool:?}, eprst[8]: {=bool:?} }}",
self.epen(0usize),
self.epen(1usize),
self.epen(2usize),
self.epen(3usize),
self.epen(4usize),
self.epen(5usize),
self.epen(6usize),
self.epen(7usize),
self.epen(8usize),
self.eprst(0usize),
self.eprst(1usize),
self.eprst(2usize),
self.eprst(3usize),
self.eprst(4usize),
self.eprst(5usize),
self.eprst(6usize),
self.eprst(7usize),
self.eprst(8usize)
)
}
}
#[doc = "Device Endpoint Configuration Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptcfg(pub u32);
impl Deveptcfg {
#[doc = "Endpoint Memory Allocate"]
#[must_use]
#[inline(always)]
pub const fn alloc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Endpoint Memory Allocate"]
#[inline(always)]
pub const fn set_alloc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Endpoint Banks"]
#[must_use]
#[inline(always)]
pub const fn epbk(&self) -> super::vals::Epbk {
let val = (self.0 >> 2usize) & 0x03;
super::vals::Epbk::from_bits(val as u8)
}
#[doc = "Endpoint Banks"]
#[inline(always)]
pub const fn set_epbk(&mut self, val: super::vals::Epbk) {
self.0 = (self.0 & !(0x03 << 2usize)) | (((val.to_bits() as u32) & 0x03) << 2usize);
}
#[doc = "Endpoint Size"]
#[must_use]
#[inline(always)]
pub const fn epsize(&self) -> super::vals::Epsize {
let val = (self.0 >> 4usize) & 0x07;
super::vals::Epsize::from_bits(val as u8)
}
#[doc = "Endpoint Size"]
#[inline(always)]
pub const fn set_epsize(&mut self, val: super::vals::Epsize) {
self.0 = (self.0 & !(0x07 << 4usize)) | (((val.to_bits() as u32) & 0x07) << 4usize);
}
#[doc = "Endpoint Direction"]
#[must_use]
#[inline(always)]
pub const fn epdir(&self) -> super::vals::Epdir {
let val = (self.0 >> 8usize) & 0x01;
super::vals::Epdir::from_bits(val as u8)
}
#[doc = "Endpoint Direction"]
#[inline(always)]
pub const fn set_epdir(&mut self, val: super::vals::Epdir) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val.to_bits() as u32) & 0x01) << 8usize);
}
#[doc = "Automatic Switch"]
#[must_use]
#[inline(always)]
pub const fn autosw(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Automatic Switch"]
#[inline(always)]
pub const fn set_autosw(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Endpoint Type"]
#[must_use]
#[inline(always)]
pub const fn eptype(&self) -> super::vals::Eptype {
let val = (self.0 >> 11usize) & 0x03;
super::vals::Eptype::from_bits(val as u8)
}
#[doc = "Endpoint Type"]
#[inline(always)]
pub const fn set_eptype(&mut self, val: super::vals::Eptype) {
self.0 = (self.0 & !(0x03 << 11usize)) | (((val.to_bits() as u32) & 0x03) << 11usize);
}
#[doc = "Number of transaction per microframe for isochronous endpoint"]
#[must_use]
#[inline(always)]
pub const fn nbtrans(&self) -> super::vals::Nbtrans {
let val = (self.0 >> 13usize) & 0x03;
super::vals::Nbtrans::from_bits(val as u8)
}
#[doc = "Number of transaction per microframe for isochronous endpoint"]
#[inline(always)]
pub const fn set_nbtrans(&mut self, val: super::vals::Nbtrans) {
self.0 = (self.0 & !(0x03 << 13usize)) | (((val.to_bits() as u32) & 0x03) << 13usize);
}
}
impl Default for Deveptcfg {
#[inline(always)]
fn default() -> Deveptcfg {
Deveptcfg(0)
}
}
impl core::fmt::Debug for Deveptcfg {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptcfg")
.field("alloc", &self.alloc())
.field("epbk", &self.epbk())
.field("epsize", &self.epsize())
.field("epdir", &self.epdir())
.field("autosw", &self.autosw())
.field("eptype", &self.eptype())
.field("nbtrans", &self.nbtrans())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptcfg {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptcfg {{ alloc: {=bool:?}, epbk: {:?}, epsize: {:?}, epdir: {:?}, autosw: {=bool:?}, eptype: {:?}, nbtrans: {:?} }}",
self.alloc(),
self.epbk(),
self.epsize(),
self.epdir(),
self.autosw(),
self.eptype(),
self.nbtrans()
)
}
}
#[doc = "Device Endpoint Clear Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devepticr(pub u32);
impl Devepticr {
#[doc = "Transmitted IN Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txinic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Clear"]
#[inline(always)]
pub const fn set_txinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxoutic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxstpic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt Clear"]
#[inline(always)]
pub const fn set_rxstpic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakoutic(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt Clear"]
#[inline(always)]
pub const fn set_nakoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakinic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt Clear"]
#[inline(always)]
pub const fn set_nakinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn stalledic(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt Clear"]
#[inline(always)]
pub const fn set_stalledic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketc(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Devepticr {
#[inline(always)]
fn default() -> Devepticr {
Devepticr(0)
}
}
impl core::fmt::Debug for Devepticr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devepticr")
.field("txinic", &self.txinic())
.field("rxoutic", &self.rxoutic())
.field("rxstpic", &self.rxstpic())
.field("nakoutic", &self.nakoutic())
.field("nakinic", &self.nakinic())
.field("overfic", &self.overfic())
.field("stalledic", &self.stalledic())
.field("shortpacketc", &self.shortpacketc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devepticr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devepticr {{ txinic: {=bool:?}, rxoutic: {=bool:?}, rxstpic: {=bool:?}, nakoutic: {=bool:?}, nakinic: {=bool:?}, overfic: {=bool:?}, stalledic: {=bool:?}, shortpacketc: {=bool:?} }}",
self.txinic(),
self.rxoutic(),
self.rxstpic(),
self.nakoutic(),
self.nakinic(),
self.overfic(),
self.stalledic(),
self.shortpacketc()
)
}
}
#[doc = "Device Endpoint Clear Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devepticr0Isoenpt(pub u32);
impl Devepticr0Isoenpt {
#[doc = "Transmitted IN Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txinic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Clear"]
#[inline(always)]
pub const fn set_txinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxoutic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn underfic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Clear"]
#[inline(always)]
pub const fn set_underfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High bandwidth isochronous IN Underflow Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerric(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High bandwidth isochronous IN Underflow Error Interrupt Clear"]
#[inline(always)]
pub const fn set_hbisoinerric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Clear"]
#[inline(always)]
pub const fn set_hbisoflushic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn crcerric(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Clear"]
#[inline(always)]
pub const fn set_crcerric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketc(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Devepticr0Isoenpt {
#[inline(always)]
fn default() -> Devepticr0Isoenpt {
Devepticr0Isoenpt(0)
}
}
impl core::fmt::Debug for Devepticr0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devepticr0Isoenpt")
.field("txinic", &self.txinic())
.field("rxoutic", &self.rxoutic())
.field("underfic", &self.underfic())
.field("hbisoinerric", &self.hbisoinerric())
.field("hbisoflushic", &self.hbisoflushic())
.field("overfic", &self.overfic())
.field("crcerric", &self.crcerric())
.field("shortpacketc", &self.shortpacketc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devepticr0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devepticr0Isoenpt {{ txinic: {=bool:?}, rxoutic: {=bool:?}, underfic: {=bool:?}, hbisoinerric: {=bool:?}, hbisoflushic: {=bool:?}, overfic: {=bool:?}, crcerric: {=bool:?}, shortpacketc: {=bool:?} }}",
self.txinic(),
self.rxoutic(),
self.underfic(),
self.hbisoinerric(),
self.hbisoflushic(),
self.overfic(),
self.crcerric(),
self.shortpacketc()
)
}
}
#[doc = "Device Endpoint Disable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptidr(pub u32);
impl Deveptidr {
#[doc = "Transmitted IN Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txinec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Interrupt Clear"]
#[inline(always)]
pub const fn set_txinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxoutec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxstpec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt Clear"]
#[inline(always)]
pub const fn set_rxstpec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakoutec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt Clear"]
#[inline(always)]
pub const fn set_nakoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakinec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt Clear"]
#[inline(always)]
pub const fn set_nakinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn stalledec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt Clear"]
#[inline(always)]
pub const fn set_stalledec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Shortpacket Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketec(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Shortpacket Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nbusybkec(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Clear"]
#[inline(always)]
pub const fn set_nbusybkec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control Clear"]
#[must_use]
#[inline(always)]
pub const fn fifoconc(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control Clear"]
#[inline(always)]
pub const fn set_fifoconc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request Clear"]
#[must_use]
#[inline(always)]
pub const fn epdishdmac(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request Clear"]
#[inline(always)]
pub const fn set_epdishdmac(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "NYET Token Disable Clear"]
#[must_use]
#[inline(always)]
pub const fn nyetdisc(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "NYET Token Disable Clear"]
#[inline(always)]
pub const fn set_nyetdisc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "STALL Request Clear"]
#[must_use]
#[inline(always)]
pub const fn stallrqc(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "STALL Request Clear"]
#[inline(always)]
pub const fn set_stallrqc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
}
impl Default for Deveptidr {
#[inline(always)]
fn default() -> Deveptidr {
Deveptidr(0)
}
}
impl core::fmt::Debug for Deveptidr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptidr")
.field("txinec", &self.txinec())
.field("rxoutec", &self.rxoutec())
.field("rxstpec", &self.rxstpec())
.field("nakoutec", &self.nakoutec())
.field("nakinec", &self.nakinec())
.field("overfec", &self.overfec())
.field("stalledec", &self.stalledec())
.field("shortpacketec", &self.shortpacketec())
.field("nbusybkec", &self.nbusybkec())
.field("fifoconc", &self.fifoconc())
.field("epdishdmac", &self.epdishdmac())
.field("nyetdisc", &self.nyetdisc())
.field("stallrqc", &self.stallrqc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptidr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptidr {{ txinec: {=bool:?}, rxoutec: {=bool:?}, rxstpec: {=bool:?}, nakoutec: {=bool:?}, nakinec: {=bool:?}, overfec: {=bool:?}, stalledec: {=bool:?}, shortpacketec: {=bool:?}, nbusybkec: {=bool:?}, fifoconc: {=bool:?}, epdishdmac: {=bool:?}, nyetdisc: {=bool:?}, stallrqc: {=bool:?} }}",
self.txinec(),
self.rxoutec(),
self.rxstpec(),
self.nakoutec(),
self.nakinec(),
self.overfec(),
self.stalledec(),
self.shortpacketec(),
self.nbusybkec(),
self.fifoconc(),
self.epdishdmac(),
self.nyetdisc(),
self.stallrqc()
)
}
}
#[doc = "Device Endpoint Disable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptidr0Isoenpt(pub u32);
impl Deveptidr0Isoenpt {
#[doc = "Transmitted IN Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txinec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Interrupt Clear"]
#[inline(always)]
pub const fn set_txinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxoutec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn underfec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Clear"]
#[inline(always)]
pub const fn set_underfec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerrec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt Clear"]
#[inline(always)]
pub const fn set_hbisoinerrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Clear"]
#[inline(always)]
pub const fn set_hbisoflushec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn crcerrec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Clear"]
#[inline(always)]
pub const fn set_crcerrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Shortpacket Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketec(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Shortpacket Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "MData Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn mdatec(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "MData Interrupt Clear"]
#[inline(always)]
pub const fn set_mdatec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "DataX Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn dataxec(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "DataX Interrupt Clear"]
#[inline(always)]
pub const fn set_dataxec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Transaction Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn errortransec(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Transaction Error Interrupt Clear"]
#[inline(always)]
pub const fn set_errortransec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Number of Busy Banks Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nbusybkec(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Clear"]
#[inline(always)]
pub const fn set_nbusybkec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control Clear"]
#[must_use]
#[inline(always)]
pub const fn fifoconc(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control Clear"]
#[inline(always)]
pub const fn set_fifoconc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request Clear"]
#[must_use]
#[inline(always)]
pub const fn epdishdmac(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request Clear"]
#[inline(always)]
pub const fn set_epdishdmac(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
}
impl Default for Deveptidr0Isoenpt {
#[inline(always)]
fn default() -> Deveptidr0Isoenpt {
Deveptidr0Isoenpt(0)
}
}
impl core::fmt::Debug for Deveptidr0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptidr0Isoenpt")
.field("txinec", &self.txinec())
.field("rxoutec", &self.rxoutec())
.field("underfec", &self.underfec())
.field("hbisoinerrec", &self.hbisoinerrec())
.field("hbisoflushec", &self.hbisoflushec())
.field("overfec", &self.overfec())
.field("crcerrec", &self.crcerrec())
.field("shortpacketec", &self.shortpacketec())
.field("mdatec", &self.mdatec())
.field("dataxec", &self.dataxec())
.field("errortransec", &self.errortransec())
.field("nbusybkec", &self.nbusybkec())
.field("fifoconc", &self.fifoconc())
.field("epdishdmac", &self.epdishdmac())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptidr0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptidr0Isoenpt {{ txinec: {=bool:?}, rxoutec: {=bool:?}, underfec: {=bool:?}, hbisoinerrec: {=bool:?}, hbisoflushec: {=bool:?}, overfec: {=bool:?}, crcerrec: {=bool:?}, shortpacketec: {=bool:?}, mdatec: {=bool:?}, dataxec: {=bool:?}, errortransec: {=bool:?}, nbusybkec: {=bool:?}, fifoconc: {=bool:?}, epdishdmac: {=bool:?} }}",
self.txinec(),
self.rxoutec(),
self.underfec(),
self.hbisoinerrec(),
self.hbisoflushec(),
self.overfec(),
self.crcerrec(),
self.shortpacketec(),
self.mdatec(),
self.dataxec(),
self.errortransec(),
self.nbusybkec(),
self.fifoconc(),
self.epdishdmac()
)
}
}
#[doc = "Device Endpoint Enable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptier(pub u32);
impl Deveptier {
#[doc = "Transmitted IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txines(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxoutes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxstpes(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt Enable"]
#[inline(always)]
pub const fn set_rxstpes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakoutes(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt Enable"]
#[inline(always)]
pub const fn set_nakoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakines(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt Enable"]
#[inline(always)]
pub const fn set_nakines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfes(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn stalledes(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt Enable"]
#[inline(always)]
pub const fn set_stalledes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketes(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkes(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[inline(always)]
pub const fn set_nbusybkes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Kill IN Bank"]
#[must_use]
#[inline(always)]
pub const fn killbks(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Kill IN Bank"]
#[inline(always)]
pub const fn set_killbks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocons(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocons(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn epdishdmas(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_epdishdmas(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "NYET Token Disable Enable"]
#[must_use]
#[inline(always)]
pub const fn nyetdiss(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "NYET Token Disable Enable"]
#[inline(always)]
pub const fn set_nyetdiss(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle Enable"]
#[must_use]
#[inline(always)]
pub const fn rstdts(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle Enable"]
#[inline(always)]
pub const fn set_rstdts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "STALL Request Enable"]
#[must_use]
#[inline(always)]
pub const fn stallrqs(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "STALL Request Enable"]
#[inline(always)]
pub const fn set_stallrqs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
}
impl Default for Deveptier {
#[inline(always)]
fn default() -> Deveptier {
Deveptier(0)
}
}
impl core::fmt::Debug for Deveptier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptier")
.field("txines", &self.txines())
.field("rxoutes", &self.rxoutes())
.field("rxstpes", &self.rxstpes())
.field("nakoutes", &self.nakoutes())
.field("nakines", &self.nakines())
.field("overfes", &self.overfes())
.field("stalledes", &self.stalledes())
.field("shortpacketes", &self.shortpacketes())
.field("nbusybkes", &self.nbusybkes())
.field("killbks", &self.killbks())
.field("fifocons", &self.fifocons())
.field("epdishdmas", &self.epdishdmas())
.field("nyetdiss", &self.nyetdiss())
.field("rstdts", &self.rstdts())
.field("stallrqs", &self.stallrqs())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptier {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptier {{ txines: {=bool:?}, rxoutes: {=bool:?}, rxstpes: {=bool:?}, nakoutes: {=bool:?}, nakines: {=bool:?}, overfes: {=bool:?}, stalledes: {=bool:?}, shortpacketes: {=bool:?}, nbusybkes: {=bool:?}, killbks: {=bool:?}, fifocons: {=bool:?}, epdishdmas: {=bool:?}, nyetdiss: {=bool:?}, rstdts: {=bool:?}, stallrqs: {=bool:?} }}",
self.txines(),
self.rxoutes(),
self.rxstpes(),
self.nakoutes(),
self.nakines(),
self.overfes(),
self.stalledes(),
self.shortpacketes(),
self.nbusybkes(),
self.killbks(),
self.fifocons(),
self.epdishdmas(),
self.nyetdiss(),
self.rstdts(),
self.stallrqs()
)
}
}
#[doc = "Device Endpoint Enable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptier0Isoenpt(pub u32);
impl Deveptier0Isoenpt {
#[doc = "Transmitted IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txines(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxoutes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn underfes(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Enable"]
#[inline(always)]
pub const fn set_underfes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerres(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt Enable"]
#[inline(always)]
pub const fn set_hbisoinerres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushes(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Enable"]
#[inline(always)]
pub const fn set_hbisoflushes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfes(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn crcerres(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Enable"]
#[inline(always)]
pub const fn set_crcerres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketes(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "MData Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn mdataes(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "MData Interrupt Enable"]
#[inline(always)]
pub const fn set_mdataes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "DataX Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dataxes(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "DataX Interrupt Enable"]
#[inline(always)]
pub const fn set_dataxes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Transaction Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn errortranses(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Transaction Error Interrupt Enable"]
#[inline(always)]
pub const fn set_errortranses(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkes(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[inline(always)]
pub const fn set_nbusybkes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Kill IN Bank"]
#[must_use]
#[inline(always)]
pub const fn killbks(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Kill IN Bank"]
#[inline(always)]
pub const fn set_killbks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocons(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocons(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn epdishdmas(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_epdishdmas(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Reset Data Toggle Enable"]
#[must_use]
#[inline(always)]
pub const fn rstdts(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle Enable"]
#[inline(always)]
pub const fn set_rstdts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "STALL Request Enable"]
#[must_use]
#[inline(always)]
pub const fn stallrqs(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "STALL Request Enable"]
#[inline(always)]
pub const fn set_stallrqs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
}
impl Default for Deveptier0Isoenpt {
#[inline(always)]
fn default() -> Deveptier0Isoenpt {
Deveptier0Isoenpt(0)
}
}
impl core::fmt::Debug for Deveptier0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptier0Isoenpt")
.field("txines", &self.txines())
.field("rxoutes", &self.rxoutes())
.field("underfes", &self.underfes())
.field("hbisoinerres", &self.hbisoinerres())
.field("hbisoflushes", &self.hbisoflushes())
.field("overfes", &self.overfes())
.field("crcerres", &self.crcerres())
.field("shortpacketes", &self.shortpacketes())
.field("mdataes", &self.mdataes())
.field("dataxes", &self.dataxes())
.field("errortranses", &self.errortranses())
.field("nbusybkes", &self.nbusybkes())
.field("killbks", &self.killbks())
.field("fifocons", &self.fifocons())
.field("epdishdmas", &self.epdishdmas())
.field("rstdts", &self.rstdts())
.field("stallrqs", &self.stallrqs())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptier0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptier0Isoenpt {{ txines: {=bool:?}, rxoutes: {=bool:?}, underfes: {=bool:?}, hbisoinerres: {=bool:?}, hbisoflushes: {=bool:?}, overfes: {=bool:?}, crcerres: {=bool:?}, shortpacketes: {=bool:?}, mdataes: {=bool:?}, dataxes: {=bool:?}, errortranses: {=bool:?}, nbusybkes: {=bool:?}, killbks: {=bool:?}, fifocons: {=bool:?}, epdishdmas: {=bool:?}, rstdts: {=bool:?}, stallrqs: {=bool:?} }}",
self.txines(),
self.rxoutes(),
self.underfes(),
self.hbisoinerres(),
self.hbisoflushes(),
self.overfes(),
self.crcerres(),
self.shortpacketes(),
self.mdataes(),
self.dataxes(),
self.errortranses(),
self.nbusybkes(),
self.killbks(),
self.fifocons(),
self.epdishdmas(),
self.rstdts(),
self.stallrqs()
)
}
}
#[doc = "Device Endpoint Set Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptifr(pub u32);
impl Deveptifr {
#[doc = "Transmitted IN Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txinis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Set"]
#[inline(always)]
pub const fn set_txinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxoutis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Set"]
#[inline(always)]
pub const fn set_rxoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxstpis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt Set"]
#[inline(always)]
pub const fn set_rxstpis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nakoutis(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt Set"]
#[inline(always)]
pub const fn set_nakoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nakinis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt Set"]
#[inline(always)]
pub const fn set_nakinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn overfis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Set"]
#[inline(always)]
pub const fn set_overfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn stalledis(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt Set"]
#[inline(always)]
pub const fn set_stalledis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn shortpackets(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Set"]
#[inline(always)]
pub const fn set_shortpackets(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nbusybks(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Set"]
#[inline(always)]
pub const fn set_nbusybks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
}
impl Default for Deveptifr {
#[inline(always)]
fn default() -> Deveptifr {
Deveptifr(0)
}
}
impl core::fmt::Debug for Deveptifr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptifr")
.field("txinis", &self.txinis())
.field("rxoutis", &self.rxoutis())
.field("rxstpis", &self.rxstpis())
.field("nakoutis", &self.nakoutis())
.field("nakinis", &self.nakinis())
.field("overfis", &self.overfis())
.field("stalledis", &self.stalledis())
.field("shortpackets", &self.shortpackets())
.field("nbusybks", &self.nbusybks())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptifr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptifr {{ txinis: {=bool:?}, rxoutis: {=bool:?}, rxstpis: {=bool:?}, nakoutis: {=bool:?}, nakinis: {=bool:?}, overfis: {=bool:?}, stalledis: {=bool:?}, shortpackets: {=bool:?}, nbusybks: {=bool:?} }}",
self.txinis(),
self.rxoutis(),
self.rxstpis(),
self.nakoutis(),
self.nakinis(),
self.overfis(),
self.stalledis(),
self.shortpackets(),
self.nbusybks()
)
}
}
#[doc = "Device Endpoint Set Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptifr0Isoenpt(pub u32);
impl Deveptifr0Isoenpt {
#[doc = "Transmitted IN Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txinis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt Set"]
#[inline(always)]
pub const fn set_txinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxoutis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt Set"]
#[inline(always)]
pub const fn set_rxoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn underfis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Set"]
#[inline(always)]
pub const fn set_underfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High bandwidth isochronous IN Underflow Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerris(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High bandwidth isochronous IN Underflow Error Interrupt Set"]
#[inline(always)]
pub const fn set_hbisoinerris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt Set"]
#[inline(always)]
pub const fn set_hbisoflushis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn overfis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Set"]
#[inline(always)]
pub const fn set_overfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn crcerris(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Set"]
#[inline(always)]
pub const fn set_crcerris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn shortpackets(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Set"]
#[inline(always)]
pub const fn set_shortpackets(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nbusybks(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Set"]
#[inline(always)]
pub const fn set_nbusybks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
}
impl Default for Deveptifr0Isoenpt {
#[inline(always)]
fn default() -> Deveptifr0Isoenpt {
Deveptifr0Isoenpt(0)
}
}
impl core::fmt::Debug for Deveptifr0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptifr0Isoenpt")
.field("txinis", &self.txinis())
.field("rxoutis", &self.rxoutis())
.field("underfis", &self.underfis())
.field("hbisoinerris", &self.hbisoinerris())
.field("hbisoflushis", &self.hbisoflushis())
.field("overfis", &self.overfis())
.field("crcerris", &self.crcerris())
.field("shortpackets", &self.shortpackets())
.field("nbusybks", &self.nbusybks())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptifr0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptifr0Isoenpt {{ txinis: {=bool:?}, rxoutis: {=bool:?}, underfis: {=bool:?}, hbisoinerris: {=bool:?}, hbisoflushis: {=bool:?}, overfis: {=bool:?}, crcerris: {=bool:?}, shortpackets: {=bool:?}, nbusybks: {=bool:?} }}",
self.txinis(),
self.rxoutis(),
self.underfis(),
self.hbisoinerris(),
self.hbisoflushis(),
self.overfis(),
self.crcerris(),
self.shortpackets(),
self.nbusybks()
)
}
}
#[doc = "Device Endpoint Mask Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptimr(pub u32);
impl Deveptimr {
#[doc = "Transmitted IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txine(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt"]
#[inline(always)]
pub const fn set_txine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxoute(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt"]
#[inline(always)]
pub const fn set_rxoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxstpe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt"]
#[inline(always)]
pub const fn set_rxstpe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakoute(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt"]
#[inline(always)]
pub const fn set_nakoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakine(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt"]
#[inline(always)]
pub const fn set_nakine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfe(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn stallede(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt"]
#[inline(always)]
pub const fn set_stallede(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpackete(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpackete(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nbusybke(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt"]
#[inline(always)]
pub const fn set_nbusybke(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Kill IN Bank"]
#[must_use]
#[inline(always)]
pub const fn killbk(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Kill IN Bank"]
#[inline(always)]
pub const fn set_killbk(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocon(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocon(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request"]
#[must_use]
#[inline(always)]
pub const fn epdishdma(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request"]
#[inline(always)]
pub const fn set_epdishdma(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "NYET Token Disable"]
#[must_use]
#[inline(always)]
pub const fn nyetdis(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "NYET Token Disable"]
#[inline(always)]
pub const fn set_nyetdis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle"]
#[must_use]
#[inline(always)]
pub const fn rstdt(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle"]
#[inline(always)]
pub const fn set_rstdt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "STALL Request"]
#[must_use]
#[inline(always)]
pub const fn stallrq(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "STALL Request"]
#[inline(always)]
pub const fn set_stallrq(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
}
impl Default for Deveptimr {
#[inline(always)]
fn default() -> Deveptimr {
Deveptimr(0)
}
}
impl core::fmt::Debug for Deveptimr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptimr")
.field("txine", &self.txine())
.field("rxoute", &self.rxoute())
.field("rxstpe", &self.rxstpe())
.field("nakoute", &self.nakoute())
.field("nakine", &self.nakine())
.field("overfe", &self.overfe())
.field("stallede", &self.stallede())
.field("shortpackete", &self.shortpackete())
.field("nbusybke", &self.nbusybke())
.field("killbk", &self.killbk())
.field("fifocon", &self.fifocon())
.field("epdishdma", &self.epdishdma())
.field("nyetdis", &self.nyetdis())
.field("rstdt", &self.rstdt())
.field("stallrq", &self.stallrq())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptimr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptimr {{ txine: {=bool:?}, rxoute: {=bool:?}, rxstpe: {=bool:?}, nakoute: {=bool:?}, nakine: {=bool:?}, overfe: {=bool:?}, stallede: {=bool:?}, shortpackete: {=bool:?}, nbusybke: {=bool:?}, killbk: {=bool:?}, fifocon: {=bool:?}, epdishdma: {=bool:?}, nyetdis: {=bool:?}, rstdt: {=bool:?}, stallrq: {=bool:?} }}",
self.txine(),
self.rxoute(),
self.rxstpe(),
self.nakoute(),
self.nakine(),
self.overfe(),
self.stallede(),
self.shortpackete(),
self.nbusybke(),
self.killbk(),
self.fifocon(),
self.epdishdma(),
self.nyetdis(),
self.rstdt(),
self.stallrq()
)
}
}
#[doc = "Device Endpoint Mask Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptimr0Isoenpt(pub u32);
impl Deveptimr0Isoenpt {
#[doc = "Transmitted IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txine(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt"]
#[inline(always)]
pub const fn set_txine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxoute(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt"]
#[inline(always)]
pub const fn set_rxoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn underfe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt"]
#[inline(always)]
pub const fn set_underfe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Error Interrupt"]
#[inline(always)]
pub const fn set_hbisoinerre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushe(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt"]
#[inline(always)]
pub const fn set_hbisoflushe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfe(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn crcerre(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt"]
#[inline(always)]
pub const fn set_crcerre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpackete(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpackete(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "MData Interrupt"]
#[must_use]
#[inline(always)]
pub const fn mdatae(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "MData Interrupt"]
#[inline(always)]
pub const fn set_mdatae(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "DataX Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dataxe(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "DataX Interrupt"]
#[inline(always)]
pub const fn set_dataxe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Transaction Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn errortranse(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Transaction Error Interrupt"]
#[inline(always)]
pub const fn set_errortranse(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Number of Busy Banks Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nbusybke(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt"]
#[inline(always)]
pub const fn set_nbusybke(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Kill IN Bank"]
#[must_use]
#[inline(always)]
pub const fn killbk(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Kill IN Bank"]
#[inline(always)]
pub const fn set_killbk(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocon(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocon(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint Interrupts Disable HDMA Request"]
#[must_use]
#[inline(always)]
pub const fn epdishdma(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint Interrupts Disable HDMA Request"]
#[inline(always)]
pub const fn set_epdishdma(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Reset Data Toggle"]
#[must_use]
#[inline(always)]
pub const fn rstdt(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle"]
#[inline(always)]
pub const fn set_rstdt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Deveptimr0Isoenpt {
#[inline(always)]
fn default() -> Deveptimr0Isoenpt {
Deveptimr0Isoenpt(0)
}
}
impl core::fmt::Debug for Deveptimr0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptimr0Isoenpt")
.field("txine", &self.txine())
.field("rxoute", &self.rxoute())
.field("underfe", &self.underfe())
.field("hbisoinerre", &self.hbisoinerre())
.field("hbisoflushe", &self.hbisoflushe())
.field("overfe", &self.overfe())
.field("crcerre", &self.crcerre())
.field("shortpackete", &self.shortpackete())
.field("mdatae", &self.mdatae())
.field("dataxe", &self.dataxe())
.field("errortranse", &self.errortranse())
.field("nbusybke", &self.nbusybke())
.field("killbk", &self.killbk())
.field("fifocon", &self.fifocon())
.field("epdishdma", &self.epdishdma())
.field("rstdt", &self.rstdt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptimr0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptimr0Isoenpt {{ txine: {=bool:?}, rxoute: {=bool:?}, underfe: {=bool:?}, hbisoinerre: {=bool:?}, hbisoflushe: {=bool:?}, overfe: {=bool:?}, crcerre: {=bool:?}, shortpackete: {=bool:?}, mdatae: {=bool:?}, dataxe: {=bool:?}, errortranse: {=bool:?}, nbusybke: {=bool:?}, killbk: {=bool:?}, fifocon: {=bool:?}, epdishdma: {=bool:?}, rstdt: {=bool:?} }}",
self.txine(),
self.rxoute(),
self.underfe(),
self.hbisoinerre(),
self.hbisoflushe(),
self.overfe(),
self.crcerre(),
self.shortpackete(),
self.mdatae(),
self.dataxe(),
self.errortranse(),
self.nbusybke(),
self.killbk(),
self.fifocon(),
self.epdishdma(),
self.rstdt()
)
}
}
#[doc = "Device Endpoint Status Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptisr(pub u32);
impl Deveptisr {
#[doc = "Transmitted IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txini(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt"]
#[inline(always)]
pub const fn set_txini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxouti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt"]
#[inline(always)]
pub const fn set_rxouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Received SETUP Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxstpi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Received SETUP Interrupt"]
#[inline(always)]
pub const fn set_rxstpi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed OUT Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakouti(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "NAKed OUT Interrupt"]
#[inline(always)]
pub const fn set_nakouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed IN Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakini(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed IN Interrupt"]
#[inline(always)]
pub const fn set_nakini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "STALLed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn stalledi(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "STALLed Interrupt"]
#[inline(always)]
pub const fn set_stalledi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpacket(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpacket(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Data Toggle Sequence"]
#[must_use]
#[inline(always)]
pub const fn dtseq(&self) -> super::vals::DeveptisrDtseq {
let val = (self.0 >> 8usize) & 0x03;
super::vals::DeveptisrDtseq::from_bits(val as u8)
}
#[doc = "Data Toggle Sequence"]
#[inline(always)]
pub const fn set_dtseq(&mut self, val: super::vals::DeveptisrDtseq) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Number of Busy Banks"]
#[must_use]
#[inline(always)]
pub const fn nbusybk(&self) -> super::vals::DeveptisrNbusybk {
let val = (self.0 >> 12usize) & 0x03;
super::vals::DeveptisrNbusybk::from_bits(val as u8)
}
#[doc = "Number of Busy Banks"]
#[inline(always)]
pub const fn set_nbusybk(&mut self, val: super::vals::DeveptisrNbusybk) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Current Bank"]
#[must_use]
#[inline(always)]
pub const fn currbk(&self) -> super::vals::DeveptisrCurrbk {
let val = (self.0 >> 14usize) & 0x03;
super::vals::DeveptisrCurrbk::from_bits(val as u8)
}
#[doc = "Current Bank"]
#[inline(always)]
pub const fn set_currbk(&mut self, val: super::vals::DeveptisrCurrbk) {
self.0 = (self.0 & !(0x03 << 14usize)) | (((val.to_bits() as u32) & 0x03) << 14usize);
}
#[doc = "Read-write Allowed"]
#[must_use]
#[inline(always)]
pub const fn rwall(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Read-write Allowed"]
#[inline(always)]
pub const fn set_rwall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Control Direction"]
#[must_use]
#[inline(always)]
pub const fn ctrldir(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Control Direction"]
#[inline(always)]
pub const fn set_ctrldir(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Configuration OK Status"]
#[must_use]
#[inline(always)]
pub const fn cfgok(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Configuration OK Status"]
#[inline(always)]
pub const fn set_cfgok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Byte Count"]
#[must_use]
#[inline(always)]
pub const fn byct(&self) -> u16 {
let val = (self.0 >> 20usize) & 0x07ff;
val as u16
}
#[doc = "Byte Count"]
#[inline(always)]
pub const fn set_byct(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 20usize)) | (((val as u32) & 0x07ff) << 20usize);
}
}
impl Default for Deveptisr {
#[inline(always)]
fn default() -> Deveptisr {
Deveptisr(0)
}
}
impl core::fmt::Debug for Deveptisr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptisr")
.field("txini", &self.txini())
.field("rxouti", &self.rxouti())
.field("rxstpi", &self.rxstpi())
.field("nakouti", &self.nakouti())
.field("nakini", &self.nakini())
.field("overfi", &self.overfi())
.field("stalledi", &self.stalledi())
.field("shortpacket", &self.shortpacket())
.field("dtseq", &self.dtseq())
.field("nbusybk", &self.nbusybk())
.field("currbk", &self.currbk())
.field("rwall", &self.rwall())
.field("ctrldir", &self.ctrldir())
.field("cfgok", &self.cfgok())
.field("byct", &self.byct())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptisr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptisr {{ txini: {=bool:?}, rxouti: {=bool:?}, rxstpi: {=bool:?}, nakouti: {=bool:?}, nakini: {=bool:?}, overfi: {=bool:?}, stalledi: {=bool:?}, shortpacket: {=bool:?}, dtseq: {:?}, nbusybk: {:?}, currbk: {:?}, rwall: {=bool:?}, ctrldir: {=bool:?}, cfgok: {=bool:?}, byct: {=u16:?} }}",
self.txini(),
self.rxouti(),
self.rxstpi(),
self.nakouti(),
self.nakini(),
self.overfi(),
self.stalledi(),
self.shortpacket(),
self.dtseq(),
self.nbusybk(),
self.currbk(),
self.rwall(),
self.ctrldir(),
self.cfgok(),
self.byct()
)
}
}
#[doc = "Device Endpoint Status Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Deveptisr0Isoenpt(pub u32);
impl Deveptisr0Isoenpt {
#[doc = "Transmitted IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txini(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Transmitted IN Data Interrupt"]
#[inline(always)]
pub const fn set_txini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Received OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxouti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Received OUT Data Interrupt"]
#[inline(always)]
pub const fn set_rxouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn underfi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt"]
#[inline(always)]
pub const fn set_underfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "High Bandwidth Isochronous IN Underflow Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hbisoinerri(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Underflow Error Interrupt"]
#[inline(always)]
pub const fn set_hbisoinerri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hbisoflushi(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "High Bandwidth Isochronous IN Flush Interrupt"]
#[inline(always)]
pub const fn set_hbisoflushi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn crcerri(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt"]
#[inline(always)]
pub const fn set_crcerri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpacket(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpacket(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Data Toggle Sequence"]
#[must_use]
#[inline(always)]
pub const fn dtseq(&self) -> super::vals::Deveptisr0IsoenptDtseq {
let val = (self.0 >> 8usize) & 0x03;
super::vals::Deveptisr0IsoenptDtseq::from_bits(val as u8)
}
#[doc = "Data Toggle Sequence"]
#[inline(always)]
pub const fn set_dtseq(&mut self, val: super::vals::Deveptisr0IsoenptDtseq) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn errortrans(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt"]
#[inline(always)]
pub const fn set_errortrans(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Number of Busy Banks"]
#[must_use]
#[inline(always)]
pub const fn nbusybk(&self) -> super::vals::Deveptisr0IsoenptNbusybk {
let val = (self.0 >> 12usize) & 0x03;
super::vals::Deveptisr0IsoenptNbusybk::from_bits(val as u8)
}
#[doc = "Number of Busy Banks"]
#[inline(always)]
pub const fn set_nbusybk(&mut self, val: super::vals::Deveptisr0IsoenptNbusybk) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Current Bank"]
#[must_use]
#[inline(always)]
pub const fn currbk(&self) -> super::vals::Deveptisr0IsoenptCurrbk {
let val = (self.0 >> 14usize) & 0x03;
super::vals::Deveptisr0IsoenptCurrbk::from_bits(val as u8)
}
#[doc = "Current Bank"]
#[inline(always)]
pub const fn set_currbk(&mut self, val: super::vals::Deveptisr0IsoenptCurrbk) {
self.0 = (self.0 & !(0x03 << 14usize)) | (((val.to_bits() as u32) & 0x03) << 14usize);
}
#[doc = "Read-write Allowed"]
#[must_use]
#[inline(always)]
pub const fn rwall(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Read-write Allowed"]
#[inline(always)]
pub const fn set_rwall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Configuration OK Status"]
#[must_use]
#[inline(always)]
pub const fn cfgok(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Configuration OK Status"]
#[inline(always)]
pub const fn set_cfgok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Byte Count"]
#[must_use]
#[inline(always)]
pub const fn byct(&self) -> u16 {
let val = (self.0 >> 20usize) & 0x07ff;
val as u16
}
#[doc = "Byte Count"]
#[inline(always)]
pub const fn set_byct(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 20usize)) | (((val as u32) & 0x07ff) << 20usize);
}
}
impl Default for Deveptisr0Isoenpt {
#[inline(always)]
fn default() -> Deveptisr0Isoenpt {
Deveptisr0Isoenpt(0)
}
}
impl core::fmt::Debug for Deveptisr0Isoenpt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Deveptisr0Isoenpt")
.field("txini", &self.txini())
.field("rxouti", &self.rxouti())
.field("underfi", &self.underfi())
.field("hbisoinerri", &self.hbisoinerri())
.field("hbisoflushi", &self.hbisoflushi())
.field("overfi", &self.overfi())
.field("crcerri", &self.crcerri())
.field("shortpacket", &self.shortpacket())
.field("dtseq", &self.dtseq())
.field("errortrans", &self.errortrans())
.field("nbusybk", &self.nbusybk())
.field("currbk", &self.currbk())
.field("rwall", &self.rwall())
.field("cfgok", &self.cfgok())
.field("byct", &self.byct())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Deveptisr0Isoenpt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Deveptisr0Isoenpt {{ txini: {=bool:?}, rxouti: {=bool:?}, underfi: {=bool:?}, hbisoinerri: {=bool:?}, hbisoflushi: {=bool:?}, overfi: {=bool:?}, crcerri: {=bool:?}, shortpacket: {=bool:?}, dtseq: {:?}, errortrans: {=bool:?}, nbusybk: {:?}, currbk: {:?}, rwall: {=bool:?}, cfgok: {=bool:?}, byct: {=u16:?} }}",
self.txini(),
self.rxouti(),
self.underfi(),
self.hbisoinerri(),
self.hbisoflushi(),
self.overfi(),
self.crcerri(),
self.shortpacket(),
self.dtseq(),
self.errortrans(),
self.nbusybk(),
self.currbk(),
self.rwall(),
self.cfgok(),
self.byct()
)
}
}
#[doc = "Device Frame Number Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devfnum(pub u32);
impl Devfnum {
#[doc = "Micro Frame Number"]
#[must_use]
#[inline(always)]
pub const fn mfnum(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Micro Frame Number"]
#[inline(always)]
pub const fn set_mfnum(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Frame Number"]
#[must_use]
#[inline(always)]
pub const fn fnum(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x07ff;
val as u16
}
#[doc = "Frame Number"]
#[inline(always)]
pub const fn set_fnum(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 3usize)) | (((val as u32) & 0x07ff) << 3usize);
}
#[doc = "Frame Number CRC Error"]
#[must_use]
#[inline(always)]
pub const fn fncerr(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Frame Number CRC Error"]
#[inline(always)]
pub const fn set_fncerr(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
}
impl Default for Devfnum {
#[inline(always)]
fn default() -> Devfnum {
Devfnum(0)
}
}
impl core::fmt::Debug for Devfnum {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devfnum")
.field("mfnum", &self.mfnum())
.field("fnum", &self.fnum())
.field("fncerr", &self.fncerr())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devfnum {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devfnum {{ mfnum: {=u8:?}, fnum: {=u16:?}, fncerr: {=bool:?} }}",
self.mfnum(),
self.fnum(),
self.fncerr()
)
}
}
#[doc = "Device Global Interrupt Clear Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devicr(pub u32);
impl Devicr {
#[doc = "Suspend Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn suspc(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt Clear"]
#[inline(always)]
pub const fn set_suspc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn msofc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt Clear"]
#[inline(always)]
pub const fn set_msofc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn sofc(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt Clear"]
#[inline(always)]
pub const fn set_sofc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn eorstc(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt Clear"]
#[inline(always)]
pub const fn set_eorstc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn wakeupc(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt Clear"]
#[inline(always)]
pub const fn set_wakeupc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn eorsmc(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt Clear"]
#[inline(always)]
pub const fn set_eorsmc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn uprsmc(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt Clear"]
#[inline(always)]
pub const fn set_uprsmc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Devicr {
#[inline(always)]
fn default() -> Devicr {
Devicr(0)
}
}
impl core::fmt::Debug for Devicr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devicr")
.field("suspc", &self.suspc())
.field("msofc", &self.msofc())
.field("sofc", &self.sofc())
.field("eorstc", &self.eorstc())
.field("wakeupc", &self.wakeupc())
.field("eorsmc", &self.eorsmc())
.field("uprsmc", &self.uprsmc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devicr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devicr {{ suspc: {=bool:?}, msofc: {=bool:?}, sofc: {=bool:?}, eorstc: {=bool:?}, wakeupc: {=bool:?}, eorsmc: {=bool:?}, uprsmc: {=bool:?} }}",
self.suspc(),
self.msofc(),
self.sofc(),
self.eorstc(),
self.wakeupc(),
self.eorsmc(),
self.uprsmc()
)
}
}
#[doc = "Device Global Interrupt Disable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devidr(pub u32);
impl Devidr {
#[doc = "Suspend Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn suspec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt Disable"]
#[inline(always)]
pub const fn set_suspec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn msofec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt Disable"]
#[inline(always)]
pub const fn set_msofec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn sofec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt Disable"]
#[inline(always)]
pub const fn set_sofec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn eorstec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt Disable"]
#[inline(always)]
pub const fn set_eorstec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn wakeupec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt Disable"]
#[inline(always)]
pub const fn set_wakeupec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn eorsmec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt Disable"]
#[inline(always)]
pub const fn set_eorsmec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn uprsmec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt Disable"]
#[inline(always)]
pub const fn set_uprsmec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Endpoint 0 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Endpoint 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Endpoint 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Endpoint 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Endpoint 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Endpoint 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Endpoint 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Endpoint 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Endpoint 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Endpoint 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Endpoint 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Endpoint 7 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Endpoint 7 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Endpoint 8 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Endpoint 8 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Endpoint 9 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Endpoint 9 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "DMA Channel 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Devidr {
#[inline(always)]
fn default() -> Devidr {
Devidr(0)
}
}
impl core::fmt::Debug for Devidr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devidr")
.field("suspec", &self.suspec())
.field("msofec", &self.msofec())
.field("sofec", &self.sofec())
.field("eorstec", &self.eorstec())
.field("wakeupec", &self.wakeupec())
.field("eorsmec", &self.eorsmec())
.field("uprsmec", &self.uprsmec())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devidr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devidr {{ suspec: {=bool:?}, msofec: {=bool:?}, sofec: {=bool:?}, eorstec: {=bool:?}, wakeupec: {=bool:?}, eorsmec: {=bool:?}, uprsmec: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.suspec(),
self.msofec(),
self.sofec(),
self.eorstec(),
self.wakeupec(),
self.eorsmec(),
self.uprsmec(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Device Global Interrupt Enable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devier(pub u32);
impl Devier {
#[doc = "Suspend Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn suspes(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt Enable"]
#[inline(always)]
pub const fn set_suspes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn msofes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt Enable"]
#[inline(always)]
pub const fn set_msofes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn sofes(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt Enable"]
#[inline(always)]
pub const fn set_sofes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn eorstes(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt Enable"]
#[inline(always)]
pub const fn set_eorstes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn wakeupes(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt Enable"]
#[inline(always)]
pub const fn set_wakeupes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn eorsmes(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt Enable"]
#[inline(always)]
pub const fn set_eorsmes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn uprsmes(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt Enable"]
#[inline(always)]
pub const fn set_uprsmes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Endpoint 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Endpoint 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Endpoint 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Endpoint 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Endpoint 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Endpoint 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Endpoint 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Endpoint 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Endpoint 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Endpoint 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Endpoint 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Endpoint 7 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Endpoint 7 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Endpoint 8 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Endpoint 8 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Endpoint 9 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Endpoint 9 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Devier {
#[inline(always)]
fn default() -> Devier {
Devier(0)
}
}
impl core::fmt::Debug for Devier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devier")
.field("suspes", &self.suspes())
.field("msofes", &self.msofes())
.field("sofes", &self.sofes())
.field("eorstes", &self.eorstes())
.field("wakeupes", &self.wakeupes())
.field("eorsmes", &self.eorsmes())
.field("uprsmes", &self.uprsmes())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devier {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devier {{ suspes: {=bool:?}, msofes: {=bool:?}, sofes: {=bool:?}, eorstes: {=bool:?}, wakeupes: {=bool:?}, eorsmes: {=bool:?}, uprsmes: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.suspes(),
self.msofes(),
self.sofes(),
self.eorstes(),
self.wakeupes(),
self.eorsmes(),
self.uprsmes(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Device Global Interrupt Set Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devifr(pub u32);
impl Devifr {
#[doc = "Suspend Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn susps(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt Set"]
#[inline(always)]
pub const fn set_susps(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn msofs(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt Set"]
#[inline(always)]
pub const fn set_msofs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn sofs(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt Set"]
#[inline(always)]
pub const fn set_sofs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn eorsts(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt Set"]
#[inline(always)]
pub const fn set_eorsts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn wakeups(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt Set"]
#[inline(always)]
pub const fn set_wakeups(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn eorsms(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt Set"]
#[inline(always)]
pub const fn set_eorsms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn uprsms(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt Set"]
#[inline(always)]
pub const fn set_uprsms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "DMA Channel 1 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Devifr {
#[inline(always)]
fn default() -> Devifr {
Devifr(0)
}
}
impl core::fmt::Debug for Devifr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devifr")
.field("susps", &self.susps())
.field("msofs", &self.msofs())
.field("sofs", &self.sofs())
.field("eorsts", &self.eorsts())
.field("wakeups", &self.wakeups())
.field("eorsms", &self.eorsms())
.field("uprsms", &self.uprsms())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devifr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devifr {{ susps: {=bool:?}, msofs: {=bool:?}, sofs: {=bool:?}, eorsts: {=bool:?}, wakeups: {=bool:?}, eorsms: {=bool:?}, uprsms: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.susps(),
self.msofs(),
self.sofs(),
self.eorsts(),
self.wakeups(),
self.eorsms(),
self.uprsms(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Device Global Interrupt Mask Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devimr(pub u32);
impl Devimr {
#[doc = "Suspend Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn suspe(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt Mask"]
#[inline(always)]
pub const fn set_suspe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn msofe(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt Mask"]
#[inline(always)]
pub const fn set_msofe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn sofe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt Mask"]
#[inline(always)]
pub const fn set_sofe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn eorste(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt Mask"]
#[inline(always)]
pub const fn set_eorste(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn wakeupe(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt Mask"]
#[inline(always)]
pub const fn set_wakeupe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn eorsme(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt Mask"]
#[inline(always)]
pub const fn set_eorsme(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn uprsme(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt Mask"]
#[inline(always)]
pub const fn set_uprsme(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Endpoint 0 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Endpoint 1 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Endpoint 1 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Endpoint 2 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Endpoint 2 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint 3 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Endpoint 3 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Endpoint 4 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint 4 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Endpoint 5 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Endpoint 5 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Endpoint 6 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Endpoint 6 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Endpoint 7 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Endpoint 7 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Endpoint 8 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Endpoint 8 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Endpoint 9 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Endpoint 9 Interrupt Mask"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "DMA Channel 1 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Mask"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Devimr {
#[inline(always)]
fn default() -> Devimr {
Devimr(0)
}
}
impl core::fmt::Debug for Devimr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devimr")
.field("suspe", &self.suspe())
.field("msofe", &self.msofe())
.field("sofe", &self.sofe())
.field("eorste", &self.eorste())
.field("wakeupe", &self.wakeupe())
.field("eorsme", &self.eorsme())
.field("uprsme", &self.uprsme())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devimr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devimr {{ suspe: {=bool:?}, msofe: {=bool:?}, sofe: {=bool:?}, eorste: {=bool:?}, wakeupe: {=bool:?}, eorsme: {=bool:?}, uprsme: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.suspe(),
self.msofe(),
self.sofe(),
self.eorste(),
self.wakeupe(),
self.eorsme(),
self.uprsme(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Device Global Interrupt Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Devisr(pub u32);
impl Devisr {
#[doc = "Suspend Interrupt"]
#[must_use]
#[inline(always)]
pub const fn susp(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Suspend Interrupt"]
#[inline(always)]
pub const fn set_susp(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Micro Start of Frame Interrupt"]
#[must_use]
#[inline(always)]
pub const fn msof(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Micro Start of Frame Interrupt"]
#[inline(always)]
pub const fn set_msof(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Start of Frame Interrupt"]
#[must_use]
#[inline(always)]
pub const fn sof(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Interrupt"]
#[inline(always)]
pub const fn set_sof(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Reset Interrupt"]
#[must_use]
#[inline(always)]
pub const fn eorst(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Reset Interrupt"]
#[inline(always)]
pub const fn set_eorst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Wake-Up Interrupt"]
#[must_use]
#[inline(always)]
pub const fn wakeup(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Wake-Up Interrupt"]
#[inline(always)]
pub const fn set_wakeup(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Resume Interrupt"]
#[must_use]
#[inline(always)]
pub const fn eorsm(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Resume Interrupt"]
#[inline(always)]
pub const fn set_eorsm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Upstream Resume Interrupt"]
#[must_use]
#[inline(always)]
pub const fn uprsm(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Interrupt"]
#[inline(always)]
pub const fn set_uprsm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Endpoint 0 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Endpoint 0 Interrupt"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Endpoint 1 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Endpoint 1 Interrupt"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Endpoint 2 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Endpoint 2 Interrupt"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Endpoint 3 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Endpoint 3 Interrupt"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Endpoint 4 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Endpoint 4 Interrupt"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Endpoint 5 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Endpoint 5 Interrupt"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Endpoint 6 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Endpoint 6 Interrupt"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Endpoint 7 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Endpoint 7 Interrupt"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Endpoint 8 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Endpoint 8 Interrupt"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Endpoint 9 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Endpoint 9 Interrupt"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "DMA Channel 1 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Devisr {
#[inline(always)]
fn default() -> Devisr {
Devisr(0)
}
}
impl core::fmt::Debug for Devisr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Devisr")
.field("susp", &self.susp())
.field("msof", &self.msof())
.field("sof", &self.sof())
.field("eorst", &self.eorst())
.field("wakeup", &self.wakeup())
.field("eorsm", &self.eorsm())
.field("uprsm", &self.uprsm())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Devisr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Devisr {{ susp: {=bool:?}, msof: {=bool:?}, sof: {=bool:?}, eorst: {=bool:?}, wakeup: {=bool:?}, eorsm: {=bool:?}, uprsm: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.susp(),
self.msof(),
self.sof(),
self.eorst(),
self.wakeup(),
self.eorsm(),
self.uprsm(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "General Finite State Machine Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fsm(pub u32);
impl Fsm {
#[doc = "Dual Role Device State"]
#[must_use]
#[inline(always)]
pub const fn drdstate(&self) -> super::vals::Drdstate {
let val = (self.0 >> 0usize) & 0x0f;
super::vals::Drdstate::from_bits(val as u8)
}
#[doc = "Dual Role Device State"]
#[inline(always)]
pub const fn set_drdstate(&mut self, val: super::vals::Drdstate) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val.to_bits() as u32) & 0x0f) << 0usize);
}
}
impl Default for Fsm {
#[inline(always)]
fn default() -> Fsm {
Fsm(0)
}
}
impl core::fmt::Debug for Fsm {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fsm")
.field("drdstate", &self.drdstate())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fsm {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Fsm {{ drdstate: {:?} }}", self.drdstate())
}
}
#[doc = "Host Address 1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstaddr1(pub u32);
impl Hstaddr1 {
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp0(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp0(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp1(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp1(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp2(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp2(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp3(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp3(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Hstaddr1 {
#[inline(always)]
fn default() -> Hstaddr1 {
Hstaddr1(0)
}
}
impl core::fmt::Debug for Hstaddr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstaddr1")
.field("hstaddrp0", &self.hstaddrp0())
.field("hstaddrp1", &self.hstaddrp1())
.field("hstaddrp2", &self.hstaddrp2())
.field("hstaddrp3", &self.hstaddrp3())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstaddr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstaddr1 {{ hstaddrp0: {=u8:?}, hstaddrp1: {=u8:?}, hstaddrp2: {=u8:?}, hstaddrp3: {=u8:?} }}",
self.hstaddrp0(),
self.hstaddrp1(),
self.hstaddrp2(),
self.hstaddrp3()
)
}
}
#[doc = "Host Address 2 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstaddr2(pub u32);
impl Hstaddr2 {
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp4(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp4(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp5(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp5(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp6(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp6(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp7(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp7(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Hstaddr2 {
#[inline(always)]
fn default() -> Hstaddr2 {
Hstaddr2(0)
}
}
impl core::fmt::Debug for Hstaddr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstaddr2")
.field("hstaddrp4", &self.hstaddrp4())
.field("hstaddrp5", &self.hstaddrp5())
.field("hstaddrp6", &self.hstaddrp6())
.field("hstaddrp7", &self.hstaddrp7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstaddr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstaddr2 {{ hstaddrp4: {=u8:?}, hstaddrp5: {=u8:?}, hstaddrp6: {=u8:?}, hstaddrp7: {=u8:?} }}",
self.hstaddrp4(),
self.hstaddrp5(),
self.hstaddrp6(),
self.hstaddrp7()
)
}
}
#[doc = "Host Address 3 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstaddr3(pub u32);
impl Hstaddr3 {
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp8(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp8(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "USB Host Address"]
#[must_use]
#[inline(always)]
pub const fn hstaddrp9(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "USB Host Address"]
#[inline(always)]
pub const fn set_hstaddrp9(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
}
impl Default for Hstaddr3 {
#[inline(always)]
fn default() -> Hstaddr3 {
Hstaddr3(0)
}
}
impl core::fmt::Debug for Hstaddr3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstaddr3")
.field("hstaddrp8", &self.hstaddrp8())
.field("hstaddrp9", &self.hstaddrp9())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstaddr3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstaddr3 {{ hstaddrp8: {=u8:?}, hstaddrp9: {=u8:?} }}",
self.hstaddrp8(),
self.hstaddrp9()
)
}
}
#[doc = "Host General Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstctrl(pub u32);
impl Hstctrl {
#[doc = "Start of Frame Generation Enable"]
#[must_use]
#[inline(always)]
pub const fn sofe(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Start of Frame Generation Enable"]
#[inline(always)]
pub const fn set_sofe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Send USB Reset"]
#[must_use]
#[inline(always)]
pub const fn reset(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Send USB Reset"]
#[inline(always)]
pub const fn set_reset(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Send USB Resume"]
#[must_use]
#[inline(always)]
pub const fn resume(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Send USB Resume"]
#[inline(always)]
pub const fn set_resume(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Mode Configuration"]
#[must_use]
#[inline(always)]
pub const fn spdconf(&self) -> super::vals::HstctrlSpdconf {
let val = (self.0 >> 12usize) & 0x03;
super::vals::HstctrlSpdconf::from_bits(val as u8)
}
#[doc = "Mode Configuration"]
#[inline(always)]
pub const fn set_spdconf(&mut self, val: super::vals::HstctrlSpdconf) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
}
impl Default for Hstctrl {
#[inline(always)]
fn default() -> Hstctrl {
Hstctrl(0)
}
}
impl core::fmt::Debug for Hstctrl {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstctrl")
.field("sofe", &self.sofe())
.field("reset", &self.reset())
.field("resume", &self.resume())
.field("spdconf", &self.spdconf())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstctrl {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstctrl {{ sofe: {=bool:?}, reset: {=bool:?}, resume: {=bool:?}, spdconf: {:?} }}",
self.sofe(),
self.reset(),
self.resume(),
self.spdconf()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress1(pub u32);
impl Hstdmaaddress1 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress1 {
#[inline(always)]
fn default() -> Hstdmaaddress1 {
Hstdmaaddress1(0)
}
}
impl core::fmt::Debug for Hstdmaaddress1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress1")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress1 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress2(pub u32);
impl Hstdmaaddress2 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress2 {
#[inline(always)]
fn default() -> Hstdmaaddress2 {
Hstdmaaddress2(0)
}
}
impl core::fmt::Debug for Hstdmaaddress2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress2")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress2 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress3(pub u32);
impl Hstdmaaddress3 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress3 {
#[inline(always)]
fn default() -> Hstdmaaddress3 {
Hstdmaaddress3(0)
}
}
impl core::fmt::Debug for Hstdmaaddress3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress3")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress3 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress4(pub u32);
impl Hstdmaaddress4 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress4 {
#[inline(always)]
fn default() -> Hstdmaaddress4 {
Hstdmaaddress4(0)
}
}
impl core::fmt::Debug for Hstdmaaddress4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress4")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress4 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress5(pub u32);
impl Hstdmaaddress5 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress5 {
#[inline(always)]
fn default() -> Hstdmaaddress5 {
Hstdmaaddress5(0)
}
}
impl core::fmt::Debug for Hstdmaaddress5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress5")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress5 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress6(pub u32);
impl Hstdmaaddress6 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress6 {
#[inline(always)]
fn default() -> Hstdmaaddress6 {
Hstdmaaddress6(0)
}
}
impl core::fmt::Debug for Hstdmaaddress6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress6")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress6 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Address Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmaaddress7(pub u32);
impl Hstdmaaddress7 {
#[doc = "Buffer Address"]
#[must_use]
#[inline(always)]
pub const fn buff_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Buffer Address"]
#[inline(always)]
pub const fn set_buff_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmaaddress7 {
#[inline(always)]
fn default() -> Hstdmaaddress7 {
Hstdmaaddress7(0)
}
}
impl core::fmt::Debug for Hstdmaaddress7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmaaddress7")
.field("buff_add", &self.buff_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmaaddress7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmaaddress7 {{ buff_add: {=u32:?} }}",
self.buff_add()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol1(pub u32);
impl Hstdmacontrol1 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol1 {
#[inline(always)]
fn default() -> Hstdmacontrol1 {
Hstdmacontrol1(0)
}
}
impl core::fmt::Debug for Hstdmacontrol1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol1")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol1 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol2(pub u32);
impl Hstdmacontrol2 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol2 {
#[inline(always)]
fn default() -> Hstdmacontrol2 {
Hstdmacontrol2(0)
}
}
impl core::fmt::Debug for Hstdmacontrol2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol2")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol2 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol3(pub u32);
impl Hstdmacontrol3 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol3 {
#[inline(always)]
fn default() -> Hstdmacontrol3 {
Hstdmacontrol3(0)
}
}
impl core::fmt::Debug for Hstdmacontrol3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol3")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol3 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol4(pub u32);
impl Hstdmacontrol4 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol4 {
#[inline(always)]
fn default() -> Hstdmacontrol4 {
Hstdmacontrol4(0)
}
}
impl core::fmt::Debug for Hstdmacontrol4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol4")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol4 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol5(pub u32);
impl Hstdmacontrol5 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol5 {
#[inline(always)]
fn default() -> Hstdmacontrol5 {
Hstdmacontrol5(0)
}
}
impl core::fmt::Debug for Hstdmacontrol5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol5")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol5 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol6(pub u32);
impl Hstdmacontrol6 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol6 {
#[inline(always)]
fn default() -> Hstdmacontrol6 {
Hstdmacontrol6(0)
}
}
impl core::fmt::Debug for Hstdmacontrol6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol6")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol6 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Control Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmacontrol7(pub u32);
impl Hstdmacontrol7 {
#[doc = "Channel Enable Command"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Command"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[must_use]
#[inline(always)]
pub const fn ldnxt_dsc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Load Next Channel Transfer Descriptor Enable Command"]
#[inline(always)]
pub const fn set_ldnxt_dsc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Transfer Enable (Control)"]
#[must_use]
#[inline(always)]
pub const fn end_tr_en(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Enable (Control)"]
#[inline(always)]
pub const fn set_end_tr_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "End of Buffer Enable Control"]
#[must_use]
#[inline(always)]
pub const fn end_b_en(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Enable Control"]
#[inline(always)]
pub const fn set_end_b_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "End of Transfer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_tr_it(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Transfer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_tr_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn end_buffit(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_end_buffit(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn desc_ld_it(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Interrupt Enable"]
#[inline(always)]
pub const fn set_desc_ld_it(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Burst Lock Enable"]
#[must_use]
#[inline(always)]
pub const fn burst_lck(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Burst Lock Enable"]
#[inline(always)]
pub const fn set_burst_lck(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Buffer Byte Length (Write-only)"]
#[must_use]
#[inline(always)]
pub const fn buff_length(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Length (Write-only)"]
#[inline(always)]
pub const fn set_buff_length(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmacontrol7 {
#[inline(always)]
fn default() -> Hstdmacontrol7 {
Hstdmacontrol7(0)
}
}
impl core::fmt::Debug for Hstdmacontrol7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmacontrol7")
.field("chann_enb", &self.chann_enb())
.field("ldnxt_dsc", &self.ldnxt_dsc())
.field("end_tr_en", &self.end_tr_en())
.field("end_b_en", &self.end_b_en())
.field("end_tr_it", &self.end_tr_it())
.field("end_buffit", &self.end_buffit())
.field("desc_ld_it", &self.desc_ld_it())
.field("burst_lck", &self.burst_lck())
.field("buff_length", &self.buff_length())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmacontrol7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmacontrol7 {{ chann_enb: {=bool:?}, ldnxt_dsc: {=bool:?}, end_tr_en: {=bool:?}, end_b_en: {=bool:?}, end_tr_it: {=bool:?}, end_buffit: {=bool:?}, desc_ld_it: {=bool:?}, burst_lck: {=bool:?}, buff_length: {=u16:?} }}",
self.chann_enb(),
self.ldnxt_dsc(),
self.end_tr_en(),
self.end_b_en(),
self.end_tr_it(),
self.end_buffit(),
self.desc_ld_it(),
self.burst_lck(),
self.buff_length()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc1(pub u32);
impl Hstdmanxtdsc1 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc1 {
#[inline(always)]
fn default() -> Hstdmanxtdsc1 {
Hstdmanxtdsc1(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc1")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc1 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc2(pub u32);
impl Hstdmanxtdsc2 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc2 {
#[inline(always)]
fn default() -> Hstdmanxtdsc2 {
Hstdmanxtdsc2(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc2")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc2 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc3(pub u32);
impl Hstdmanxtdsc3 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc3 {
#[inline(always)]
fn default() -> Hstdmanxtdsc3 {
Hstdmanxtdsc3(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc3")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc3 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc4(pub u32);
impl Hstdmanxtdsc4 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc4 {
#[inline(always)]
fn default() -> Hstdmanxtdsc4 {
Hstdmanxtdsc4(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc4")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc4 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc5(pub u32);
impl Hstdmanxtdsc5 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc5 {
#[inline(always)]
fn default() -> Hstdmanxtdsc5 {
Hstdmanxtdsc5(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc5")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc5 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc6(pub u32);
impl Hstdmanxtdsc6 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc6 {
#[inline(always)]
fn default() -> Hstdmanxtdsc6 {
Hstdmanxtdsc6(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc6")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc6 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Next Descriptor Address Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmanxtdsc7(pub u32);
impl Hstdmanxtdsc7 {
#[doc = "Next Descriptor Address"]
#[must_use]
#[inline(always)]
pub const fn nxt_dsc_add(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Next Descriptor Address"]
#[inline(always)]
pub const fn set_nxt_dsc_add(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Hstdmanxtdsc7 {
#[inline(always)]
fn default() -> Hstdmanxtdsc7 {
Hstdmanxtdsc7(0)
}
}
impl core::fmt::Debug for Hstdmanxtdsc7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmanxtdsc7")
.field("nxt_dsc_add", &self.nxt_dsc_add())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmanxtdsc7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmanxtdsc7 {{ nxt_dsc_add: {=u32:?} }}",
self.nxt_dsc_add()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus1(pub u32);
impl Hstdmastatus1 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus1 {
#[inline(always)]
fn default() -> Hstdmastatus1 {
Hstdmastatus1(0)
}
}
impl core::fmt::Debug for Hstdmastatus1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus1")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus1 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus2(pub u32);
impl Hstdmastatus2 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus2 {
#[inline(always)]
fn default() -> Hstdmastatus2 {
Hstdmastatus2(0)
}
}
impl core::fmt::Debug for Hstdmastatus2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus2")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus2 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus3(pub u32);
impl Hstdmastatus3 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus3 {
#[inline(always)]
fn default() -> Hstdmastatus3 {
Hstdmastatus3(0)
}
}
impl core::fmt::Debug for Hstdmastatus3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus3")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus3 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus4(pub u32);
impl Hstdmastatus4 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus4 {
#[inline(always)]
fn default() -> Hstdmastatus4 {
Hstdmastatus4(0)
}
}
impl core::fmt::Debug for Hstdmastatus4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus4")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus4 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus5(pub u32);
impl Hstdmastatus5 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus5 {
#[inline(always)]
fn default() -> Hstdmastatus5 {
Hstdmastatus5(0)
}
}
impl core::fmt::Debug for Hstdmastatus5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus5")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus5 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus6(pub u32);
impl Hstdmastatus6 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus6 {
#[inline(always)]
fn default() -> Hstdmastatus6 {
Hstdmastatus6(0)
}
}
impl core::fmt::Debug for Hstdmastatus6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus6")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus6 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host DMA Channel Status Register (n = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstdmastatus7(pub u32);
impl Hstdmastatus7 {
#[doc = "Channel Enable Status"]
#[must_use]
#[inline(always)]
pub const fn chann_enb(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel Enable Status"]
#[inline(always)]
pub const fn set_chann_enb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel Active Status"]
#[must_use]
#[inline(always)]
pub const fn chann_act(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel Active Status"]
#[inline(always)]
pub const fn set_chann_act(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "End of Channel Transfer Status"]
#[must_use]
#[inline(always)]
pub const fn end_tr_st(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "End of Channel Transfer Status"]
#[inline(always)]
pub const fn set_end_tr_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "End of Channel Buffer Status"]
#[must_use]
#[inline(always)]
pub const fn end_bf_st(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "End of Channel Buffer Status"]
#[inline(always)]
pub const fn set_end_bf_st(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Descriptor Loaded Status"]
#[must_use]
#[inline(always)]
pub const fn desc_ldst(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Descriptor Loaded Status"]
#[inline(always)]
pub const fn set_desc_ldst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Buffer Byte Count"]
#[must_use]
#[inline(always)]
pub const fn buff_count(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Buffer Byte Count"]
#[inline(always)]
pub const fn set_buff_count(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Hstdmastatus7 {
#[inline(always)]
fn default() -> Hstdmastatus7 {
Hstdmastatus7(0)
}
}
impl core::fmt::Debug for Hstdmastatus7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstdmastatus7")
.field("chann_enb", &self.chann_enb())
.field("chann_act", &self.chann_act())
.field("end_tr_st", &self.end_tr_st())
.field("end_bf_st", &self.end_bf_st())
.field("desc_ldst", &self.desc_ldst())
.field("buff_count", &self.buff_count())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstdmastatus7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstdmastatus7 {{ chann_enb: {=bool:?}, chann_act: {=bool:?}, end_tr_st: {=bool:?}, end_bf_st: {=bool:?}, desc_ldst: {=bool:?}, buff_count: {=u16:?} }}",
self.chann_enb(),
self.chann_act(),
self.end_tr_st(),
self.end_bf_st(),
self.desc_ldst(),
self.buff_count()
)
}
}
#[doc = "Host Frame Number Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstfnum(pub u32);
impl Hstfnum {
#[doc = "Micro Frame Number"]
#[must_use]
#[inline(always)]
pub const fn mfnum(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Micro Frame Number"]
#[inline(always)]
pub const fn set_mfnum(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Frame Number"]
#[must_use]
#[inline(always)]
pub const fn fnum(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x07ff;
val as u16
}
#[doc = "Frame Number"]
#[inline(always)]
pub const fn set_fnum(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 3usize)) | (((val as u32) & 0x07ff) << 3usize);
}
#[doc = "Frame Length"]
#[must_use]
#[inline(always)]
pub const fn flenhigh(&self) -> u8 {
let val = (self.0 >> 16usize) & 0xff;
val as u8
}
#[doc = "Frame Length"]
#[inline(always)]
pub const fn set_flenhigh(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
}
}
impl Default for Hstfnum {
#[inline(always)]
fn default() -> Hstfnum {
Hstfnum(0)
}
}
impl core::fmt::Debug for Hstfnum {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstfnum")
.field("mfnum", &self.mfnum())
.field("fnum", &self.fnum())
.field("flenhigh", &self.flenhigh())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstfnum {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstfnum {{ mfnum: {=u8:?}, fnum: {=u16:?}, flenhigh: {=u8:?} }}",
self.mfnum(),
self.fnum(),
self.flenhigh()
)
}
}
#[doc = "Host Global Interrupt Clear Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hsticr(pub u32);
impl Hsticr {
#[doc = "Device Connection Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn dconnic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt Clear"]
#[inline(always)]
pub const fn set_dconnic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn ddiscic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt Clear"]
#[inline(always)]
pub const fn set_ddiscic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rstic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt Clear"]
#[inline(always)]
pub const fn set_rstic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rsmedic(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt Clear"]
#[inline(always)]
pub const fn set_rsmedic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxrsmic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt Clear"]
#[inline(always)]
pub const fn set_rxrsmic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hsofic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt Clear"]
#[inline(always)]
pub const fn set_hsofic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hwupic(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt Clear"]
#[inline(always)]
pub const fn set_hwupic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Hsticr {
#[inline(always)]
fn default() -> Hsticr {
Hsticr(0)
}
}
impl core::fmt::Debug for Hsticr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hsticr")
.field("dconnic", &self.dconnic())
.field("ddiscic", &self.ddiscic())
.field("rstic", &self.rstic())
.field("rsmedic", &self.rsmedic())
.field("rxrsmic", &self.rxrsmic())
.field("hsofic", &self.hsofic())
.field("hwupic", &self.hwupic())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hsticr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hsticr {{ dconnic: {=bool:?}, ddiscic: {=bool:?}, rstic: {=bool:?}, rsmedic: {=bool:?}, rxrsmic: {=bool:?}, hsofic: {=bool:?}, hwupic: {=bool:?} }}",
self.dconnic(),
self.ddiscic(),
self.rstic(),
self.rsmedic(),
self.rxrsmic(),
self.hsofic(),
self.hwupic()
)
}
}
#[doc = "Host Global Interrupt Disable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstidr(pub u32);
impl Hstidr {
#[doc = "Device Connection Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dconniec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt Disable"]
#[inline(always)]
pub const fn set_dconniec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn ddisciec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt Disable"]
#[inline(always)]
pub const fn set_ddisciec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rstiec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt Disable"]
#[inline(always)]
pub const fn set_rstiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rsmediec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt Disable"]
#[inline(always)]
pub const fn set_rsmediec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxrsmiec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt Disable"]
#[inline(always)]
pub const fn set_rxrsmiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn hsofiec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt Disable"]
#[inline(always)]
pub const fn set_hsofiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn hwupiec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt Disable"]
#[inline(always)]
pub const fn set_hwupiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Pipe 0 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Pipe 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Pipe 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Pipe 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Pipe 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe 7 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Pipe 8 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe 9 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe 9 Interrupt Disable"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "DMA Channel 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Hstidr {
#[inline(always)]
fn default() -> Hstidr {
Hstidr(0)
}
}
impl core::fmt::Debug for Hstidr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstidr")
.field("dconniec", &self.dconniec())
.field("ddisciec", &self.ddisciec())
.field("rstiec", &self.rstiec())
.field("rsmediec", &self.rsmediec())
.field("rxrsmiec", &self.rxrsmiec())
.field("hsofiec", &self.hsofiec())
.field("hwupiec", &self.hwupiec())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstidr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstidr {{ dconniec: {=bool:?}, ddisciec: {=bool:?}, rstiec: {=bool:?}, rsmediec: {=bool:?}, rxrsmiec: {=bool:?}, hsofiec: {=bool:?}, hwupiec: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.dconniec(),
self.ddisciec(),
self.rstiec(),
self.rsmediec(),
self.rxrsmiec(),
self.hsofiec(),
self.hwupiec(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Host Global Interrupt Enable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstier(pub u32);
impl Hstier {
#[doc = "Device Connection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dconnies(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt Enable"]
#[inline(always)]
pub const fn set_dconnies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn ddiscies(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt Enable"]
#[inline(always)]
pub const fn set_ddiscies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rsties(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt Enable"]
#[inline(always)]
pub const fn set_rsties(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rsmedies(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt Enable"]
#[inline(always)]
pub const fn set_rsmedies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxrsmies(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt Enable"]
#[inline(always)]
pub const fn set_rxrsmies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hsofies(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt Enable"]
#[inline(always)]
pub const fn set_hsofies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hwupies(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt Enable"]
#[inline(always)]
pub const fn set_hwupies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Pipe 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Pipe 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Pipe 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Pipe 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Pipe 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe 7 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Pipe 8 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe 9 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe 9 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Hstier {
#[inline(always)]
fn default() -> Hstier {
Hstier(0)
}
}
impl core::fmt::Debug for Hstier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstier")
.field("dconnies", &self.dconnies())
.field("ddiscies", &self.ddiscies())
.field("rsties", &self.rsties())
.field("rsmedies", &self.rsmedies())
.field("rxrsmies", &self.rxrsmies())
.field("hsofies", &self.hsofies())
.field("hwupies", &self.hwupies())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstier {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstier {{ dconnies: {=bool:?}, ddiscies: {=bool:?}, rsties: {=bool:?}, rsmedies: {=bool:?}, rxrsmies: {=bool:?}, hsofies: {=bool:?}, hwupies: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.dconnies(),
self.ddiscies(),
self.rsties(),
self.rsmedies(),
self.rxrsmies(),
self.hsofies(),
self.hwupies(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Host Global Interrupt Set Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstifr(pub u32);
impl Hstifr {
#[doc = "Device Connection Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dconnis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt Set"]
#[inline(always)]
pub const fn set_dconnis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn ddiscis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt Set"]
#[inline(always)]
pub const fn set_ddiscis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rstis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt Set"]
#[inline(always)]
pub const fn set_rstis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rsmedis(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt Set"]
#[inline(always)]
pub const fn set_rsmedis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxrsmis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt Set"]
#[inline(always)]
pub const fn set_rxrsmis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn hsofis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt Set"]
#[inline(always)]
pub const fn set_hsofis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn hwupis(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt Set"]
#[inline(always)]
pub const fn set_hwupis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "DMA Channel 1 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Set"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Hstifr {
#[inline(always)]
fn default() -> Hstifr {
Hstifr(0)
}
}
impl core::fmt::Debug for Hstifr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstifr")
.field("dconnis", &self.dconnis())
.field("ddiscis", &self.ddiscis())
.field("rstis", &self.rstis())
.field("rsmedis", &self.rsmedis())
.field("rxrsmis", &self.rxrsmis())
.field("hsofis", &self.hsofis())
.field("hwupis", &self.hwupis())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstifr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstifr {{ dconnis: {=bool:?}, ddiscis: {=bool:?}, rstis: {=bool:?}, rsmedis: {=bool:?}, rxrsmis: {=bool:?}, hsofis: {=bool:?}, hwupis: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.dconnis(),
self.ddiscis(),
self.rstis(),
self.rsmedis(),
self.rxrsmis(),
self.hsofis(),
self.hwupis(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Host Global Interrupt Mask Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstimr(pub u32);
impl Hstimr {
#[doc = "Device Connection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dconnie(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt Enable"]
#[inline(always)]
pub const fn set_dconnie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn ddiscie(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt Enable"]
#[inline(always)]
pub const fn set_ddiscie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rstie(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt Enable"]
#[inline(always)]
pub const fn set_rstie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rsmedie(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt Enable"]
#[inline(always)]
pub const fn set_rsmedie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxrsmie(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt Enable"]
#[inline(always)]
pub const fn set_rxrsmie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hsofie(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt Enable"]
#[inline(always)]
pub const fn set_hsofie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn hwupie(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt Enable"]
#[inline(always)]
pub const fn set_hwupie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Pipe 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Pipe 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Pipe 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Pipe 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Pipe 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe 7 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Pipe 8 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe 9 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe 9 Interrupt Enable"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Hstimr {
#[inline(always)]
fn default() -> Hstimr {
Hstimr(0)
}
}
impl core::fmt::Debug for Hstimr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstimr")
.field("dconnie", &self.dconnie())
.field("ddiscie", &self.ddiscie())
.field("rstie", &self.rstie())
.field("rsmedie", &self.rsmedie())
.field("rxrsmie", &self.rxrsmie())
.field("hsofie", &self.hsofie())
.field("hwupie", &self.hwupie())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstimr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstimr {{ dconnie: {=bool:?}, ddiscie: {=bool:?}, rstie: {=bool:?}, rsmedie: {=bool:?}, rxrsmie: {=bool:?}, hsofie: {=bool:?}, hwupie: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.dconnie(),
self.ddiscie(),
self.rstie(),
self.rsmedie(),
self.rxrsmie(),
self.hsofie(),
self.hwupie(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Host Global Interrupt Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstisr(pub u32);
impl Hstisr {
#[doc = "Device Connection Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dconni(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Device Connection Interrupt"]
#[inline(always)]
pub const fn set_dconni(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Device Disconnection Interrupt"]
#[must_use]
#[inline(always)]
pub const fn ddisci(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Device Disconnection Interrupt"]
#[inline(always)]
pub const fn set_ddisci(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "USB Reset Sent Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rsti(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "USB Reset Sent Interrupt"]
#[inline(always)]
pub const fn set_rsti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Downstream Resume Sent Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rsmedi(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Downstream Resume Sent Interrupt"]
#[inline(always)]
pub const fn set_rsmedi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Upstream Resume Received Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxrsmi(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Upstream Resume Received Interrupt"]
#[inline(always)]
pub const fn set_rxrsmi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Host Start of Frame Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hsofi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Host Start of Frame Interrupt"]
#[inline(always)]
pub const fn set_hsofi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Host Wake-Up Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hwupi(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Host Wake-Up Interrupt"]
#[inline(always)]
pub const fn set_hwupi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Pipe 0 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Interrupt"]
#[inline(always)]
pub const fn set_pep_0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Pipe 1 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Interrupt"]
#[inline(always)]
pub const fn set_pep_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Pipe 2 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Interrupt"]
#[inline(always)]
pub const fn set_pep_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe 3 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Interrupt"]
#[inline(always)]
pub const fn set_pep_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Pipe 4 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Interrupt"]
#[inline(always)]
pub const fn set_pep_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe 5 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Interrupt"]
#[inline(always)]
pub const fn set_pep_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Pipe 6 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Interrupt"]
#[inline(always)]
pub const fn set_pep_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe 7 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Interrupt"]
#[inline(always)]
pub const fn set_pep_7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Pipe 8 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_8(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Interrupt"]
#[inline(always)]
pub const fn set_pep_8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe 9 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn pep_9(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe 9 Interrupt"]
#[inline(always)]
pub const fn set_pep_9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "DMA Channel 1 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_1(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 1 Interrupt"]
#[inline(always)]
pub const fn set_dma_1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "DMA Channel 2 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_2(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 2 Interrupt"]
#[inline(always)]
pub const fn set_dma_2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "DMA Channel 3 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_3(&self) -> bool {
let val = (self.0 >> 27usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 3 Interrupt"]
#[inline(always)]
pub const fn set_dma_3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
}
#[doc = "DMA Channel 4 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_4(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 4 Interrupt"]
#[inline(always)]
pub const fn set_dma_4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "DMA Channel 5 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_5(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 5 Interrupt"]
#[inline(always)]
pub const fn set_dma_5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "DMA Channel 6 Interrupt"]
#[must_use]
#[inline(always)]
pub const fn dma_6(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "DMA Channel 6 Interrupt"]
#[inline(always)]
pub const fn set_dma_6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for Hstisr {
#[inline(always)]
fn default() -> Hstisr {
Hstisr(0)
}
}
impl core::fmt::Debug for Hstisr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstisr")
.field("dconni", &self.dconni())
.field("ddisci", &self.ddisci())
.field("rsti", &self.rsti())
.field("rsmedi", &self.rsmedi())
.field("rxrsmi", &self.rxrsmi())
.field("hsofi", &self.hsofi())
.field("hwupi", &self.hwupi())
.field("pep_0", &self.pep_0())
.field("pep_1", &self.pep_1())
.field("pep_2", &self.pep_2())
.field("pep_3", &self.pep_3())
.field("pep_4", &self.pep_4())
.field("pep_5", &self.pep_5())
.field("pep_6", &self.pep_6())
.field("pep_7", &self.pep_7())
.field("pep_8", &self.pep_8())
.field("pep_9", &self.pep_9())
.field("dma_1", &self.dma_1())
.field("dma_2", &self.dma_2())
.field("dma_3", &self.dma_3())
.field("dma_4", &self.dma_4())
.field("dma_5", &self.dma_5())
.field("dma_6", &self.dma_6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstisr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstisr {{ dconni: {=bool:?}, ddisci: {=bool:?}, rsti: {=bool:?}, rsmedi: {=bool:?}, rxrsmi: {=bool:?}, hsofi: {=bool:?}, hwupi: {=bool:?}, pep_0: {=bool:?}, pep_1: {=bool:?}, pep_2: {=bool:?}, pep_3: {=bool:?}, pep_4: {=bool:?}, pep_5: {=bool:?}, pep_6: {=bool:?}, pep_7: {=bool:?}, pep_8: {=bool:?}, pep_9: {=bool:?}, dma_1: {=bool:?}, dma_2: {=bool:?}, dma_3: {=bool:?}, dma_4: {=bool:?}, dma_5: {=bool:?}, dma_6: {=bool:?} }}",
self.dconni(),
self.ddisci(),
self.rsti(),
self.rsmedi(),
self.rxrsmi(),
self.hsofi(),
self.hwupi(),
self.pep_0(),
self.pep_1(),
self.pep_2(),
self.pep_3(),
self.pep_4(),
self.pep_5(),
self.pep_6(),
self.pep_7(),
self.pep_8(),
self.pep_9(),
self.dma_1(),
self.dma_2(),
self.dma_3(),
self.dma_4(),
self.dma_5(),
self.dma_6()
)
}
}
#[doc = "Host Pipe Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpip(pub u32);
impl Hstpip {
#[doc = "Pipe 0 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Enable"]
#[inline(always)]
pub const fn set_pen0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Pipe 1 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Enable"]
#[inline(always)]
pub const fn set_pen1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Pipe 2 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Enable"]
#[inline(always)]
pub const fn set_pen2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe 3 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Enable"]
#[inline(always)]
pub const fn set_pen3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Pipe 4 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Enable"]
#[inline(always)]
pub const fn set_pen4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Pipe 5 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Enable"]
#[inline(always)]
pub const fn set_pen5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Pipe 6 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Enable"]
#[inline(always)]
pub const fn set_pen6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Pipe 7 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Enable"]
#[inline(always)]
pub const fn set_pen7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Pipe 8 Enable"]
#[must_use]
#[inline(always)]
pub const fn pen8(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Enable"]
#[inline(always)]
pub const fn set_pen8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Pipe 0 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe 0 Reset"]
#[inline(always)]
pub const fn set_prst0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe 1 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe 1 Reset"]
#[inline(always)]
pub const fn set_prst1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Pipe 2 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Pipe 2 Reset"]
#[inline(always)]
pub const fn set_prst2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Pipe 3 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Pipe 3 Reset"]
#[inline(always)]
pub const fn set_prst3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Pipe 4 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Pipe 4 Reset"]
#[inline(always)]
pub const fn set_prst4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Pipe 5 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Pipe 5 Reset"]
#[inline(always)]
pub const fn set_prst5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Pipe 6 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Pipe 6 Reset"]
#[inline(always)]
pub const fn set_prst6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Pipe 7 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Pipe 7 Reset"]
#[inline(always)]
pub const fn set_prst7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Pipe 8 Reset"]
#[must_use]
#[inline(always)]
pub const fn prst8(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Pipe 8 Reset"]
#[inline(always)]
pub const fn set_prst8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Hstpip {
#[inline(always)]
fn default() -> Hstpip {
Hstpip(0)
}
}
impl core::fmt::Debug for Hstpip {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpip")
.field("pen0", &self.pen0())
.field("pen1", &self.pen1())
.field("pen2", &self.pen2())
.field("pen3", &self.pen3())
.field("pen4", &self.pen4())
.field("pen5", &self.pen5())
.field("pen6", &self.pen6())
.field("pen7", &self.pen7())
.field("pen8", &self.pen8())
.field("prst0", &self.prst0())
.field("prst1", &self.prst1())
.field("prst2", &self.prst2())
.field("prst3", &self.prst3())
.field("prst4", &self.prst4())
.field("prst5", &self.prst5())
.field("prst6", &self.prst6())
.field("prst7", &self.prst7())
.field("prst8", &self.prst8())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpip {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpip {{ pen0: {=bool:?}, pen1: {=bool:?}, pen2: {=bool:?}, pen3: {=bool:?}, pen4: {=bool:?}, pen5: {=bool:?}, pen6: {=bool:?}, pen7: {=bool:?}, pen8: {=bool:?}, prst0: {=bool:?}, prst1: {=bool:?}, prst2: {=bool:?}, prst3: {=bool:?}, prst4: {=bool:?}, prst5: {=bool:?}, prst6: {=bool:?}, prst7: {=bool:?}, prst8: {=bool:?} }}",
self.pen0(),
self.pen1(),
self.pen2(),
self.pen3(),
self.pen4(),
self.pen5(),
self.pen6(),
self.pen7(),
self.pen8(),
self.prst0(),
self.prst1(),
self.prst2(),
self.prst3(),
self.prst4(),
self.prst5(),
self.prst6(),
self.prst7(),
self.prst8()
)
}
}
#[doc = "Host Pipe Configuration Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipcfg(pub u32);
impl Hstpipcfg {
#[doc = "Pipe Memory Allocate"]
#[must_use]
#[inline(always)]
pub const fn alloc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Pipe Memory Allocate"]
#[inline(always)]
pub const fn set_alloc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Pipe Banks"]
#[must_use]
#[inline(always)]
pub const fn pbk(&self) -> super::vals::HstpipcfgPbk {
let val = (self.0 >> 2usize) & 0x03;
super::vals::HstpipcfgPbk::from_bits(val as u8)
}
#[doc = "Pipe Banks"]
#[inline(always)]
pub const fn set_pbk(&mut self, val: super::vals::HstpipcfgPbk) {
self.0 = (self.0 & !(0x03 << 2usize)) | (((val.to_bits() as u32) & 0x03) << 2usize);
}
#[doc = "Pipe Size"]
#[must_use]
#[inline(always)]
pub const fn psize(&self) -> super::vals::HstpipcfgPsize {
let val = (self.0 >> 4usize) & 0x07;
super::vals::HstpipcfgPsize::from_bits(val as u8)
}
#[doc = "Pipe Size"]
#[inline(always)]
pub const fn set_psize(&mut self, val: super::vals::HstpipcfgPsize) {
self.0 = (self.0 & !(0x07 << 4usize)) | (((val.to_bits() as u32) & 0x07) << 4usize);
}
#[doc = "Pipe Token"]
#[must_use]
#[inline(always)]
pub const fn ptoken(&self) -> super::vals::HstpipcfgPtoken {
let val = (self.0 >> 8usize) & 0x03;
super::vals::HstpipcfgPtoken::from_bits(val as u8)
}
#[doc = "Pipe Token"]
#[inline(always)]
pub const fn set_ptoken(&mut self, val: super::vals::HstpipcfgPtoken) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Automatic Switch"]
#[must_use]
#[inline(always)]
pub const fn autosw(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Automatic Switch"]
#[inline(always)]
pub const fn set_autosw(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe Type"]
#[must_use]
#[inline(always)]
pub const fn ptype(&self) -> super::vals::HstpipcfgPtype {
let val = (self.0 >> 12usize) & 0x03;
super::vals::HstpipcfgPtype::from_bits(val as u8)
}
#[doc = "Pipe Type"]
#[inline(always)]
pub const fn set_ptype(&mut self, val: super::vals::HstpipcfgPtype) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Pipe Endpoint Number"]
#[must_use]
#[inline(always)]
pub const fn pepnum(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Pipe Endpoint Number"]
#[inline(always)]
pub const fn set_pepnum(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "Pipe Interrupt Request Frequency"]
#[must_use]
#[inline(always)]
pub const fn intfrq(&self) -> u8 {
let val = (self.0 >> 24usize) & 0xff;
val as u8
}
#[doc = "Pipe Interrupt Request Frequency"]
#[inline(always)]
pub const fn set_intfrq(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
}
}
impl Default for Hstpipcfg {
#[inline(always)]
fn default() -> Hstpipcfg {
Hstpipcfg(0)
}
}
impl core::fmt::Debug for Hstpipcfg {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipcfg")
.field("alloc", &self.alloc())
.field("pbk", &self.pbk())
.field("psize", &self.psize())
.field("ptoken", &self.ptoken())
.field("autosw", &self.autosw())
.field("ptype", &self.ptype())
.field("pepnum", &self.pepnum())
.field("intfrq", &self.intfrq())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipcfg {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipcfg {{ alloc: {=bool:?}, pbk: {:?}, psize: {:?}, ptoken: {:?}, autosw: {=bool:?}, ptype: {:?}, pepnum: {=u8:?}, intfrq: {=u8:?} }}",
self.alloc(),
self.pbk(),
self.psize(),
self.ptoken(),
self.autosw(),
self.ptype(),
self.pepnum(),
self.intfrq()
)
}
}
#[doc = "Host Pipe Configuration Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipcfg0Hsbohscp(pub u32);
impl Hstpipcfg0Hsbohscp {
#[doc = "Pipe Memory Allocate"]
#[must_use]
#[inline(always)]
pub const fn alloc(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Pipe Memory Allocate"]
#[inline(always)]
pub const fn set_alloc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Pipe Banks"]
#[must_use]
#[inline(always)]
pub const fn pbk(&self) -> super::vals::Hstpipcfg0HsbohscpPbk {
let val = (self.0 >> 2usize) & 0x03;
super::vals::Hstpipcfg0HsbohscpPbk::from_bits(val as u8)
}
#[doc = "Pipe Banks"]
#[inline(always)]
pub const fn set_pbk(&mut self, val: super::vals::Hstpipcfg0HsbohscpPbk) {
self.0 = (self.0 & !(0x03 << 2usize)) | (((val.to_bits() as u32) & 0x03) << 2usize);
}
#[doc = "Pipe Size"]
#[must_use]
#[inline(always)]
pub const fn psize(&self) -> super::vals::Hstpipcfg0HsbohscpPsize {
let val = (self.0 >> 4usize) & 0x07;
super::vals::Hstpipcfg0HsbohscpPsize::from_bits(val as u8)
}
#[doc = "Pipe Size"]
#[inline(always)]
pub const fn set_psize(&mut self, val: super::vals::Hstpipcfg0HsbohscpPsize) {
self.0 = (self.0 & !(0x07 << 4usize)) | (((val.to_bits() as u32) & 0x07) << 4usize);
}
#[doc = "Pipe Token"]
#[must_use]
#[inline(always)]
pub const fn ptoken(&self) -> super::vals::Hstpipcfg0HsbohscpPtoken {
let val = (self.0 >> 8usize) & 0x03;
super::vals::Hstpipcfg0HsbohscpPtoken::from_bits(val as u8)
}
#[doc = "Pipe Token"]
#[inline(always)]
pub const fn set_ptoken(&mut self, val: super::vals::Hstpipcfg0HsbohscpPtoken) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Automatic Switch"]
#[must_use]
#[inline(always)]
pub const fn autosw(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Automatic Switch"]
#[inline(always)]
pub const fn set_autosw(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Pipe Type"]
#[must_use]
#[inline(always)]
pub const fn ptype(&self) -> super::vals::Hstpipcfg0HsbohscpPtype {
let val = (self.0 >> 12usize) & 0x03;
super::vals::Hstpipcfg0HsbohscpPtype::from_bits(val as u8)
}
#[doc = "Pipe Type"]
#[inline(always)]
pub const fn set_ptype(&mut self, val: super::vals::Hstpipcfg0HsbohscpPtype) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Pipe Endpoint Number"]
#[must_use]
#[inline(always)]
pub const fn pepnum(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Pipe Endpoint Number"]
#[inline(always)]
pub const fn set_pepnum(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "Ping Enable"]
#[must_use]
#[inline(always)]
pub const fn pingen(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Ping Enable"]
#[inline(always)]
pub const fn set_pingen(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Binterval Parameter for the Bulk-Out/Ping Transaction"]
#[must_use]
#[inline(always)]
pub const fn binterval(&self) -> u8 {
let val = (self.0 >> 24usize) & 0xff;
val as u8
}
#[doc = "Binterval Parameter for the Bulk-Out/Ping Transaction"]
#[inline(always)]
pub const fn set_binterval(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
}
}
impl Default for Hstpipcfg0Hsbohscp {
#[inline(always)]
fn default() -> Hstpipcfg0Hsbohscp {
Hstpipcfg0Hsbohscp(0)
}
}
impl core::fmt::Debug for Hstpipcfg0Hsbohscp {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipcfg0Hsbohscp")
.field("alloc", &self.alloc())
.field("pbk", &self.pbk())
.field("psize", &self.psize())
.field("ptoken", &self.ptoken())
.field("autosw", &self.autosw())
.field("ptype", &self.ptype())
.field("pepnum", &self.pepnum())
.field("pingen", &self.pingen())
.field("binterval", &self.binterval())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipcfg0Hsbohscp {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipcfg0Hsbohscp {{ alloc: {=bool:?}, pbk: {:?}, psize: {:?}, ptoken: {:?}, autosw: {=bool:?}, ptype: {:?}, pepnum: {=u8:?}, pingen: {=bool:?}, binterval: {=u8:?} }}",
self.alloc(),
self.pbk(),
self.psize(),
self.ptoken(),
self.autosw(),
self.ptype(),
self.pepnum(),
self.pingen(),
self.binterval()
)
}
}
#[doc = "Host Pipe Error Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpiperr(pub u32);
impl Hstpiperr {
#[doc = "Data Toggle Error"]
#[must_use]
#[inline(always)]
pub const fn datatgl(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Data Toggle Error"]
#[inline(always)]
pub const fn set_datatgl(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Data PID Error"]
#[must_use]
#[inline(always)]
pub const fn datapid(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Data PID Error"]
#[inline(always)]
pub const fn set_datapid(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "PID Error"]
#[must_use]
#[inline(always)]
pub const fn pid(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "PID Error"]
#[inline(always)]
pub const fn set_pid(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Time-Out Error"]
#[must_use]
#[inline(always)]
pub const fn timeout(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Time-Out Error"]
#[inline(always)]
pub const fn set_timeout(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "CRC16 Error"]
#[must_use]
#[inline(always)]
pub const fn crc16(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "CRC16 Error"]
#[inline(always)]
pub const fn set_crc16(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Error Counter"]
#[must_use]
#[inline(always)]
pub const fn counter(&self) -> u8 {
let val = (self.0 >> 5usize) & 0x03;
val as u8
}
#[doc = "Error Counter"]
#[inline(always)]
pub const fn set_counter(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 5usize)) | (((val as u32) & 0x03) << 5usize);
}
}
impl Default for Hstpiperr {
#[inline(always)]
fn default() -> Hstpiperr {
Hstpiperr(0)
}
}
impl core::fmt::Debug for Hstpiperr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpiperr")
.field("datatgl", &self.datatgl())
.field("datapid", &self.datapid())
.field("pid", &self.pid())
.field("timeout", &self.timeout())
.field("crc16", &self.crc16())
.field("counter", &self.counter())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpiperr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpiperr {{ datatgl: {=bool:?}, datapid: {=bool:?}, pid: {=bool:?}, timeout: {=bool:?}, crc16: {=bool:?}, counter: {=u8:?} }}",
self.datatgl(),
self.datapid(),
self.pid(),
self.timeout(),
self.crc16(),
self.counter()
)
}
}
#[doc = "Host Pipe Clear Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipicr(pub u32);
impl Hstpipicr {
#[doc = "Received IN Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxinic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txoutic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_txoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txstpic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt Clear"]
#[inline(always)]
pub const fn set_txstpic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakedic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Clear"]
#[inline(always)]
pub const fn set_nakedic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxstalldic(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Clear"]
#[inline(always)]
pub const fn set_rxstalldic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketic(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Hstpipicr {
#[inline(always)]
fn default() -> Hstpipicr {
Hstpipicr(0)
}
}
impl core::fmt::Debug for Hstpipicr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipicr")
.field("rxinic", &self.rxinic())
.field("txoutic", &self.txoutic())
.field("txstpic", &self.txstpic())
.field("nakedic", &self.nakedic())
.field("overfic", &self.overfic())
.field("rxstalldic", &self.rxstalldic())
.field("shortpacketic", &self.shortpacketic())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipicr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipicr {{ rxinic: {=bool:?}, txoutic: {=bool:?}, txstpic: {=bool:?}, nakedic: {=bool:?}, overfic: {=bool:?}, rxstalldic: {=bool:?}, shortpacketic: {=bool:?} }}",
self.rxinic(),
self.txoutic(),
self.txstpic(),
self.nakedic(),
self.overfic(),
self.rxstalldic(),
self.shortpacketic()
)
}
}
#[doc = "Host Pipe Clear Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipicr0Intpipes(pub u32);
impl Hstpipicr0Intpipes {
#[doc = "Received IN Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxinic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txoutic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_txoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn underfic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Clear"]
#[inline(always)]
pub const fn set_underfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakedic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Clear"]
#[inline(always)]
pub const fn set_nakedic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxstalldic(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Clear"]
#[inline(always)]
pub const fn set_rxstalldic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketic(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Hstpipicr0Intpipes {
#[inline(always)]
fn default() -> Hstpipicr0Intpipes {
Hstpipicr0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipicr0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipicr0Intpipes")
.field("rxinic", &self.rxinic())
.field("txoutic", &self.txoutic())
.field("underfic", &self.underfic())
.field("nakedic", &self.nakedic())
.field("overfic", &self.overfic())
.field("rxstalldic", &self.rxstalldic())
.field("shortpacketic", &self.shortpacketic())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipicr0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipicr0Intpipes {{ rxinic: {=bool:?}, txoutic: {=bool:?}, underfic: {=bool:?}, nakedic: {=bool:?}, overfic: {=bool:?}, rxstalldic: {=bool:?}, shortpacketic: {=bool:?} }}",
self.rxinic(),
self.txoutic(),
self.underfic(),
self.nakedic(),
self.overfic(),
self.rxstalldic(),
self.shortpacketic()
)
}
}
#[doc = "Host Pipe Clear Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipicr0Isopipes(pub u32);
impl Hstpipicr0Isopipes {
#[doc = "Received IN Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn rxinic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Clear"]
#[inline(always)]
pub const fn set_rxinic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn txoutic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Clear"]
#[inline(always)]
pub const fn set_txoutic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn underfic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Clear"]
#[inline(always)]
pub const fn set_underfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "NAKed Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn nakedic(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Clear"]
#[inline(always)]
pub const fn set_nakedic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn overfic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Clear"]
#[inline(always)]
pub const fn set_overfic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn crcerric(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Clear"]
#[inline(always)]
pub const fn set_crcerric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn shortpacketic(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Clear"]
#[inline(always)]
pub const fn set_shortpacketic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Hstpipicr0Isopipes {
#[inline(always)]
fn default() -> Hstpipicr0Isopipes {
Hstpipicr0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipicr0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipicr0Isopipes")
.field("rxinic", &self.rxinic())
.field("txoutic", &self.txoutic())
.field("underfic", &self.underfic())
.field("nakedic", &self.nakedic())
.field("overfic", &self.overfic())
.field("crcerric", &self.crcerric())
.field("shortpacketic", &self.shortpacketic())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipicr0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipicr0Isopipes {{ rxinic: {=bool:?}, txoutic: {=bool:?}, underfic: {=bool:?}, nakedic: {=bool:?}, overfic: {=bool:?}, crcerric: {=bool:?}, shortpacketic: {=bool:?} }}",
self.rxinic(),
self.txoutic(),
self.underfic(),
self.nakedic(),
self.overfic(),
self.crcerric(),
self.shortpacketic()
)
}
}
#[doc = "Host Pipe Disable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipidr(pub u32);
impl Hstpipidr {
#[doc = "Received IN Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxinec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Disable"]
#[inline(always)]
pub const fn set_rxinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn txoutec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[inline(always)]
pub const fn set_txoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn txstpec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt Disable"]
#[inline(always)]
pub const fn set_txstpec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn perrec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Disable"]
#[inline(always)]
pub const fn set_perrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn nakedec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Disable"]
#[inline(always)]
pub const fn set_nakedec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn overfiec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Disable"]
#[inline(always)]
pub const fn set_overfiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxstalldec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Disable"]
#[inline(always)]
pub const fn set_rxstalldec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketiec(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Disable"]
#[inline(always)]
pub const fn set_shortpacketiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Disable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkec(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Disable"]
#[inline(always)]
pub const fn set_nbusybkec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control Disable"]
#[must_use]
#[inline(always)]
pub const fn fifoconc(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control Disable"]
#[inline(always)]
pub const fn set_fifoconc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmac(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[inline(always)]
pub const fn set_pdishdmac(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Disable"]
#[must_use]
#[inline(always)]
pub const fn pfreezec(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Disable"]
#[inline(always)]
pub const fn set_pfreezec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
}
impl Default for Hstpipidr {
#[inline(always)]
fn default() -> Hstpipidr {
Hstpipidr(0)
}
}
impl core::fmt::Debug for Hstpipidr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipidr")
.field("rxinec", &self.rxinec())
.field("txoutec", &self.txoutec())
.field("txstpec", &self.txstpec())
.field("perrec", &self.perrec())
.field("nakedec", &self.nakedec())
.field("overfiec", &self.overfiec())
.field("rxstalldec", &self.rxstalldec())
.field("shortpacketiec", &self.shortpacketiec())
.field("nbusybkec", &self.nbusybkec())
.field("fifoconc", &self.fifoconc())
.field("pdishdmac", &self.pdishdmac())
.field("pfreezec", &self.pfreezec())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipidr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipidr {{ rxinec: {=bool:?}, txoutec: {=bool:?}, txstpec: {=bool:?}, perrec: {=bool:?}, nakedec: {=bool:?}, overfiec: {=bool:?}, rxstalldec: {=bool:?}, shortpacketiec: {=bool:?}, nbusybkec: {=bool:?}, fifoconc: {=bool:?}, pdishdmac: {=bool:?}, pfreezec: {=bool:?} }}",
self.rxinec(),
self.txoutec(),
self.txstpec(),
self.perrec(),
self.nakedec(),
self.overfiec(),
self.rxstalldec(),
self.shortpacketiec(),
self.nbusybkec(),
self.fifoconc(),
self.pdishdmac(),
self.pfreezec()
)
}
}
#[doc = "Host Pipe Disable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipidr0Intpipes(pub u32);
impl Hstpipidr0Intpipes {
#[doc = "Received IN Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxinec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Disable"]
#[inline(always)]
pub const fn set_rxinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn txoutec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[inline(always)]
pub const fn set_txoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn underfiec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Disable"]
#[inline(always)]
pub const fn set_underfiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn perrec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Disable"]
#[inline(always)]
pub const fn set_perrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn nakedec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Disable"]
#[inline(always)]
pub const fn set_nakedec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn overfiec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Disable"]
#[inline(always)]
pub const fn set_overfiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxstalldec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Disable"]
#[inline(always)]
pub const fn set_rxstalldec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketiec(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Disable"]
#[inline(always)]
pub const fn set_shortpacketiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Disable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkec(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Disable"]
#[inline(always)]
pub const fn set_nbusybkec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control Disable"]
#[must_use]
#[inline(always)]
pub const fn fifoconc(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control Disable"]
#[inline(always)]
pub const fn set_fifoconc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmac(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[inline(always)]
pub const fn set_pdishdmac(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Disable"]
#[must_use]
#[inline(always)]
pub const fn pfreezec(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Disable"]
#[inline(always)]
pub const fn set_pfreezec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
}
impl Default for Hstpipidr0Intpipes {
#[inline(always)]
fn default() -> Hstpipidr0Intpipes {
Hstpipidr0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipidr0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipidr0Intpipes")
.field("rxinec", &self.rxinec())
.field("txoutec", &self.txoutec())
.field("underfiec", &self.underfiec())
.field("perrec", &self.perrec())
.field("nakedec", &self.nakedec())
.field("overfiec", &self.overfiec())
.field("rxstalldec", &self.rxstalldec())
.field("shortpacketiec", &self.shortpacketiec())
.field("nbusybkec", &self.nbusybkec())
.field("fifoconc", &self.fifoconc())
.field("pdishdmac", &self.pdishdmac())
.field("pfreezec", &self.pfreezec())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipidr0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipidr0Intpipes {{ rxinec: {=bool:?}, txoutec: {=bool:?}, underfiec: {=bool:?}, perrec: {=bool:?}, nakedec: {=bool:?}, overfiec: {=bool:?}, rxstalldec: {=bool:?}, shortpacketiec: {=bool:?}, nbusybkec: {=bool:?}, fifoconc: {=bool:?}, pdishdmac: {=bool:?}, pfreezec: {=bool:?} }}",
self.rxinec(),
self.txoutec(),
self.underfiec(),
self.perrec(),
self.nakedec(),
self.overfiec(),
self.rxstalldec(),
self.shortpacketiec(),
self.nbusybkec(),
self.fifoconc(),
self.pdishdmac(),
self.pfreezec()
)
}
}
#[doc = "Host Pipe Disable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipidr0Isopipes(pub u32);
impl Hstpipidr0Isopipes {
#[doc = "Received IN Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rxinec(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Disable"]
#[inline(always)]
pub const fn set_rxinec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn txoutec(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Disable"]
#[inline(always)]
pub const fn set_txoutec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn underfiec(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Disable"]
#[inline(always)]
pub const fn set_underfiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn perrec(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Disable"]
#[inline(always)]
pub const fn set_perrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn nakedec(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Disable"]
#[inline(always)]
pub const fn set_nakedec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn overfiec(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Disable"]
#[inline(always)]
pub const fn set_overfiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn crcerrec(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Disable"]
#[inline(always)]
pub const fn set_crcerrec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketiec(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Disable"]
#[inline(always)]
pub const fn set_shortpacketiec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Disable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkec(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Disable"]
#[inline(always)]
pub const fn set_nbusybkec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control Disable"]
#[must_use]
#[inline(always)]
pub const fn fifoconc(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control Disable"]
#[inline(always)]
pub const fn set_fifoconc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmac(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Disable"]
#[inline(always)]
pub const fn set_pdishdmac(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Disable"]
#[must_use]
#[inline(always)]
pub const fn pfreezec(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Disable"]
#[inline(always)]
pub const fn set_pfreezec(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
}
impl Default for Hstpipidr0Isopipes {
#[inline(always)]
fn default() -> Hstpipidr0Isopipes {
Hstpipidr0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipidr0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipidr0Isopipes")
.field("rxinec", &self.rxinec())
.field("txoutec", &self.txoutec())
.field("underfiec", &self.underfiec())
.field("perrec", &self.perrec())
.field("nakedec", &self.nakedec())
.field("overfiec", &self.overfiec())
.field("crcerrec", &self.crcerrec())
.field("shortpacketiec", &self.shortpacketiec())
.field("nbusybkec", &self.nbusybkec())
.field("fifoconc", &self.fifoconc())
.field("pdishdmac", &self.pdishdmac())
.field("pfreezec", &self.pfreezec())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipidr0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipidr0Isopipes {{ rxinec: {=bool:?}, txoutec: {=bool:?}, underfiec: {=bool:?}, perrec: {=bool:?}, nakedec: {=bool:?}, overfiec: {=bool:?}, crcerrec: {=bool:?}, shortpacketiec: {=bool:?}, nbusybkec: {=bool:?}, fifoconc: {=bool:?}, pdishdmac: {=bool:?}, pfreezec: {=bool:?} }}",
self.rxinec(),
self.txoutec(),
self.underfiec(),
self.perrec(),
self.nakedec(),
self.overfiec(),
self.crcerrec(),
self.shortpacketiec(),
self.nbusybkec(),
self.fifoconc(),
self.pdishdmac(),
self.pfreezec()
)
}
}
#[doc = "Host Pipe Enable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipier(pub u32);
impl Hstpipier {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxines(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoutes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txstpes(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt Enable"]
#[inline(always)]
pub const fn set_txstpes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perres(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakedes(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakedes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfies(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxstalldes(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Enable"]
#[inline(always)]
pub const fn set_rxstalldes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketies(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkes(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Enable"]
#[inline(always)]
pub const fn set_nbusybkes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmas(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdmas(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Enable"]
#[must_use]
#[inline(always)]
pub const fn pfreezes(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Enable"]
#[inline(always)]
pub const fn set_pfreezes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle Enable"]
#[must_use]
#[inline(always)]
pub const fn rstdts(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle Enable"]
#[inline(always)]
pub const fn set_rstdts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipier {
#[inline(always)]
fn default() -> Hstpipier {
Hstpipier(0)
}
}
impl core::fmt::Debug for Hstpipier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipier")
.field("rxines", &self.rxines())
.field("txoutes", &self.txoutes())
.field("txstpes", &self.txstpes())
.field("perres", &self.perres())
.field("nakedes", &self.nakedes())
.field("overfies", &self.overfies())
.field("rxstalldes", &self.rxstalldes())
.field("shortpacketies", &self.shortpacketies())
.field("nbusybkes", &self.nbusybkes())
.field("pdishdmas", &self.pdishdmas())
.field("pfreezes", &self.pfreezes())
.field("rstdts", &self.rstdts())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipier {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipier {{ rxines: {=bool:?}, txoutes: {=bool:?}, txstpes: {=bool:?}, perres: {=bool:?}, nakedes: {=bool:?}, overfies: {=bool:?}, rxstalldes: {=bool:?}, shortpacketies: {=bool:?}, nbusybkes: {=bool:?}, pdishdmas: {=bool:?}, pfreezes: {=bool:?}, rstdts: {=bool:?} }}",
self.rxines(),
self.txoutes(),
self.txstpes(),
self.perres(),
self.nakedes(),
self.overfies(),
self.rxstalldes(),
self.shortpacketies(),
self.nbusybkes(),
self.pdishdmas(),
self.pfreezes(),
self.rstdts()
)
}
}
#[doc = "Host Pipe Enable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipier0Intpipes(pub u32);
impl Hstpipier0Intpipes {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxines(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoutes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn underfies(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Enable"]
#[inline(always)]
pub const fn set_underfies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perres(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakedes(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakedes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfies(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxstalldes(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Enable"]
#[inline(always)]
pub const fn set_rxstalldes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketies(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkes(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Enable"]
#[inline(always)]
pub const fn set_nbusybkes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmas(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdmas(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Enable"]
#[must_use]
#[inline(always)]
pub const fn pfreezes(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Enable"]
#[inline(always)]
pub const fn set_pfreezes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle Enable"]
#[must_use]
#[inline(always)]
pub const fn rstdts(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle Enable"]
#[inline(always)]
pub const fn set_rstdts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipier0Intpipes {
#[inline(always)]
fn default() -> Hstpipier0Intpipes {
Hstpipier0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipier0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipier0Intpipes")
.field("rxines", &self.rxines())
.field("txoutes", &self.txoutes())
.field("underfies", &self.underfies())
.field("perres", &self.perres())
.field("nakedes", &self.nakedes())
.field("overfies", &self.overfies())
.field("rxstalldes", &self.rxstalldes())
.field("shortpacketies", &self.shortpacketies())
.field("nbusybkes", &self.nbusybkes())
.field("pdishdmas", &self.pdishdmas())
.field("pfreezes", &self.pfreezes())
.field("rstdts", &self.rstdts())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipier0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipier0Intpipes {{ rxines: {=bool:?}, txoutes: {=bool:?}, underfies: {=bool:?}, perres: {=bool:?}, nakedes: {=bool:?}, overfies: {=bool:?}, rxstalldes: {=bool:?}, shortpacketies: {=bool:?}, nbusybkes: {=bool:?}, pdishdmas: {=bool:?}, pfreezes: {=bool:?}, rstdts: {=bool:?} }}",
self.rxines(),
self.txoutes(),
self.underfies(),
self.perres(),
self.nakedes(),
self.overfies(),
self.rxstalldes(),
self.shortpacketies(),
self.nbusybkes(),
self.pdishdmas(),
self.pfreezes(),
self.rstdts()
)
}
}
#[doc = "Host Pipe Enable Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipier0Isopipes(pub u32);
impl Hstpipier0Isopipes {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxines(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxines(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoutes(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoutes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn underfies(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Enable"]
#[inline(always)]
pub const fn set_underfies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perres(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakedes(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakedes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfies(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn crcerres(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Enable"]
#[inline(always)]
pub const fn set_crcerres(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketies(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketies(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybkes(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Enable"]
#[inline(always)]
pub const fn set_nbusybkes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdmas(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdmas(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze Enable"]
#[must_use]
#[inline(always)]
pub const fn pfreezes(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze Enable"]
#[inline(always)]
pub const fn set_pfreezes(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle Enable"]
#[must_use]
#[inline(always)]
pub const fn rstdts(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle Enable"]
#[inline(always)]
pub const fn set_rstdts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipier0Isopipes {
#[inline(always)]
fn default() -> Hstpipier0Isopipes {
Hstpipier0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipier0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipier0Isopipes")
.field("rxines", &self.rxines())
.field("txoutes", &self.txoutes())
.field("underfies", &self.underfies())
.field("perres", &self.perres())
.field("nakedes", &self.nakedes())
.field("overfies", &self.overfies())
.field("crcerres", &self.crcerres())
.field("shortpacketies", &self.shortpacketies())
.field("nbusybkes", &self.nbusybkes())
.field("pdishdmas", &self.pdishdmas())
.field("pfreezes", &self.pfreezes())
.field("rstdts", &self.rstdts())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipier0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipier0Isopipes {{ rxines: {=bool:?}, txoutes: {=bool:?}, underfies: {=bool:?}, perres: {=bool:?}, nakedes: {=bool:?}, overfies: {=bool:?}, crcerres: {=bool:?}, shortpacketies: {=bool:?}, nbusybkes: {=bool:?}, pdishdmas: {=bool:?}, pfreezes: {=bool:?}, rstdts: {=bool:?} }}",
self.rxines(),
self.txoutes(),
self.underfies(),
self.perres(),
self.nakedes(),
self.overfies(),
self.crcerres(),
self.shortpacketies(),
self.nbusybkes(),
self.pdishdmas(),
self.pfreezes(),
self.rstdts()
)
}
}
#[doc = "Host Pipe Set Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipifr(pub u32);
impl Hstpipifr {
#[doc = "Received IN Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxinis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Set"]
#[inline(always)]
pub const fn set_rxinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txoutis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[inline(always)]
pub const fn set_txoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txstpis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt Set"]
#[inline(always)]
pub const fn set_txstpis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn perris(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Set"]
#[inline(always)]
pub const fn set_perris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nakedis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Set"]
#[inline(always)]
pub const fn set_nakedis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn overfis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Set"]
#[inline(always)]
pub const fn set_overfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxstalldis(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Set"]
#[inline(always)]
pub const fn set_rxstalldis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn shortpacketis(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Set"]
#[inline(always)]
pub const fn set_shortpacketis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Set"]
#[must_use]
#[inline(always)]
pub const fn nbusybks(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Set"]
#[inline(always)]
pub const fn set_nbusybks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
}
impl Default for Hstpipifr {
#[inline(always)]
fn default() -> Hstpipifr {
Hstpipifr(0)
}
}
impl core::fmt::Debug for Hstpipifr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipifr")
.field("rxinis", &self.rxinis())
.field("txoutis", &self.txoutis())
.field("txstpis", &self.txstpis())
.field("perris", &self.perris())
.field("nakedis", &self.nakedis())
.field("overfis", &self.overfis())
.field("rxstalldis", &self.rxstalldis())
.field("shortpacketis", &self.shortpacketis())
.field("nbusybks", &self.nbusybks())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipifr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipifr {{ rxinis: {=bool:?}, txoutis: {=bool:?}, txstpis: {=bool:?}, perris: {=bool:?}, nakedis: {=bool:?}, overfis: {=bool:?}, rxstalldis: {=bool:?}, shortpacketis: {=bool:?}, nbusybks: {=bool:?} }}",
self.rxinis(),
self.txoutis(),
self.txstpis(),
self.perris(),
self.nakedis(),
self.overfis(),
self.rxstalldis(),
self.shortpacketis(),
self.nbusybks()
)
}
}
#[doc = "Host Pipe Set Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipifr0Intpipes(pub u32);
impl Hstpipifr0Intpipes {
#[doc = "Received IN Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxinis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Set"]
#[inline(always)]
pub const fn set_rxinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txoutis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[inline(always)]
pub const fn set_txoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn underfis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Set"]
#[inline(always)]
pub const fn set_underfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn perris(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Set"]
#[inline(always)]
pub const fn set_perris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nakedis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Set"]
#[inline(always)]
pub const fn set_nakedis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn overfis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Set"]
#[inline(always)]
pub const fn set_overfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxstalldis(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Set"]
#[inline(always)]
pub const fn set_rxstalldis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn shortpacketis(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Set"]
#[inline(always)]
pub const fn set_shortpacketis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Set"]
#[must_use]
#[inline(always)]
pub const fn nbusybks(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Set"]
#[inline(always)]
pub const fn set_nbusybks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
}
impl Default for Hstpipifr0Intpipes {
#[inline(always)]
fn default() -> Hstpipifr0Intpipes {
Hstpipifr0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipifr0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipifr0Intpipes")
.field("rxinis", &self.rxinis())
.field("txoutis", &self.txoutis())
.field("underfis", &self.underfis())
.field("perris", &self.perris())
.field("nakedis", &self.nakedis())
.field("overfis", &self.overfis())
.field("rxstalldis", &self.rxstalldis())
.field("shortpacketis", &self.shortpacketis())
.field("nbusybks", &self.nbusybks())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipifr0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipifr0Intpipes {{ rxinis: {=bool:?}, txoutis: {=bool:?}, underfis: {=bool:?}, perris: {=bool:?}, nakedis: {=bool:?}, overfis: {=bool:?}, rxstalldis: {=bool:?}, shortpacketis: {=bool:?}, nbusybks: {=bool:?} }}",
self.rxinis(),
self.txoutis(),
self.underfis(),
self.perris(),
self.nakedis(),
self.overfis(),
self.rxstalldis(),
self.shortpacketis(),
self.nbusybks()
)
}
}
#[doc = "Host Pipe Set Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipifr0Isopipes(pub u32);
impl Hstpipifr0Isopipes {
#[doc = "Received IN Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn rxinis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Set"]
#[inline(always)]
pub const fn set_rxinis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn txoutis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Set"]
#[inline(always)]
pub const fn set_txoutis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn underfis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Set"]
#[inline(always)]
pub const fn set_underfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn perris(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Set"]
#[inline(always)]
pub const fn set_perris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn nakedis(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Set"]
#[inline(always)]
pub const fn set_nakedis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn overfis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Set"]
#[inline(always)]
pub const fn set_overfis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn crcerris(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Set"]
#[inline(always)]
pub const fn set_crcerris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn shortpacketis(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Set"]
#[inline(always)]
pub const fn set_shortpacketis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Set"]
#[must_use]
#[inline(always)]
pub const fn nbusybks(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Set"]
#[inline(always)]
pub const fn set_nbusybks(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
}
impl Default for Hstpipifr0Isopipes {
#[inline(always)]
fn default() -> Hstpipifr0Isopipes {
Hstpipifr0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipifr0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipifr0Isopipes")
.field("rxinis", &self.rxinis())
.field("txoutis", &self.txoutis())
.field("underfis", &self.underfis())
.field("perris", &self.perris())
.field("nakedis", &self.nakedis())
.field("overfis", &self.overfis())
.field("crcerris", &self.crcerris())
.field("shortpacketis", &self.shortpacketis())
.field("nbusybks", &self.nbusybks())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipifr0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipifr0Isopipes {{ rxinis: {=bool:?}, txoutis: {=bool:?}, underfis: {=bool:?}, perris: {=bool:?}, nakedis: {=bool:?}, overfis: {=bool:?}, crcerris: {=bool:?}, shortpacketis: {=bool:?}, nbusybks: {=bool:?} }}",
self.rxinis(),
self.txoutis(),
self.underfis(),
self.perris(),
self.nakedis(),
self.overfis(),
self.crcerris(),
self.shortpacketis(),
self.nbusybks()
)
}
}
#[doc = "Host Pipe Mask Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipimr(pub u32);
impl Hstpipimr {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxine(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoute(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txstpe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt Enable"]
#[inline(always)]
pub const fn set_txstpe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakede(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakede(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfie(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxstallde(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Enable"]
#[inline(always)]
pub const fn set_rxstallde(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketie(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybke(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[inline(always)]
pub const fn set_nbusybke(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocon(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocon(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdma(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdma(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze"]
#[must_use]
#[inline(always)]
pub const fn pfreeze(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze"]
#[inline(always)]
pub const fn set_pfreeze(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle"]
#[must_use]
#[inline(always)]
pub const fn rstdt(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle"]
#[inline(always)]
pub const fn set_rstdt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipimr {
#[inline(always)]
fn default() -> Hstpipimr {
Hstpipimr(0)
}
}
impl core::fmt::Debug for Hstpipimr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipimr")
.field("rxine", &self.rxine())
.field("txoute", &self.txoute())
.field("txstpe", &self.txstpe())
.field("perre", &self.perre())
.field("nakede", &self.nakede())
.field("overfie", &self.overfie())
.field("rxstallde", &self.rxstallde())
.field("shortpacketie", &self.shortpacketie())
.field("nbusybke", &self.nbusybke())
.field("fifocon", &self.fifocon())
.field("pdishdma", &self.pdishdma())
.field("pfreeze", &self.pfreeze())
.field("rstdt", &self.rstdt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipimr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipimr {{ rxine: {=bool:?}, txoute: {=bool:?}, txstpe: {=bool:?}, perre: {=bool:?}, nakede: {=bool:?}, overfie: {=bool:?}, rxstallde: {=bool:?}, shortpacketie: {=bool:?}, nbusybke: {=bool:?}, fifocon: {=bool:?}, pdishdma: {=bool:?}, pfreeze: {=bool:?}, rstdt: {=bool:?} }}",
self.rxine(),
self.txoute(),
self.txstpe(),
self.perre(),
self.nakede(),
self.overfie(),
self.rxstallde(),
self.shortpacketie(),
self.nbusybke(),
self.fifocon(),
self.pdishdma(),
self.pfreeze(),
self.rstdt()
)
}
}
#[doc = "Host Pipe Mask Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipimr0Intpipes(pub u32);
impl Hstpipimr0Intpipes {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxine(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoute(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn underfie(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Enable"]
#[inline(always)]
pub const fn set_underfie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakede(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakede(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfie(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxstallde(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt Enable"]
#[inline(always)]
pub const fn set_rxstallde(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketie(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybke(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[inline(always)]
pub const fn set_nbusybke(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocon(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocon(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdma(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdma(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze"]
#[must_use]
#[inline(always)]
pub const fn pfreeze(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze"]
#[inline(always)]
pub const fn set_pfreeze(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle"]
#[must_use]
#[inline(always)]
pub const fn rstdt(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle"]
#[inline(always)]
pub const fn set_rstdt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipimr0Intpipes {
#[inline(always)]
fn default() -> Hstpipimr0Intpipes {
Hstpipimr0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipimr0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipimr0Intpipes")
.field("rxine", &self.rxine())
.field("txoute", &self.txoute())
.field("underfie", &self.underfie())
.field("perre", &self.perre())
.field("nakede", &self.nakede())
.field("overfie", &self.overfie())
.field("rxstallde", &self.rxstallde())
.field("shortpacketie", &self.shortpacketie())
.field("nbusybke", &self.nbusybke())
.field("fifocon", &self.fifocon())
.field("pdishdma", &self.pdishdma())
.field("pfreeze", &self.pfreeze())
.field("rstdt", &self.rstdt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipimr0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipimr0Intpipes {{ rxine: {=bool:?}, txoute: {=bool:?}, underfie: {=bool:?}, perre: {=bool:?}, nakede: {=bool:?}, overfie: {=bool:?}, rxstallde: {=bool:?}, shortpacketie: {=bool:?}, nbusybke: {=bool:?}, fifocon: {=bool:?}, pdishdma: {=bool:?}, pfreeze: {=bool:?}, rstdt: {=bool:?} }}",
self.rxine(),
self.txoute(),
self.underfie(),
self.perre(),
self.nakede(),
self.overfie(),
self.rxstallde(),
self.shortpacketie(),
self.nbusybke(),
self.fifocon(),
self.pdishdma(),
self.pfreeze(),
self.rstdt()
)
}
}
#[doc = "Host Pipe Mask Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipimr0Isopipes(pub u32);
impl Hstpipimr0Isopipes {
#[doc = "Received IN Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rxine(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt Enable"]
#[inline(always)]
pub const fn set_rxine(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txoute(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt Enable"]
#[inline(always)]
pub const fn set_txoute(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn underfie(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt Enable"]
#[inline(always)]
pub const fn set_underfie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn perre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt Enable"]
#[inline(always)]
pub const fn set_perre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nakede(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt Enable"]
#[inline(always)]
pub const fn set_nakede(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn overfie(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt Enable"]
#[inline(always)]
pub const fn set_overfie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn crcerre(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt Enable"]
#[inline(always)]
pub const fn set_crcerre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn shortpacketie(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt Enable"]
#[inline(always)]
pub const fn set_shortpacketie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nbusybke(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Number of Busy Banks Interrupt Enable"]
#[inline(always)]
pub const fn set_nbusybke(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "FIFO Control"]
#[must_use]
#[inline(always)]
pub const fn fifocon(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "FIFO Control"]
#[inline(always)]
pub const fn set_fifocon(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[must_use]
#[inline(always)]
pub const fn pdishdma(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Pipe Interrupts Disable HDMA Request Enable"]
#[inline(always)]
pub const fn set_pdishdma(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Pipe Freeze"]
#[must_use]
#[inline(always)]
pub const fn pfreeze(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Pipe Freeze"]
#[inline(always)]
pub const fn set_pfreeze(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Reset Data Toggle"]
#[must_use]
#[inline(always)]
pub const fn rstdt(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Reset Data Toggle"]
#[inline(always)]
pub const fn set_rstdt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Hstpipimr0Isopipes {
#[inline(always)]
fn default() -> Hstpipimr0Isopipes {
Hstpipimr0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipimr0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipimr0Isopipes")
.field("rxine", &self.rxine())
.field("txoute", &self.txoute())
.field("underfie", &self.underfie())
.field("perre", &self.perre())
.field("nakede", &self.nakede())
.field("overfie", &self.overfie())
.field("crcerre", &self.crcerre())
.field("shortpacketie", &self.shortpacketie())
.field("nbusybke", &self.nbusybke())
.field("fifocon", &self.fifocon())
.field("pdishdma", &self.pdishdma())
.field("pfreeze", &self.pfreeze())
.field("rstdt", &self.rstdt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipimr0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipimr0Isopipes {{ rxine: {=bool:?}, txoute: {=bool:?}, underfie: {=bool:?}, perre: {=bool:?}, nakede: {=bool:?}, overfie: {=bool:?}, crcerre: {=bool:?}, shortpacketie: {=bool:?}, nbusybke: {=bool:?}, fifocon: {=bool:?}, pdishdma: {=bool:?}, pfreeze: {=bool:?}, rstdt: {=bool:?} }}",
self.rxine(),
self.txoute(),
self.underfie(),
self.perre(),
self.nakede(),
self.overfie(),
self.crcerre(),
self.shortpacketie(),
self.nbusybke(),
self.fifocon(),
self.pdishdma(),
self.pfreeze(),
self.rstdt()
)
}
}
#[doc = "Host Pipe IN Request Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipinrq(pub u32);
impl Hstpipinrq {
#[doc = "IN Request Number before Freeze"]
#[must_use]
#[inline(always)]
pub const fn inrq(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "IN Request Number before Freeze"]
#[inline(always)]
pub const fn set_inrq(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "IN Request Mode"]
#[must_use]
#[inline(always)]
pub const fn inmode(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "IN Request Mode"]
#[inline(always)]
pub const fn set_inmode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
}
impl Default for Hstpipinrq {
#[inline(always)]
fn default() -> Hstpipinrq {
Hstpipinrq(0)
}
}
impl core::fmt::Debug for Hstpipinrq {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipinrq")
.field("inrq", &self.inrq())
.field("inmode", &self.inmode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipinrq {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipinrq {{ inrq: {=u8:?}, inmode: {=bool:?} }}",
self.inrq(),
self.inmode()
)
}
}
#[doc = "Host Pipe Status Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipisr(pub u32);
impl Hstpipisr {
#[doc = "Received IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxini(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt"]
#[inline(always)]
pub const fn set_rxini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txouti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt"]
#[inline(always)]
pub const fn set_txouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitted SETUP Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txstpi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Transmitted SETUP Interrupt"]
#[inline(always)]
pub const fn set_txstpi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn perri(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt"]
#[inline(always)]
pub const fn set_perri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakedi(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt"]
#[inline(always)]
pub const fn set_nakedi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxstalldi(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt"]
#[inline(always)]
pub const fn set_rxstalldi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpacketi(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpacketi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Data Toggle Sequence"]
#[must_use]
#[inline(always)]
pub const fn dtseq(&self) -> super::vals::HstpipisrDtseq {
let val = (self.0 >> 8usize) & 0x03;
super::vals::HstpipisrDtseq::from_bits(val as u8)
}
#[doc = "Data Toggle Sequence"]
#[inline(always)]
pub const fn set_dtseq(&mut self, val: super::vals::HstpipisrDtseq) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Number of Busy Banks"]
#[must_use]
#[inline(always)]
pub const fn nbusybk(&self) -> super::vals::HstpipisrNbusybk {
let val = (self.0 >> 12usize) & 0x03;
super::vals::HstpipisrNbusybk::from_bits(val as u8)
}
#[doc = "Number of Busy Banks"]
#[inline(always)]
pub const fn set_nbusybk(&mut self, val: super::vals::HstpipisrNbusybk) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Current Bank"]
#[must_use]
#[inline(always)]
pub const fn currbk(&self) -> super::vals::HstpipisrCurrbk {
let val = (self.0 >> 14usize) & 0x03;
super::vals::HstpipisrCurrbk::from_bits(val as u8)
}
#[doc = "Current Bank"]
#[inline(always)]
pub const fn set_currbk(&mut self, val: super::vals::HstpipisrCurrbk) {
self.0 = (self.0 & !(0x03 << 14usize)) | (((val.to_bits() as u32) & 0x03) << 14usize);
}
#[doc = "Read-write Allowed"]
#[must_use]
#[inline(always)]
pub const fn rwall(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Read-write Allowed"]
#[inline(always)]
pub const fn set_rwall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Configuration OK Status"]
#[must_use]
#[inline(always)]
pub const fn cfgok(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Configuration OK Status"]
#[inline(always)]
pub const fn set_cfgok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Pipe Byte Count"]
#[must_use]
#[inline(always)]
pub const fn pbyct(&self) -> u16 {
let val = (self.0 >> 20usize) & 0x07ff;
val as u16
}
#[doc = "Pipe Byte Count"]
#[inline(always)]
pub const fn set_pbyct(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 20usize)) | (((val as u32) & 0x07ff) << 20usize);
}
}
impl Default for Hstpipisr {
#[inline(always)]
fn default() -> Hstpipisr {
Hstpipisr(0)
}
}
impl core::fmt::Debug for Hstpipisr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipisr")
.field("rxini", &self.rxini())
.field("txouti", &self.txouti())
.field("txstpi", &self.txstpi())
.field("perri", &self.perri())
.field("nakedi", &self.nakedi())
.field("overfi", &self.overfi())
.field("rxstalldi", &self.rxstalldi())
.field("shortpacketi", &self.shortpacketi())
.field("dtseq", &self.dtseq())
.field("nbusybk", &self.nbusybk())
.field("currbk", &self.currbk())
.field("rwall", &self.rwall())
.field("cfgok", &self.cfgok())
.field("pbyct", &self.pbyct())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipisr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipisr {{ rxini: {=bool:?}, txouti: {=bool:?}, txstpi: {=bool:?}, perri: {=bool:?}, nakedi: {=bool:?}, overfi: {=bool:?}, rxstalldi: {=bool:?}, shortpacketi: {=bool:?}, dtseq: {:?}, nbusybk: {:?}, currbk: {:?}, rwall: {=bool:?}, cfgok: {=bool:?}, pbyct: {=u16:?} }}",
self.rxini(),
self.txouti(),
self.txstpi(),
self.perri(),
self.nakedi(),
self.overfi(),
self.rxstalldi(),
self.shortpacketi(),
self.dtseq(),
self.nbusybk(),
self.currbk(),
self.rwall(),
self.cfgok(),
self.pbyct()
)
}
}
#[doc = "Host Pipe Status Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipisr0Intpipes(pub u32);
impl Hstpipisr0Intpipes {
#[doc = "Received IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxini(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt"]
#[inline(always)]
pub const fn set_rxini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txouti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt"]
#[inline(always)]
pub const fn set_txouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn underfi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt"]
#[inline(always)]
pub const fn set_underfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn perri(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt"]
#[inline(always)]
pub const fn set_perri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakedi(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt"]
#[inline(always)]
pub const fn set_nakedi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Received STALLed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxstalldi(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Received STALLed Interrupt"]
#[inline(always)]
pub const fn set_rxstalldi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpacketi(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpacketi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Data Toggle Sequence"]
#[must_use]
#[inline(always)]
pub const fn dtseq(&self) -> super::vals::Hstpipisr0IntpipesDtseq {
let val = (self.0 >> 8usize) & 0x03;
super::vals::Hstpipisr0IntpipesDtseq::from_bits(val as u8)
}
#[doc = "Data Toggle Sequence"]
#[inline(always)]
pub const fn set_dtseq(&mut self, val: super::vals::Hstpipisr0IntpipesDtseq) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Number of Busy Banks"]
#[must_use]
#[inline(always)]
pub const fn nbusybk(&self) -> super::vals::Hstpipisr0IntpipesNbusybk {
let val = (self.0 >> 12usize) & 0x03;
super::vals::Hstpipisr0IntpipesNbusybk::from_bits(val as u8)
}
#[doc = "Number of Busy Banks"]
#[inline(always)]
pub const fn set_nbusybk(&mut self, val: super::vals::Hstpipisr0IntpipesNbusybk) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Current Bank"]
#[must_use]
#[inline(always)]
pub const fn currbk(&self) -> super::vals::Hstpipisr0IntpipesCurrbk {
let val = (self.0 >> 14usize) & 0x03;
super::vals::Hstpipisr0IntpipesCurrbk::from_bits(val as u8)
}
#[doc = "Current Bank"]
#[inline(always)]
pub const fn set_currbk(&mut self, val: super::vals::Hstpipisr0IntpipesCurrbk) {
self.0 = (self.0 & !(0x03 << 14usize)) | (((val.to_bits() as u32) & 0x03) << 14usize);
}
#[doc = "Read-write Allowed"]
#[must_use]
#[inline(always)]
pub const fn rwall(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Read-write Allowed"]
#[inline(always)]
pub const fn set_rwall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Configuration OK Status"]
#[must_use]
#[inline(always)]
pub const fn cfgok(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Configuration OK Status"]
#[inline(always)]
pub const fn set_cfgok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Pipe Byte Count"]
#[must_use]
#[inline(always)]
pub const fn pbyct(&self) -> u16 {
let val = (self.0 >> 20usize) & 0x07ff;
val as u16
}
#[doc = "Pipe Byte Count"]
#[inline(always)]
pub const fn set_pbyct(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 20usize)) | (((val as u32) & 0x07ff) << 20usize);
}
}
impl Default for Hstpipisr0Intpipes {
#[inline(always)]
fn default() -> Hstpipisr0Intpipes {
Hstpipisr0Intpipes(0)
}
}
impl core::fmt::Debug for Hstpipisr0Intpipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipisr0Intpipes")
.field("rxini", &self.rxini())
.field("txouti", &self.txouti())
.field("underfi", &self.underfi())
.field("perri", &self.perri())
.field("nakedi", &self.nakedi())
.field("overfi", &self.overfi())
.field("rxstalldi", &self.rxstalldi())
.field("shortpacketi", &self.shortpacketi())
.field("dtseq", &self.dtseq())
.field("nbusybk", &self.nbusybk())
.field("currbk", &self.currbk())
.field("rwall", &self.rwall())
.field("cfgok", &self.cfgok())
.field("pbyct", &self.pbyct())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipisr0Intpipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipisr0Intpipes {{ rxini: {=bool:?}, txouti: {=bool:?}, underfi: {=bool:?}, perri: {=bool:?}, nakedi: {=bool:?}, overfi: {=bool:?}, rxstalldi: {=bool:?}, shortpacketi: {=bool:?}, dtseq: {:?}, nbusybk: {:?}, currbk: {:?}, rwall: {=bool:?}, cfgok: {=bool:?}, pbyct: {=u16:?} }}",
self.rxini(),
self.txouti(),
self.underfi(),
self.perri(),
self.nakedi(),
self.overfi(),
self.rxstalldi(),
self.shortpacketi(),
self.dtseq(),
self.nbusybk(),
self.currbk(),
self.rwall(),
self.cfgok(),
self.pbyct()
)
}
}
#[doc = "Host Pipe Status Register (n = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Hstpipisr0Isopipes(pub u32);
impl Hstpipisr0Isopipes {
#[doc = "Received IN Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn rxini(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Received IN Data Interrupt"]
#[inline(always)]
pub const fn set_rxini(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitted OUT Data Interrupt"]
#[must_use]
#[inline(always)]
pub const fn txouti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Transmitted OUT Data Interrupt"]
#[inline(always)]
pub const fn set_txouti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Underflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn underfi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Underflow Interrupt"]
#[inline(always)]
pub const fn set_underfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Pipe Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn perri(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Pipe Error Interrupt"]
#[inline(always)]
pub const fn set_perri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "NAKed Interrupt"]
#[must_use]
#[inline(always)]
pub const fn nakedi(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "NAKed Interrupt"]
#[inline(always)]
pub const fn set_nakedi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Overflow Interrupt"]
#[must_use]
#[inline(always)]
pub const fn overfi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Overflow Interrupt"]
#[inline(always)]
pub const fn set_overfi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "CRC Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn crcerri(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "CRC Error Interrupt"]
#[inline(always)]
pub const fn set_crcerri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Short Packet Interrupt"]
#[must_use]
#[inline(always)]
pub const fn shortpacketi(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Short Packet Interrupt"]
#[inline(always)]
pub const fn set_shortpacketi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Data Toggle Sequence"]
#[must_use]
#[inline(always)]
pub const fn dtseq(&self) -> super::vals::Hstpipisr0IsopipesDtseq {
let val = (self.0 >> 8usize) & 0x03;
super::vals::Hstpipisr0IsopipesDtseq::from_bits(val as u8)
}
#[doc = "Data Toggle Sequence"]
#[inline(always)]
pub const fn set_dtseq(&mut self, val: super::vals::Hstpipisr0IsopipesDtseq) {
self.0 = (self.0 & !(0x03 << 8usize)) | (((val.to_bits() as u32) & 0x03) << 8usize);
}
#[doc = "Number of Busy Banks"]
#[must_use]
#[inline(always)]
pub const fn nbusybk(&self) -> super::vals::Hstpipisr0IsopipesNbusybk {
let val = (self.0 >> 12usize) & 0x03;
super::vals::Hstpipisr0IsopipesNbusybk::from_bits(val as u8)
}
#[doc = "Number of Busy Banks"]
#[inline(always)]
pub const fn set_nbusybk(&mut self, val: super::vals::Hstpipisr0IsopipesNbusybk) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "Current Bank"]
#[must_use]
#[inline(always)]
pub const fn currbk(&self) -> super::vals::Hstpipisr0IsopipesCurrbk {
let val = (self.0 >> 14usize) & 0x03;
super::vals::Hstpipisr0IsopipesCurrbk::from_bits(val as u8)
}
#[doc = "Current Bank"]
#[inline(always)]
pub const fn set_currbk(&mut self, val: super::vals::Hstpipisr0IsopipesCurrbk) {
self.0 = (self.0 & !(0x03 << 14usize)) | (((val.to_bits() as u32) & 0x03) << 14usize);
}
#[doc = "Read-write Allowed"]
#[must_use]
#[inline(always)]
pub const fn rwall(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Read-write Allowed"]
#[inline(always)]
pub const fn set_rwall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Configuration OK Status"]
#[must_use]
#[inline(always)]
pub const fn cfgok(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Configuration OK Status"]
#[inline(always)]
pub const fn set_cfgok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Pipe Byte Count"]
#[must_use]
#[inline(always)]
pub const fn pbyct(&self) -> u16 {
let val = (self.0 >> 20usize) & 0x07ff;
val as u16
}
#[doc = "Pipe Byte Count"]
#[inline(always)]
pub const fn set_pbyct(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 20usize)) | (((val as u32) & 0x07ff) << 20usize);
}
}
impl Default for Hstpipisr0Isopipes {
#[inline(always)]
fn default() -> Hstpipisr0Isopipes {
Hstpipisr0Isopipes(0)
}
}
impl core::fmt::Debug for Hstpipisr0Isopipes {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Hstpipisr0Isopipes")
.field("rxini", &self.rxini())
.field("txouti", &self.txouti())
.field("underfi", &self.underfi())
.field("perri", &self.perri())
.field("nakedi", &self.nakedi())
.field("overfi", &self.overfi())
.field("crcerri", &self.crcerri())
.field("shortpacketi", &self.shortpacketi())
.field("dtseq", &self.dtseq())
.field("nbusybk", &self.nbusybk())
.field("currbk", &self.currbk())
.field("rwall", &self.rwall())
.field("cfgok", &self.cfgok())
.field("pbyct", &self.pbyct())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Hstpipisr0Isopipes {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Hstpipisr0Isopipes {{ rxini: {=bool:?}, txouti: {=bool:?}, underfi: {=bool:?}, perri: {=bool:?}, nakedi: {=bool:?}, overfi: {=bool:?}, crcerri: {=bool:?}, shortpacketi: {=bool:?}, dtseq: {:?}, nbusybk: {:?}, currbk: {:?}, rwall: {=bool:?}, cfgok: {=bool:?}, pbyct: {=u16:?} }}",
self.rxini(),
self.txouti(),
self.underfi(),
self.perri(),
self.nakedi(),
self.overfi(),
self.crcerri(),
self.shortpacketi(),
self.dtseq(),
self.nbusybk(),
self.currbk(),
self.rwall(),
self.cfgok(),
self.pbyct()
)
}
}
#[doc = "General Status Clear Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Scr(pub u32);
impl Scr {
#[doc = "ID Transition Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn idtic(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "ID Transition Interrupt Clear"]
#[inline(always)]
pub const fn set_idtic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "VBus Transition Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn vbustic(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "VBus Transition Interrupt Clear"]
#[inline(always)]
pub const fn set_vbustic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "SRP Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn srpic(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "SRP Interrupt Clear"]
#[inline(always)]
pub const fn set_srpic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "VBus Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn vberric(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "VBus Error Interrupt Clear"]
#[inline(always)]
pub const fn set_vberric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "B-Connection Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn bcerric(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "B-Connection Error Interrupt Clear"]
#[inline(always)]
pub const fn set_bcerric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Role Exchange Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn roleexic(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Role Exchange Interrupt Clear"]
#[inline(always)]
pub const fn set_roleexic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "HNP Error Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn hnperric(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "HNP Error Interrupt Clear"]
#[inline(always)]
pub const fn set_hnperric(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Suspend Time-Out Interrupt Clear"]
#[must_use]
#[inline(always)]
pub const fn stoic(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Suspend Time-Out Interrupt Clear"]
#[inline(always)]
pub const fn set_stoic(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "VBus Request Clear"]
#[must_use]
#[inline(always)]
pub const fn vbusrqc(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "VBus Request Clear"]
#[inline(always)]
pub const fn set_vbusrqc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
}
impl Default for Scr {
#[inline(always)]
fn default() -> Scr {
Scr(0)
}
}
impl core::fmt::Debug for Scr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Scr")
.field("idtic", &self.idtic())
.field("vbustic", &self.vbustic())
.field("srpic", &self.srpic())
.field("vberric", &self.vberric())
.field("bcerric", &self.bcerric())
.field("roleexic", &self.roleexic())
.field("hnperric", &self.hnperric())
.field("stoic", &self.stoic())
.field("vbusrqc", &self.vbusrqc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Scr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Scr {{ idtic: {=bool:?}, vbustic: {=bool:?}, srpic: {=bool:?}, vberric: {=bool:?}, bcerric: {=bool:?}, roleexic: {=bool:?}, hnperric: {=bool:?}, stoic: {=bool:?}, vbusrqc: {=bool:?} }}",
self.idtic(),
self.vbustic(),
self.srpic(),
self.vberric(),
self.bcerric(),
self.roleexic(),
self.hnperric(),
self.stoic(),
self.vbusrqc()
)
}
}
#[doc = "General Status Set Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Sfr(pub u32);
impl Sfr {
#[doc = "ID Transition Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn idtis(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "ID Transition Interrupt Set"]
#[inline(always)]
pub const fn set_idtis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "VBus Transition Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn vbustis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "VBus Transition Interrupt Set"]
#[inline(always)]
pub const fn set_vbustis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "SRP Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn srpis(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "SRP Interrupt Set"]
#[inline(always)]
pub const fn set_srpis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "VBus Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn vberris(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "VBus Error Interrupt Set"]
#[inline(always)]
pub const fn set_vberris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "B-Connection Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn bcerris(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "B-Connection Error Interrupt Set"]
#[inline(always)]
pub const fn set_bcerris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Role Exchange Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn roleexis(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Role Exchange Interrupt Set"]
#[inline(always)]
pub const fn set_roleexis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "HNP Error Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn hnperris(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "HNP Error Interrupt Set"]
#[inline(always)]
pub const fn set_hnperris(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Suspend Time-Out Interrupt Set"]
#[must_use]
#[inline(always)]
pub const fn stois(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Suspend Time-Out Interrupt Set"]
#[inline(always)]
pub const fn set_stois(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "VBus Request Set"]
#[must_use]
#[inline(always)]
pub const fn vbusrqs(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "VBus Request Set"]
#[inline(always)]
pub const fn set_vbusrqs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
}
impl Default for Sfr {
#[inline(always)]
fn default() -> Sfr {
Sfr(0)
}
}
impl core::fmt::Debug for Sfr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Sfr")
.field("idtis", &self.idtis())
.field("vbustis", &self.vbustis())
.field("srpis", &self.srpis())
.field("vberris", &self.vberris())
.field("bcerris", &self.bcerris())
.field("roleexis", &self.roleexis())
.field("hnperris", &self.hnperris())
.field("stois", &self.stois())
.field("vbusrqs", &self.vbusrqs())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Sfr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Sfr {{ idtis: {=bool:?}, vbustis: {=bool:?}, srpis: {=bool:?}, vberris: {=bool:?}, bcerris: {=bool:?}, roleexis: {=bool:?}, hnperris: {=bool:?}, stois: {=bool:?}, vbusrqs: {=bool:?} }}",
self.idtis(),
self.vbustis(),
self.srpis(),
self.vberris(),
self.bcerris(),
self.roleexis(),
self.hnperris(),
self.stois(),
self.vbusrqs()
)
}
}
#[doc = "General Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Sr(pub u32);
impl Sr {
#[doc = "ID Transition Interrupt"]
#[must_use]
#[inline(always)]
pub const fn idti(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "ID Transition Interrupt"]
#[inline(always)]
pub const fn set_idti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "VBus Transition Interrupt"]
#[must_use]
#[inline(always)]
pub const fn vbusti(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "VBus Transition Interrupt"]
#[inline(always)]
pub const fn set_vbusti(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "SRP Interrupt"]
#[must_use]
#[inline(always)]
pub const fn srpi(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "SRP Interrupt"]
#[inline(always)]
pub const fn set_srpi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "VBus Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn vberri(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "VBus Error Interrupt"]
#[inline(always)]
pub const fn set_vberri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "B-Connection Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn bcerri(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "B-Connection Error Interrupt"]
#[inline(always)]
pub const fn set_bcerri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Role Exchange Interrupt"]
#[must_use]
#[inline(always)]
pub const fn roleexi(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Role Exchange Interrupt"]
#[inline(always)]
pub const fn set_roleexi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "HNP Error Interrupt"]
#[must_use]
#[inline(always)]
pub const fn hnperri(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "HNP Error Interrupt"]
#[inline(always)]
pub const fn set_hnperri(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Suspend Time-Out Interrupt"]
#[must_use]
#[inline(always)]
pub const fn stoi(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Suspend Time-Out Interrupt"]
#[inline(always)]
pub const fn set_stoi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "VBus Request"]
#[must_use]
#[inline(always)]
pub const fn vbusrq(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "VBus Request"]
#[inline(always)]
pub const fn set_vbusrq(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "UOTGID Pin State"]
#[must_use]
#[inline(always)]
pub const fn id(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "UOTGID Pin State"]
#[inline(always)]
pub const fn set_id(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "VBus Level"]
#[must_use]
#[inline(always)]
pub const fn vbus(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "VBus Level"]
#[inline(always)]
pub const fn set_vbus(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Speed Status"]
#[must_use]
#[inline(always)]
pub const fn speed(&self) -> super::vals::Speed {
let val = (self.0 >> 12usize) & 0x03;
super::vals::Speed::from_bits(val as u8)
}
#[doc = "Speed Status"]
#[inline(always)]
pub const fn set_speed(&mut self, val: super::vals::Speed) {
self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
}
#[doc = "UTMI Clock Usable"]
#[must_use]
#[inline(always)]
pub const fn clkusable(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "UTMI Clock Usable"]
#[inline(always)]
pub const fn set_clkusable(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
}
impl Default for Sr {
#[inline(always)]
fn default() -> Sr {
Sr(0)
}
}
impl core::fmt::Debug for Sr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Sr")
.field("idti", &self.idti())
.field("vbusti", &self.vbusti())
.field("srpi", &self.srpi())
.field("vberri", &self.vberri())
.field("bcerri", &self.bcerri())
.field("roleexi", &self.roleexi())
.field("hnperri", &self.hnperri())
.field("stoi", &self.stoi())
.field("vbusrq", &self.vbusrq())
.field("id", &self.id())
.field("vbus", &self.vbus())
.field("speed", &self.speed())
.field("clkusable", &self.clkusable())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Sr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Sr {{ idti: {=bool:?}, vbusti: {=bool:?}, srpi: {=bool:?}, vberri: {=bool:?}, bcerri: {=bool:?}, roleexi: {=bool:?}, hnperri: {=bool:?}, stoi: {=bool:?}, vbusrq: {=bool:?}, id: {=bool:?}, vbus: {=bool:?}, speed: {:?}, clkusable: {=bool:?} }}",
self.idti(),
self.vbusti(),
self.srpi(),
self.vberri(),
self.bcerri(),
self.roleexi(),
self.hnperri(),
self.stoi(),
self.vbusrq(),
self.id(),
self.vbus(),
self.speed(),
self.clkusable()
)
}
}