#[doc = "SMC NFC Address Cycle Zero Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Addr(pub u32);
impl Addr {
#[doc = "NAND Flash Array Address cycle 0"]
#[must_use]
#[inline(always)]
pub const fn addr_cycle0(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "NAND Flash Array Address cycle 0"]
#[inline(always)]
pub const fn set_addr_cycle0(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
}
impl Default for Addr {
#[inline(always)]
fn default() -> Addr {
Addr(0)
}
}
impl core::fmt::Debug for Addr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Addr")
.field("addr_cycle0", &self.addr_cycle0())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Addr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Addr {{ addr_cycle0: {=u8:?} }}", self.addr_cycle0())
}
}
#[doc = "SMC Bank Address Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Bank(pub u32);
impl Bank {
#[doc = "Bank Identifier"]
#[must_use]
#[inline(always)]
pub const fn bank(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Bank Identifier"]
#[inline(always)]
pub const fn set_bank(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
}
impl Default for Bank {
#[inline(always)]
fn default() -> Bank {
Bank(0)
}
}
impl core::fmt::Debug for Bank {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Bank").field("bank", &self.bank()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Bank {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Bank {{ bank: {=u8:?} }}", self.bank())
}
}
#[doc = "SMC NFC Configuration Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg(pub u32);
impl Cfg {
#[doc = "Page Size of the NAND Flash Device"]
#[must_use]
#[inline(always)]
pub const fn pagesize(&self) -> super::vals::Pagesize {
let val = (self.0 >> 0usize) & 0x03;
super::vals::Pagesize::from_bits(val as u8)
}
#[doc = "Page Size of the NAND Flash Device"]
#[inline(always)]
pub const fn set_pagesize(&mut self, val: super::vals::Pagesize) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val.to_bits() as u32) & 0x03) << 0usize);
}
#[doc = "Write Spare Area"]
#[must_use]
#[inline(always)]
pub const fn wspare(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Write Spare Area"]
#[inline(always)]
pub const fn set_wspare(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Read Spare Area"]
#[must_use]
#[inline(always)]
pub const fn rspare(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Read Spare Area"]
#[inline(always)]
pub const fn set_rspare(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Rising/Falling Edge Detection Control"]
#[must_use]
#[inline(always)]
pub const fn edgectrl(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Rising/Falling Edge Detection Control"]
#[inline(always)]
pub const fn set_edgectrl(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready/Busy Signal Edge Detection"]
#[must_use]
#[inline(always)]
pub const fn rbedge(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Ready/Busy Signal Edge Detection"]
#[inline(always)]
pub const fn set_rbedge(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Data Timeout Cycle Number"]
#[must_use]
#[inline(always)]
pub const fn dtocyc(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Timeout Cycle Number"]
#[inline(always)]
pub const fn set_dtocyc(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "Data Timeout Multiplier"]
#[must_use]
#[inline(always)]
pub const fn dtomul(&self) -> super::vals::Dtomul {
let val = (self.0 >> 20usize) & 0x07;
super::vals::Dtomul::from_bits(val as u8)
}
#[doc = "Data Timeout Multiplier"]
#[inline(always)]
pub const fn set_dtomul(&mut self, val: super::vals::Dtomul) {
self.0 = (self.0 & !(0x07 << 20usize)) | (((val.to_bits() as u32) & 0x07) << 20usize);
}
}
impl Default for Cfg {
#[inline(always)]
fn default() -> Cfg {
Cfg(0)
}
}
impl core::fmt::Debug for Cfg {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg")
.field("pagesize", &self.pagesize())
.field("wspare", &self.wspare())
.field("rspare", &self.rspare())
.field("edgectrl", &self.edgectrl())
.field("rbedge", &self.rbedge())
.field("dtocyc", &self.dtocyc())
.field("dtomul", &self.dtomul())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cfg {{ pagesize: {:?}, wspare: {=bool:?}, rspare: {=bool:?}, edgectrl: {=bool:?}, rbedge: {=bool:?}, dtocyc: {=u8:?}, dtomul: {:?} }}",
self.pagesize(),
self.wspare(),
self.rspare(),
self.edgectrl(),
self.rbedge(),
self.dtocyc(),
self.dtomul()
)
}
}
#[doc = "SMC NFC Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ctrl(pub u32);
impl Ctrl {
#[doc = "NAND Flash Controller Enable"]
#[must_use]
#[inline(always)]
pub const fn nfcen(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Controller Enable"]
#[inline(always)]
pub const fn set_nfcen(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "NAND Flash Controller Disable"]
#[must_use]
#[inline(always)]
pub const fn nfcdis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Controller Disable"]
#[inline(always)]
pub const fn set_nfcdis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
}
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("nfcen", &self.nfcen())
.field("nfcdis", &self.nfcdis())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ctrl {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ctrl {{ nfcen: {=bool:?}, nfcdis: {=bool:?} }}",
self.nfcen(),
self.nfcdis()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle0(pub u32);
impl Cycle0 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle0 {
#[inline(always)]
fn default() -> Cycle0 {
Cycle0(0)
}
}
impl core::fmt::Debug for Cycle0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle0")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle0 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle1(pub u32);
impl Cycle1 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle1 {
#[inline(always)]
fn default() -> Cycle1 {
Cycle1(0)
}
}
impl core::fmt::Debug for Cycle1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle1")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle1 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle2(pub u32);
impl Cycle2 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle2 {
#[inline(always)]
fn default() -> Cycle2 {
Cycle2(0)
}
}
impl core::fmt::Debug for Cycle2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle2")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle2 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle3(pub u32);
impl Cycle3 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle3 {
#[inline(always)]
fn default() -> Cycle3 {
Cycle3(0)
}
}
impl core::fmt::Debug for Cycle3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle3")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle3 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle4(pub u32);
impl Cycle4 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle4 {
#[inline(always)]
fn default() -> Cycle4 {
Cycle4(0)
}
}
impl core::fmt::Debug for Cycle4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle4")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle4 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle5(pub u32);
impl Cycle5 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle5 {
#[inline(always)]
fn default() -> Cycle5 {
Cycle5(0)
}
}
impl core::fmt::Debug for Cycle5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle5")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle5 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle6(pub u32);
impl Cycle6 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle6 {
#[inline(always)]
fn default() -> Cycle6 {
Cycle6(0)
}
}
impl core::fmt::Debug for Cycle6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle6")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle6 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC Cycle Register (CS_number = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cycle7(pub u32);
impl Cycle7 {
#[doc = "Total Write Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_cycle(&self) -> u16 {
let val = (self.0 >> 0usize) & 0x01ff;
val as u16
}
#[doc = "Total Write Cycle Length"]
#[inline(always)]
pub const fn set_nwe_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
}
#[doc = "Total Read Cycle Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_cycle(&self) -> u16 {
let val = (self.0 >> 16usize) & 0x01ff;
val as u16
}
#[doc = "Total Read Cycle Length"]
#[inline(always)]
pub const fn set_nrd_cycle(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 16usize)) | (((val as u32) & 0x01ff) << 16usize);
}
}
impl Default for Cycle7 {
#[inline(always)]
fn default() -> Cycle7 {
Cycle7(0)
}
}
impl core::fmt::Debug for Cycle7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cycle7")
.field("nwe_cycle", &self.nwe_cycle())
.field("nrd_cycle", &self.nrd_cycle())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cycle7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cycle7 {{ nwe_cycle: {=u16:?}, nrd_cycle: {=u16:?} }}",
self.nwe_cycle(),
self.nrd_cycle()
)
}
}
#[doc = "SMC ECC Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccCtrl(pub u32);
impl EccCtrl {
#[doc = "Reset ECC"]
#[must_use]
#[inline(always)]
pub const fn rst(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Reset ECC"]
#[inline(always)]
pub const fn set_rst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Software Reset"]
#[must_use]
#[inline(always)]
pub const fn swrst(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Software Reset"]
#[inline(always)]
pub const fn set_swrst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
}
impl Default for EccCtrl {
#[inline(always)]
fn default() -> EccCtrl {
EccCtrl(0)
}
}
impl core::fmt::Debug for EccCtrl {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccCtrl")
.field("rst", &self.rst())
.field("swrst", &self.swrst())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccCtrl {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccCtrl {{ rst: {=bool:?}, swrst: {=bool:?} }}",
self.rst(),
self.swrst()
)
}
}
#[doc = "SMC ECC Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccMd(pub u32);
impl EccMd {
#[doc = "ECC Page Size"]
#[must_use]
#[inline(always)]
pub const fn ecc_pagesize(&self) -> super::vals::EccPagesize {
let val = (self.0 >> 0usize) & 0x03;
super::vals::EccPagesize::from_bits(val as u8)
}
#[doc = "ECC Page Size"]
#[inline(always)]
pub const fn set_ecc_pagesize(&mut self, val: super::vals::EccPagesize) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val.to_bits() as u32) & 0x03) << 0usize);
}
#[doc = "Type of Correction"]
#[must_use]
#[inline(always)]
pub const fn typcorrec(&self) -> super::vals::Typcorrec {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Typcorrec::from_bits(val as u8)
}
#[doc = "Type of Correction"]
#[inline(always)]
pub const fn set_typcorrec(&mut self, val: super::vals::Typcorrec) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
}
impl Default for EccMd {
#[inline(always)]
fn default() -> EccMd {
EccMd(0)
}
}
impl core::fmt::Debug for EccMd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccMd")
.field("ecc_pagesize", &self.ecc_pagesize())
.field("typcorrec", &self.typcorrec())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccMd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccMd {{ ecc_pagesize: {:?}, typcorrec: {:?} }}",
self.ecc_pagesize(),
self.typcorrec()
)
}
}
#[doc = "SMC ECC Parity 0 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr0(pub u32);
impl EccPr0 {
#[doc = "Bit Address"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "Bit Address"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "Word Address"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 4usize) & 0x0fff;
val as u16
}
#[doc = "Word Address"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize);
}
}
impl Default for EccPr0 {
#[inline(always)]
fn default() -> EccPr0 {
EccPr0(0)
}
}
impl core::fmt::Debug for EccPr0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr0")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr0 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?} }}",
self.bitaddr(),
self.wordaddr()
)
}
}
#[doc = "SMC ECC Parity 0 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr0W8bit(pub u32);
impl EccPr0W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr0W8bit {
#[inline(always)]
fn default() -> EccPr0W8bit {
EccPr0W8bit(0)
}
}
impl core::fmt::Debug for EccPr0W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr0W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr0W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr0W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC Parity 0 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr0W9bit(pub u32);
impl EccPr0W9bit {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr0W9bit {
#[inline(always)]
fn default() -> EccPr0W9bit {
EccPr0W9bit(0)
}
}
impl core::fmt::Debug for EccPr0W9bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr0W9bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr0W9bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr0W9bit {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr1(pub u32);
impl EccPr1 {
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for EccPr1 {
#[inline(always)]
fn default() -> EccPr1 {
EccPr1(0)
}
}
impl core::fmt::Debug for EccPr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr1")
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "EccPr1 {{ nparity: {=u16:?} }}", self.nparity())
}
}
#[doc = "SMC ECC parity 10 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr10(pub u32);
impl EccPr10 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr10 {
#[inline(always)]
fn default() -> EccPr10 {
EccPr10(0)
}
}
impl core::fmt::Debug for EccPr10 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr10")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr10 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr10 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 11 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr11(pub u32);
impl EccPr11 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr11 {
#[inline(always)]
fn default() -> EccPr11 {
EccPr11(0)
}
}
impl core::fmt::Debug for EccPr11 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr11")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr11 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr11 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 12 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr12(pub u32);
impl EccPr12 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr12 {
#[inline(always)]
fn default() -> EccPr12 {
EccPr12(0)
}
}
impl core::fmt::Debug for EccPr12 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr12")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr12 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr12 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 13 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr13(pub u32);
impl EccPr13 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr13 {
#[inline(always)]
fn default() -> EccPr13 {
EccPr13(0)
}
}
impl core::fmt::Debug for EccPr13 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr13")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr13 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr13 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 14 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr14(pub u32);
impl EccPr14 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr14 {
#[inline(always)]
fn default() -> EccPr14 {
EccPr14(0)
}
}
impl core::fmt::Debug for EccPr14 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr14")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr14 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr14 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 15 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr15(pub u32);
impl EccPr15 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr15 {
#[inline(always)]
fn default() -> EccPr15 {
EccPr15(0)
}
}
impl core::fmt::Debug for EccPr15 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr15")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr15 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr15 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr1W8bit(pub u32);
impl EccPr1W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr1W8bit {
#[inline(always)]
fn default() -> EccPr1W8bit {
EccPr1W8bit(0)
}
}
impl core::fmt::Debug for EccPr1W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr1W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr1W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr1W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr1W9bit(pub u32);
impl EccPr1W9bit {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr1W9bit {
#[inline(always)]
fn default() -> EccPr1W9bit {
EccPr1W9bit(0)
}
}
impl core::fmt::Debug for EccPr1W9bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr1W9bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr1W9bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr1W9bit {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 2 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr2(pub u32);
impl EccPr2 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr2 {
#[inline(always)]
fn default() -> EccPr2 {
EccPr2(0)
}
}
impl core::fmt::Debug for EccPr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr2")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr2 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 2 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr2W8bit(pub u32);
impl EccPr2W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr2W8bit {
#[inline(always)]
fn default() -> EccPr2W8bit {
EccPr2W8bit(0)
}
}
impl core::fmt::Debug for EccPr2W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr2W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr2W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr2W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 3 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr3(pub u32);
impl EccPr3 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr3 {
#[inline(always)]
fn default() -> EccPr3 {
EccPr3(0)
}
}
impl core::fmt::Debug for EccPr3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr3")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr3 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 3 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr3W8bit(pub u32);
impl EccPr3W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr3W8bit {
#[inline(always)]
fn default() -> EccPr3W8bit {
EccPr3W8bit(0)
}
}
impl core::fmt::Debug for EccPr3W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr3W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr3W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr3W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 4 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr4(pub u32);
impl EccPr4 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr4 {
#[inline(always)]
fn default() -> EccPr4 {
EccPr4(0)
}
}
impl core::fmt::Debug for EccPr4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr4")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr4 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 4 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr4W8bit(pub u32);
impl EccPr4W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr4W8bit {
#[inline(always)]
fn default() -> EccPr4W8bit {
EccPr4W8bit(0)
}
}
impl core::fmt::Debug for EccPr4W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr4W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr4W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr4W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 5 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr5(pub u32);
impl EccPr5 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr5 {
#[inline(always)]
fn default() -> EccPr5 {
EccPr5(0)
}
}
impl core::fmt::Debug for EccPr5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr5")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr5 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 5 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr5W8bit(pub u32);
impl EccPr5W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr5W8bit {
#[inline(always)]
fn default() -> EccPr5W8bit {
EccPr5W8bit(0)
}
}
impl core::fmt::Debug for EccPr5W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr5W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr5W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr5W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 6 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr6(pub u32);
impl EccPr6 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr6 {
#[inline(always)]
fn default() -> EccPr6 {
EccPr6(0)
}
}
impl core::fmt::Debug for EccPr6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr6")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr6 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 6 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr6W8bit(pub u32);
impl EccPr6W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr6W8bit {
#[inline(always)]
fn default() -> EccPr6W8bit {
EccPr6W8bit(0)
}
}
impl core::fmt::Debug for EccPr6W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr6W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr6W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr6W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 7 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr7(pub u32);
impl EccPr7 {
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u16 {
let val = (self.0 >> 3usize) & 0x01ff;
val as u16
}
#[doc = "Corrupted Word Address in the Page between (i x 512) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u16) {
self.0 = (self.0 & !(0x01ff << 3usize)) | (((val as u32) & 0x01ff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x0fff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x0fff << 12usize)) | (((val as u32) & 0x0fff) << 12usize);
}
}
impl Default for EccPr7 {
#[inline(always)]
fn default() -> EccPr7 {
EccPr7(0)
}
}
impl core::fmt::Debug for EccPr7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr7")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr7 {{ bitaddr: {=u8:?}, wordaddr: {=u16:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 7 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr7W8bit(pub u32);
impl EccPr7W8bit {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr7W8bit {
#[inline(always)]
fn default() -> EccPr7W8bit {
EccPr7W8bit(0)
}
}
impl core::fmt::Debug for EccPr7W8bit {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr7W8bit")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr7W8bit {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr7W8bit {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 8 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr8(pub u32);
impl EccPr8 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr8 {
#[inline(always)]
fn default() -> EccPr8 {
EccPr8(0)
}
}
impl core::fmt::Debug for EccPr8 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr8")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr8 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr8 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC parity 9 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccPr9(pub u32);
impl EccPr9 {
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn bitaddr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x07;
val as u8
}
#[doc = "Corrupted Bit Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_bitaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[must_use]
#[inline(always)]
pub const fn wordaddr(&self) -> u8 {
let val = (self.0 >> 3usize) & 0xff;
val as u8
}
#[doc = "Corrupted Word Address in the Page between (i x 256) and ((i + 1) x 512) - 1) Bytes"]
#[inline(always)]
pub const fn set_wordaddr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 3usize)) | (((val as u32) & 0xff) << 3usize);
}
#[doc = "Parity N"]
#[must_use]
#[inline(always)]
pub const fn nparity(&self) -> u16 {
let val = (self.0 >> 12usize) & 0x07ff;
val as u16
}
#[doc = "Parity N"]
#[inline(always)]
pub const fn set_nparity(&mut self, val: u16) {
self.0 = (self.0 & !(0x07ff << 12usize)) | (((val as u32) & 0x07ff) << 12usize);
}
}
impl Default for EccPr9 {
#[inline(always)]
fn default() -> EccPr9 {
EccPr9(0)
}
}
impl core::fmt::Debug for EccPr9 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccPr9")
.field("bitaddr", &self.bitaddr())
.field("wordaddr", &self.wordaddr())
.field("nparity", &self.nparity())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccPr9 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccPr9 {{ bitaddr: {=u8:?}, wordaddr: {=u8:?}, nparity: {=u16:?} }}",
self.bitaddr(),
self.wordaddr(),
self.nparity()
)
}
}
#[doc = "SMC ECC Status 1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccSr1(pub u32);
impl EccSr1 {
#[doc = "Recoverable Error"]
#[must_use]
#[inline(always)]
pub const fn recerr0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error"]
#[inline(always)]
pub const fn set_recerr0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "ECC Error"]
#[must_use]
#[inline(always)]
pub const fn eccerr0(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "ECC Error"]
#[inline(always)]
pub const fn set_eccerr0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Multiple Error"]
#[must_use]
#[inline(always)]
pub const fn mulerr0(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Multiple Error"]
#[inline(always)]
pub const fn set_mulerr0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Recoverable Error in the page between the 256th and the 511th bytes or the 512nd and the 1023rd bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr1(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 256th and the 511th bytes or the 512nd and the 1023rd bytes"]
#[inline(always)]
pub const fn set_recerr1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "ECC Error in the page between the 256th and the 511th bytes or between the 512nd and the 1023rd bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr1(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 256th and the 511th bytes or between the 512nd and the 1023rd bytes"]
#[inline(always)]
pub const fn set_eccerr1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Multiple Error in the page between the 256th and the 511th bytes or between the 512nd and the 1023rd bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr1(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 256th and the 511th bytes or between the 512nd and the 1023rd bytes"]
#[inline(always)]
pub const fn set_mulerr1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Recoverable Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr2(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[inline(always)]
pub const fn set_recerr2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "ECC Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr2(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[inline(always)]
pub const fn set_eccerr2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Multiple Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 512nd and the 767th bytes or between the 1024th and the 1535th bytes"]
#[inline(always)]
pub const fn set_mulerr2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Recoverable Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr3(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[inline(always)]
pub const fn set_recerr3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "ECC Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr3(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[inline(always)]
pub const fn set_eccerr3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Multiple Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr3(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 768th and the 1023rd bytes or between the 1536th and the 2047th bytes"]
#[inline(always)]
pub const fn set_mulerr3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Recoverable Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr4(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[inline(always)]
pub const fn set_recerr4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "ECC Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr4(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[inline(always)]
pub const fn set_eccerr4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Multiple Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr4(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 1024th and the 1279th bytes or between the 2048th and the 2559th bytes"]
#[inline(always)]
pub const fn set_mulerr4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Recoverable Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr5(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[inline(always)]
pub const fn set_recerr5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "ECC Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[inline(always)]
pub const fn set_eccerr5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Multiple Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr5(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 1280th and the 1535th bytes or between the 2560th and the 3071st bytes"]
#[inline(always)]
pub const fn set_mulerr5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Recoverable Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr6(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[inline(always)]
pub const fn set_recerr6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
#[doc = "ECC Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr6(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[inline(always)]
pub const fn set_eccerr6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "Multiple Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr6(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 1536th and the 1791st bytes or between the 3072nd and the 3583rd bytes"]
#[inline(always)]
pub const fn set_mulerr6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "Recoverable Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr7(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[inline(always)]
pub const fn set_recerr7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "ECC Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr7(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[inline(always)]
pub const fn set_eccerr7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "Multiple Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr7(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 1792nd and the 2047th bytes or between the 3584th and the 4095th bytes"]
#[inline(always)]
pub const fn set_mulerr7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for EccSr1 {
#[inline(always)]
fn default() -> EccSr1 {
EccSr1(0)
}
}
impl core::fmt::Debug for EccSr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccSr1")
.field("recerr0", &self.recerr0())
.field("eccerr0", &self.eccerr0())
.field("mulerr0", &self.mulerr0())
.field("recerr1", &self.recerr1())
.field("eccerr1", &self.eccerr1())
.field("mulerr1", &self.mulerr1())
.field("recerr2", &self.recerr2())
.field("eccerr2", &self.eccerr2())
.field("mulerr2", &self.mulerr2())
.field("recerr3", &self.recerr3())
.field("eccerr3", &self.eccerr3())
.field("mulerr3", &self.mulerr3())
.field("recerr4", &self.recerr4())
.field("eccerr4", &self.eccerr4())
.field("mulerr4", &self.mulerr4())
.field("recerr5", &self.recerr5())
.field("eccerr5", &self.eccerr5())
.field("mulerr5", &self.mulerr5())
.field("recerr6", &self.recerr6())
.field("eccerr6", &self.eccerr6())
.field("mulerr6", &self.mulerr6())
.field("recerr7", &self.recerr7())
.field("eccerr7", &self.eccerr7())
.field("mulerr7", &self.mulerr7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccSr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccSr1 {{ recerr0: {=bool:?}, eccerr0: {=bool:?}, mulerr0: {=bool:?}, recerr1: {=bool:?}, eccerr1: {=bool:?}, mulerr1: {=bool:?}, recerr2: {=bool:?}, eccerr2: {=bool:?}, mulerr2: {=bool:?}, recerr3: {=bool:?}, eccerr3: {=bool:?}, mulerr3: {=bool:?}, recerr4: {=bool:?}, eccerr4: {=bool:?}, mulerr4: {=bool:?}, recerr5: {=bool:?}, eccerr5: {=bool:?}, mulerr5: {=bool:?}, recerr6: {=bool:?}, eccerr6: {=bool:?}, mulerr6: {=bool:?}, recerr7: {=bool:?}, eccerr7: {=bool:?}, mulerr7: {=bool:?} }}",
self.recerr0(),
self.eccerr0(),
self.mulerr0(),
self.recerr1(),
self.eccerr1(),
self.mulerr1(),
self.recerr2(),
self.eccerr2(),
self.mulerr2(),
self.recerr3(),
self.eccerr3(),
self.mulerr3(),
self.recerr4(),
self.eccerr4(),
self.mulerr4(),
self.recerr5(),
self.eccerr5(),
self.mulerr5(),
self.recerr6(),
self.eccerr6(),
self.mulerr6(),
self.recerr7(),
self.eccerr7(),
self.mulerr7()
)
}
}
#[doc = "SMC ECC status 2 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct EccSr2(pub u32);
impl EccSr2 {
#[doc = "Recoverable Error in the page between the 2048th and the 2303rd bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr8(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 2048th and the 2303rd bytes"]
#[inline(always)]
pub const fn set_recerr8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "ECC Error in the page between the 2048th and the 2303rd bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr8(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 2048th and the 2303rd bytes"]
#[inline(always)]
pub const fn set_eccerr8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Multiple Error in the page between the 2048th and the 2303rd bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr8(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 2048th and the 2303rd bytes"]
#[inline(always)]
pub const fn set_mulerr8(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Recoverable Error in the page between the 2304th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr9(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 2304th and the 2559th bytes"]
#[inline(always)]
pub const fn set_recerr9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "ECC Error in the page between the 2304th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr9(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 2304th and the 2559th bytes"]
#[inline(always)]
pub const fn set_eccerr9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Multiple Error in the page between the 2304th and the 2559th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr9(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 2304th and the 2559th bytes"]
#[inline(always)]
pub const fn set_mulerr9(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Recoverable Error in the page between the 2560th and the 2815th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr10(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 2560th and the 2815th bytes"]
#[inline(always)]
pub const fn set_recerr10(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "ECC Error in the page between the 2560th and the 2815th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr10(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 2560th and the 2815th bytes"]
#[inline(always)]
pub const fn set_eccerr10(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Multiple Error in the page between the 2560th and the 2815th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr10(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 2560th and the 2815th bytes"]
#[inline(always)]
pub const fn set_mulerr10(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Recoverable Error in the page between the 2816th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr11(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 2816th and the 3071st bytes"]
#[inline(always)]
pub const fn set_recerr11(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "ECC Error in the page between the 2816th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr11(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 2816th and the 3071st bytes"]
#[inline(always)]
pub const fn set_eccerr11(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Multiple Error in the page between the 2816th and the 3071st bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr11(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 2816th and the 3071st bytes"]
#[inline(always)]
pub const fn set_mulerr11(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Recoverable Error in the page between the 3072nd and the 3327th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr12(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 3072nd and the 3327th bytes"]
#[inline(always)]
pub const fn set_recerr12(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "ECC Error in the page between the 3072nd and the 3327th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr12(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 3072nd and the 3327th bytes"]
#[inline(always)]
pub const fn set_eccerr12(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Multiple Error in the page between the 3072nd and the 3327th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr12(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 3072nd and the 3327th bytes"]
#[inline(always)]
pub const fn set_mulerr12(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Recoverable Error in the page between the 3328th and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr13(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 3328th and the 3583rd bytes"]
#[inline(always)]
pub const fn set_recerr13(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "ECC Error in the page between the 3328th and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr13(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 3328th and the 3583rd bytes"]
#[inline(always)]
pub const fn set_eccerr13(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Multiple Error in the page between the 3328th and the 3583rd bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr13(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 3328th and the 3583rd bytes"]
#[inline(always)]
pub const fn set_mulerr13(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Recoverable Error in the page between the 3584th and the 3839th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr14(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 3584th and the 3839th bytes"]
#[inline(always)]
pub const fn set_recerr14(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
#[doc = "ECC Error in the page between the 3584th and the 3839th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr14(&self) -> bool {
let val = (self.0 >> 25usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 3584th and the 3839th bytes"]
#[inline(always)]
pub const fn set_eccerr14(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
}
#[doc = "Multiple Error in the page between the 3584th and the 3839th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr14(&self) -> bool {
let val = (self.0 >> 26usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 3584th and the 3839th bytes"]
#[inline(always)]
pub const fn set_mulerr14(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
}
#[doc = "Recoverable Error in the page between the 3840th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn recerr15(&self) -> bool {
let val = (self.0 >> 28usize) & 0x01;
val != 0
}
#[doc = "Recoverable Error in the page between the 3840th and the 4095th bytes"]
#[inline(always)]
pub const fn set_recerr15(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
}
#[doc = "ECC Error in the page between the 3840th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn eccerr15(&self) -> bool {
let val = (self.0 >> 29usize) & 0x01;
val != 0
}
#[doc = "ECC Error in the page between the 3840th and the 4095th bytes"]
#[inline(always)]
pub const fn set_eccerr15(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
}
#[doc = "Multiple Error in the page between the 3840th and the 4095th bytes"]
#[must_use]
#[inline(always)]
pub const fn mulerr15(&self) -> bool {
let val = (self.0 >> 30usize) & 0x01;
val != 0
}
#[doc = "Multiple Error in the page between the 3840th and the 4095th bytes"]
#[inline(always)]
pub const fn set_mulerr15(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
}
}
impl Default for EccSr2 {
#[inline(always)]
fn default() -> EccSr2 {
EccSr2(0)
}
}
impl core::fmt::Debug for EccSr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EccSr2")
.field("recerr8", &self.recerr8())
.field("eccerr8", &self.eccerr8())
.field("mulerr8", &self.mulerr8())
.field("recerr9", &self.recerr9())
.field("eccerr9", &self.eccerr9())
.field("mulerr9", &self.mulerr9())
.field("recerr10", &self.recerr10())
.field("eccerr10", &self.eccerr10())
.field("mulerr10", &self.mulerr10())
.field("recerr11", &self.recerr11())
.field("eccerr11", &self.eccerr11())
.field("mulerr11", &self.mulerr11())
.field("recerr12", &self.recerr12())
.field("eccerr12", &self.eccerr12())
.field("mulerr12", &self.mulerr12())
.field("recerr13", &self.recerr13())
.field("eccerr13", &self.eccerr13())
.field("mulerr13", &self.mulerr13())
.field("recerr14", &self.recerr14())
.field("eccerr14", &self.eccerr14())
.field("mulerr14", &self.mulerr14())
.field("recerr15", &self.recerr15())
.field("eccerr15", &self.eccerr15())
.field("mulerr15", &self.mulerr15())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for EccSr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"EccSr2 {{ recerr8: {=bool:?}, eccerr8: {=bool:?}, mulerr8: {=bool:?}, recerr9: {=bool:?}, eccerr9: {=bool:?}, mulerr9: {=bool:?}, recerr10: {=bool:?}, eccerr10: {=bool:?}, mulerr10: {=bool:?}, recerr11: {=bool:?}, eccerr11: {=bool:?}, mulerr11: {=bool:?}, recerr12: {=bool:?}, eccerr12: {=bool:?}, mulerr12: {=bool:?}, recerr13: {=bool:?}, eccerr13: {=bool:?}, mulerr13: {=bool:?}, recerr14: {=bool:?}, eccerr14: {=bool:?}, mulerr14: {=bool:?}, recerr15: {=bool:?}, eccerr15: {=bool:?}, mulerr15: {=bool:?} }}",
self.recerr8(),
self.eccerr8(),
self.mulerr8(),
self.recerr9(),
self.eccerr9(),
self.mulerr9(),
self.recerr10(),
self.eccerr10(),
self.mulerr10(),
self.recerr11(),
self.eccerr11(),
self.mulerr11(),
self.recerr12(),
self.eccerr12(),
self.mulerr12(),
self.recerr13(),
self.eccerr13(),
self.mulerr13(),
self.recerr14(),
self.eccerr14(),
self.mulerr14(),
self.recerr15(),
self.eccerr15(),
self.mulerr15()
)
}
}
#[doc = "SMC NFC Interrupt Disable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Idr(pub u32);
impl Idr {
#[doc = "Ready Busy Rising Edge Detection Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rb_rise(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Rising Edge Detection Interrupt Disable"]
#[inline(always)]
pub const fn set_rb_rise(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rb_fall(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Disable"]
#[inline(always)]
pub const fn set_rb_fall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Transfer Done Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn xfrdone(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Transfer Done Interrupt Disable"]
#[inline(always)]
pub const fn set_xfrdone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Command Done Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmddone(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Command Done Interrupt Disable"]
#[inline(always)]
pub const fn set_cmddone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Data Timeout Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn dtoe(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Data Timeout Error Interrupt Disable"]
#[inline(always)]
pub const fn set_dtoe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Undefined Area Access Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn undef(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Undefined Area Access Interrupt Disable"]
#[inline(always)]
pub const fn set_undef(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Accessing While Busy Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn awb(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Accessing While Busy Interrupt Disable"]
#[inline(always)]
pub const fn set_awb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "NFC Access Size Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn nfcase(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "NFC Access Size Error Interrupt Disable"]
#[inline(always)]
pub const fn set_nfcase(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Ready/Busy Line 0 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn rb_edge0(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Ready/Busy Line 0 Interrupt Disable"]
#[inline(always)]
pub const fn set_rb_edge0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Idr {
#[inline(always)]
fn default() -> Idr {
Idr(0)
}
}
impl core::fmt::Debug for Idr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Idr")
.field("rb_rise", &self.rb_rise())
.field("rb_fall", &self.rb_fall())
.field("xfrdone", &self.xfrdone())
.field("cmddone", &self.cmddone())
.field("dtoe", &self.dtoe())
.field("undef", &self.undef())
.field("awb", &self.awb())
.field("nfcase", &self.nfcase())
.field("rb_edge0", &self.rb_edge0())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Idr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Idr {{ rb_rise: {=bool:?}, rb_fall: {=bool:?}, xfrdone: {=bool:?}, cmddone: {=bool:?}, dtoe: {=bool:?}, undef: {=bool:?}, awb: {=bool:?}, nfcase: {=bool:?}, rb_edge0: {=bool:?} }}",
self.rb_rise(),
self.rb_fall(),
self.xfrdone(),
self.cmddone(),
self.dtoe(),
self.undef(),
self.awb(),
self.nfcase(),
self.rb_edge0()
)
}
}
#[doc = "SMC NFC Interrupt Enable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ier(pub u32);
impl Ier {
#[doc = "Ready Busy Rising Edge Detection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rb_rise(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Rising Edge Detection Interrupt Enable"]
#[inline(always)]
pub const fn set_rb_rise(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rb_fall(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Enable"]
#[inline(always)]
pub const fn set_rb_fall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Transfer Done Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn xfrdone(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Transfer Done Interrupt Enable"]
#[inline(always)]
pub const fn set_xfrdone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Command Done Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmddone(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Command Done Interrupt Enable"]
#[inline(always)]
pub const fn set_cmddone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Data Timeout Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn dtoe(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Data Timeout Error Interrupt Enable"]
#[inline(always)]
pub const fn set_dtoe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Undefined Area Access Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn undef(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Undefined Area Access Interrupt Enable"]
#[inline(always)]
pub const fn set_undef(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Accessing While Busy Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn awb(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Accessing While Busy Interrupt Enable"]
#[inline(always)]
pub const fn set_awb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "NFC Access Size Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn nfcase(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "NFC Access Size Error Interrupt Enable"]
#[inline(always)]
pub const fn set_nfcase(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Ready/Busy Line 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn rb_edge0(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Ready/Busy Line 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_rb_edge0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Ier {
#[inline(always)]
fn default() -> Ier {
Ier(0)
}
}
impl core::fmt::Debug for Ier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ier")
.field("rb_rise", &self.rb_rise())
.field("rb_fall", &self.rb_fall())
.field("xfrdone", &self.xfrdone())
.field("cmddone", &self.cmddone())
.field("dtoe", &self.dtoe())
.field("undef", &self.undef())
.field("awb", &self.awb())
.field("nfcase", &self.nfcase())
.field("rb_edge0", &self.rb_edge0())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ier {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ier {{ rb_rise: {=bool:?}, rb_fall: {=bool:?}, xfrdone: {=bool:?}, cmddone: {=bool:?}, dtoe: {=bool:?}, undef: {=bool:?}, awb: {=bool:?}, nfcase: {=bool:?}, rb_edge0: {=bool:?} }}",
self.rb_rise(),
self.rb_fall(),
self.xfrdone(),
self.cmddone(),
self.dtoe(),
self.undef(),
self.awb(),
self.nfcase(),
self.rb_edge0()
)
}
}
#[doc = "SMC NFC Interrupt Mask Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Imr(pub u32);
impl Imr {
#[doc = "Ready Busy Rising Edge Detection Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn rb_rise(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Rising Edge Detection Interrupt Mask"]
#[inline(always)]
pub const fn set_rb_rise(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn rb_fall(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Ready Busy Falling Edge Detection Interrupt Mask"]
#[inline(always)]
pub const fn set_rb_fall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Transfer Done Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn xfrdone(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Transfer Done Interrupt Mask"]
#[inline(always)]
pub const fn set_xfrdone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Command Done Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmddone(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Command Done Interrupt Mask"]
#[inline(always)]
pub const fn set_cmddone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Data Timeout Error Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn dtoe(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Data Timeout Error Interrupt Mask"]
#[inline(always)]
pub const fn set_dtoe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Undefined Area Access Interrupt Mask5"]
#[must_use]
#[inline(always)]
pub const fn undef(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Undefined Area Access Interrupt Mask5"]
#[inline(always)]
pub const fn set_undef(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Accessing While Busy Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn awb(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Accessing While Busy Interrupt Mask"]
#[inline(always)]
pub const fn set_awb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "NFC Access Size Error Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn nfcase(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "NFC Access Size Error Interrupt Mask"]
#[inline(always)]
pub const fn set_nfcase(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Ready/Busy Line 0 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn rb_edge0(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Ready/Busy Line 0 Interrupt Mask"]
#[inline(always)]
pub const fn set_rb_edge0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Imr {
#[inline(always)]
fn default() -> Imr {
Imr(0)
}
}
impl core::fmt::Debug for Imr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Imr")
.field("rb_rise", &self.rb_rise())
.field("rb_fall", &self.rb_fall())
.field("xfrdone", &self.xfrdone())
.field("cmddone", &self.cmddone())
.field("dtoe", &self.dtoe())
.field("undef", &self.undef())
.field("awb", &self.awb())
.field("nfcase", &self.nfcase())
.field("rb_edge0", &self.rb_edge0())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Imr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Imr {{ rb_rise: {=bool:?}, rb_fall: {=bool:?}, xfrdone: {=bool:?}, cmddone: {=bool:?}, dtoe: {=bool:?}, undef: {=bool:?}, awb: {=bool:?}, nfcase: {=bool:?}, rb_edge0: {=bool:?} }}",
self.rb_rise(),
self.rb_fall(),
self.xfrdone(),
self.cmddone(),
self.dtoe(),
self.undef(),
self.awb(),
self.nfcase(),
self.rb_edge0()
)
}
}
#[doc = "SMC OCMS KEY1 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Key1(pub u32);
impl Key1 {
#[doc = "Off Chip Memory Scrambling (OCMS) Key Part 1"]
#[must_use]
#[inline(always)]
pub const fn key1(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Off Chip Memory Scrambling (OCMS) Key Part 1"]
#[inline(always)]
pub const fn set_key1(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Key1 {
#[inline(always)]
fn default() -> Key1 {
Key1(0)
}
}
impl core::fmt::Debug for Key1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Key1").field("key1", &self.key1()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Key1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Key1 {{ key1: {=u32:?} }}", self.key1())
}
}
#[doc = "SMC OCMS KEY2 Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Key2(pub u32);
impl Key2 {
#[doc = "Off Chip Memory Scrambling (OCMS) Key Part 2"]
#[must_use]
#[inline(always)]
pub const fn key2(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Off Chip Memory Scrambling (OCMS) Key Part 2"]
#[inline(always)]
pub const fn set_key2(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Key2 {
#[inline(always)]
fn default() -> Key2 {
Key2(0)
}
}
impl core::fmt::Debug for Key2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Key2").field("key2", &self.key2()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Key2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Key2 {{ key2: {=u32:?} }}", self.key2())
}
}
#[doc = "SMC Mode Register (CS_number = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode0(pub u32);
impl Mode0 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode0ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode0ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode0ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode0WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode0WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode0WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode0ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode0ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode0ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode0Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode0Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode0Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode0 {
#[inline(always)]
fn default() -> Mode0 {
Mode0(0)
}
}
impl core::fmt::Debug for Mode0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode0")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode0 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode1(pub u32);
impl Mode1 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode1ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode1ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode1ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode1WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode1WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode1WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode1ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode1ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode1ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode1Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode1Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode1Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode1 {
#[inline(always)]
fn default() -> Mode1 {
Mode1(0)
}
}
impl core::fmt::Debug for Mode1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode1")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode1 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode2(pub u32);
impl Mode2 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode2ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode2ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode2ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode2WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode2WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode2WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode2ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode2ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode2ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode2Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode2Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode2Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode2 {
#[inline(always)]
fn default() -> Mode2 {
Mode2(0)
}
}
impl core::fmt::Debug for Mode2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode2")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode2 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode3(pub u32);
impl Mode3 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode3ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode3ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode3ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode3WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode3WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode3WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode3ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode3ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode3ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode3Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode3Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode3Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode3 {
#[inline(always)]
fn default() -> Mode3 {
Mode3(0)
}
}
impl core::fmt::Debug for Mode3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode3")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode3 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode4(pub u32);
impl Mode4 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode4ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode4ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode4ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode4WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode4WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode4WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode4ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode4ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode4ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode4Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode4Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode4Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode4 {
#[inline(always)]
fn default() -> Mode4 {
Mode4(0)
}
}
impl core::fmt::Debug for Mode4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode4")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode4 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode5(pub u32);
impl Mode5 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode5ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode5ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode5ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode5WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode5WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode5WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode5ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode5ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode5ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode5Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode5Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode5Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode5 {
#[inline(always)]
fn default() -> Mode5 {
Mode5(0)
}
}
impl core::fmt::Debug for Mode5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode5")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode5 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode6(pub u32);
impl Mode6 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode6ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode6ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode6ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode6WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode6WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode6WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode6ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode6ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode6ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode6Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode6Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode6Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode6 {
#[inline(always)]
fn default() -> Mode6 {
Mode6(0)
}
}
impl core::fmt::Debug for Mode6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode6")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode6 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC Mode Register (CS_number = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Mode7(pub u32);
impl Mode7 {
#[doc = "Selection of the Control Signal for Read Operation"]
#[must_use]
#[inline(always)]
pub const fn read_mode(&self) -> super::vals::Mode7ReadMode {
let val = (self.0 >> 0usize) & 0x01;
super::vals::Mode7ReadMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Read Operation"]
#[inline(always)]
pub const fn set_read_mode(&mut self, val: super::vals::Mode7ReadMode) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[must_use]
#[inline(always)]
pub const fn write_mode(&self) -> super::vals::Mode7WriteMode {
let val = (self.0 >> 1usize) & 0x01;
super::vals::Mode7WriteMode::from_bits(val as u8)
}
#[doc = "Selection of the Control Signal for Write Operation"]
#[inline(always)]
pub const fn set_write_mode(&mut self, val: super::vals::Mode7WriteMode) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
}
#[doc = "NWAIT Mode"]
#[must_use]
#[inline(always)]
pub const fn exnw_mode(&self) -> super::vals::Mode7ExnwMode {
let val = (self.0 >> 4usize) & 0x03;
super::vals::Mode7ExnwMode::from_bits(val as u8)
}
#[doc = "NWAIT Mode"]
#[inline(always)]
pub const fn set_exnw_mode(&mut self, val: super::vals::Mode7ExnwMode) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
}
#[doc = "Byte Access Type"]
#[must_use]
#[inline(always)]
pub const fn bat(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Byte Access Type"]
#[inline(always)]
pub const fn set_bat(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Data Bus Width"]
#[must_use]
#[inline(always)]
pub const fn dbw(&self) -> super::vals::Mode7Dbw {
let val = (self.0 >> 12usize) & 0x01;
super::vals::Mode7Dbw::from_bits(val as u8)
}
#[doc = "Data Bus Width"]
#[inline(always)]
pub const fn set_dbw(&mut self, val: super::vals::Mode7Dbw) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val.to_bits() as u32) & 0x01) << 12usize);
}
#[doc = "Data Float Time"]
#[must_use]
#[inline(always)]
pub const fn tdf_cycles(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Data Float Time"]
#[inline(always)]
pub const fn set_tdf_cycles(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "TDF Optimization"]
#[must_use]
#[inline(always)]
pub const fn tdf_mode(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "TDF Optimization"]
#[inline(always)]
pub const fn set_tdf_mode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
}
impl Default for Mode7 {
#[inline(always)]
fn default() -> Mode7 {
Mode7(0)
}
}
impl core::fmt::Debug for Mode7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Mode7")
.field("read_mode", &self.read_mode())
.field("write_mode", &self.write_mode())
.field("exnw_mode", &self.exnw_mode())
.field("bat", &self.bat())
.field("dbw", &self.dbw())
.field("tdf_cycles", &self.tdf_cycles())
.field("tdf_mode", &self.tdf_mode())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Mode7 {{ read_mode: {:?}, write_mode: {:?}, exnw_mode: {:?}, bat: {=bool:?}, dbw: {:?}, tdf_cycles: {=u8:?}, tdf_mode: {=bool:?} }}",
self.read_mode(),
self.write_mode(),
self.exnw_mode(),
self.bat(),
self.dbw(),
self.tdf_cycles(),
self.tdf_mode()
)
}
}
#[doc = "SMC OCMS Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ocms(pub u32);
impl Ocms {
#[doc = "Static Memory Controller Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn smse(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Static Memory Controller Scrambling Enable"]
#[inline(always)]
pub const fn set_smse(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "SRAM Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn srse(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "SRAM Scrambling Enable"]
#[inline(always)]
pub const fn set_srse(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
}
impl Default for Ocms {
#[inline(always)]
fn default() -> Ocms {
Ocms(0)
}
}
impl core::fmt::Debug for Ocms {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ocms")
.field("smse", &self.smse())
.field("srse", &self.srse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ocms {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ocms {{ smse: {=bool:?}, srse: {=bool:?} }}",
self.smse(),
self.srse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse0(pub u32);
impl Pulse0 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse0 {
#[inline(always)]
fn default() -> Pulse0 {
Pulse0(0)
}
}
impl core::fmt::Debug for Pulse0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse0")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse0 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse1(pub u32);
impl Pulse1 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse1 {
#[inline(always)]
fn default() -> Pulse1 {
Pulse1(0)
}
}
impl core::fmt::Debug for Pulse1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse1")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse1 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse2(pub u32);
impl Pulse2 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse2 {
#[inline(always)]
fn default() -> Pulse2 {
Pulse2(0)
}
}
impl core::fmt::Debug for Pulse2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse2")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse2 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse3(pub u32);
impl Pulse3 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse3 {
#[inline(always)]
fn default() -> Pulse3 {
Pulse3(0)
}
}
impl core::fmt::Debug for Pulse3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse3")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse3 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse4(pub u32);
impl Pulse4 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse4 {
#[inline(always)]
fn default() -> Pulse4 {
Pulse4(0)
}
}
impl core::fmt::Debug for Pulse4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse4")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse4 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse5(pub u32);
impl Pulse5 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse5 {
#[inline(always)]
fn default() -> Pulse5 {
Pulse5(0)
}
}
impl core::fmt::Debug for Pulse5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse5")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse5 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse6(pub u32);
impl Pulse6 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse6 {
#[inline(always)]
fn default() -> Pulse6 {
Pulse6(0)
}
}
impl core::fmt::Debug for Pulse6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse6")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse6 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Pulse Register (CS_number = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Pulse7(pub u32);
impl Pulse7 {
#[doc = "NWE Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_pulse(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x7f;
val as u8
}
#[doc = "NWE Pulse Length"]
#[inline(always)]
pub const fn set_nwe_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_pulse(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in WRITE Access"]
#[inline(always)]
pub const fn set_ncs_wr_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
}
#[doc = "NRD Pulse Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_pulse(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x7f;
val as u8
}
#[doc = "NRD Pulse Length"]
#[inline(always)]
pub const fn set_nrd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
}
#[doc = "NCS Pulse Length in READ Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_pulse(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x7f;
val as u8
}
#[doc = "NCS Pulse Length in READ Access"]
#[inline(always)]
pub const fn set_ncs_rd_pulse(&mut self, val: u8) {
self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
}
}
impl Default for Pulse7 {
#[inline(always)]
fn default() -> Pulse7 {
Pulse7(0)
}
}
impl core::fmt::Debug for Pulse7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Pulse7")
.field("nwe_pulse", &self.nwe_pulse())
.field("ncs_wr_pulse", &self.ncs_wr_pulse())
.field("nrd_pulse", &self.nrd_pulse())
.field("ncs_rd_pulse", &self.ncs_rd_pulse())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Pulse7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Pulse7 {{ nwe_pulse: {=u8:?}, ncs_wr_pulse: {=u8:?}, nrd_pulse: {=u8:?}, ncs_rd_pulse: {=u8:?} }}",
self.nwe_pulse(),
self.ncs_wr_pulse(),
self.nrd_pulse(),
self.ncs_rd_pulse()
)
}
}
#[doc = "SMC Setup Register (CS_number = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup0(pub u32);
impl Setup0 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup0 {
#[inline(always)]
fn default() -> Setup0 {
Setup0(0)
}
}
impl core::fmt::Debug for Setup0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup0")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup0 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup1(pub u32);
impl Setup1 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup1 {
#[inline(always)]
fn default() -> Setup1 {
Setup1(0)
}
}
impl core::fmt::Debug for Setup1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup1")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup1 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup2(pub u32);
impl Setup2 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup2 {
#[inline(always)]
fn default() -> Setup2 {
Setup2(0)
}
}
impl core::fmt::Debug for Setup2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup2")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup2 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup3(pub u32);
impl Setup3 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup3 {
#[inline(always)]
fn default() -> Setup3 {
Setup3(0)
}
}
impl core::fmt::Debug for Setup3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup3")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup3 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup4(pub u32);
impl Setup4 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup4 {
#[inline(always)]
fn default() -> Setup4 {
Setup4(0)
}
}
impl core::fmt::Debug for Setup4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup4")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup4 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup5(pub u32);
impl Setup5 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup5 {
#[inline(always)]
fn default() -> Setup5 {
Setup5(0)
}
}
impl core::fmt::Debug for Setup5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup5")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup5 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup6(pub u32);
impl Setup6 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup6 {
#[inline(always)]
fn default() -> Setup6 {
Setup6(0)
}
}
impl core::fmt::Debug for Setup6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup6")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup6 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC Setup Register (CS_number = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Setup7(pub u32);
impl Setup7 {
#[doc = "NWE Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nwe_setup(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x3f;
val as u8
}
#[doc = "NWE Setup Length"]
#[inline(always)]
pub const fn set_nwe_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
}
#[doc = "NCS Setup Length in Write Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_wr_setup(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Write Access"]
#[inline(always)]
pub const fn set_ncs_wr_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
}
#[doc = "NRD Setup Length"]
#[must_use]
#[inline(always)]
pub const fn nrd_setup(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x3f;
val as u8
}
#[doc = "NRD Setup Length"]
#[inline(always)]
pub const fn set_nrd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 16usize)) | (((val as u32) & 0x3f) << 16usize);
}
#[doc = "NCS Setup Length in Read Access"]
#[must_use]
#[inline(always)]
pub const fn ncs_rd_setup(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x3f;
val as u8
}
#[doc = "NCS Setup Length in Read Access"]
#[inline(always)]
pub const fn set_ncs_rd_setup(&mut self, val: u8) {
self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
}
}
impl Default for Setup7 {
#[inline(always)]
fn default() -> Setup7 {
Setup7(0)
}
}
impl core::fmt::Debug for Setup7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Setup7")
.field("nwe_setup", &self.nwe_setup())
.field("ncs_wr_setup", &self.ncs_wr_setup())
.field("nrd_setup", &self.nrd_setup())
.field("ncs_rd_setup", &self.ncs_rd_setup())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Setup7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Setup7 {{ nwe_setup: {=u8:?}, ncs_wr_setup: {=u8:?}, nrd_setup: {=u8:?}, ncs_rd_setup: {=u8:?} }}",
self.nwe_setup(),
self.ncs_wr_setup(),
self.nrd_setup(),
self.ncs_rd_setup()
)
}
}
#[doc = "SMC NFC Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Sr(pub u32);
impl Sr {
#[doc = "NAND Flash Controller status (this field cannot be reset)"]
#[must_use]
#[inline(always)]
pub const fn smcsts(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Controller status (this field cannot be reset)"]
#[inline(always)]
pub const fn set_smcsts(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Selected Ready Busy Rising Edge Detected"]
#[must_use]
#[inline(always)]
pub const fn rb_rise(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Selected Ready Busy Rising Edge Detected"]
#[inline(always)]
pub const fn set_rb_rise(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Selected Ready Busy Falling Edge Detected"]
#[must_use]
#[inline(always)]
pub const fn rb_fall(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Selected Ready Busy Falling Edge Detected"]
#[inline(always)]
pub const fn set_rb_fall(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "NFC Busy (this field cannot be reset)"]
#[must_use]
#[inline(always)]
pub const fn nfcbusy(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "NFC Busy (this field cannot be reset)"]
#[inline(always)]
pub const fn set_nfcbusy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "NFC Write/Read Operation (this field cannot be reset)"]
#[must_use]
#[inline(always)]
pub const fn nfcwr(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "NFC Write/Read Operation (this field cannot be reset)"]
#[inline(always)]
pub const fn set_nfcwr(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "NFC Chip Select ID (this field cannot be reset)"]
#[must_use]
#[inline(always)]
pub const fn nfcsid(&self) -> u8 {
let val = (self.0 >> 12usize) & 0x07;
val as u8
}
#[doc = "NFC Chip Select ID (this field cannot be reset)"]
#[inline(always)]
pub const fn set_nfcsid(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 12usize)) | (((val as u32) & 0x07) << 12usize);
}
#[doc = "NFC Data Transfer Terminated"]
#[must_use]
#[inline(always)]
pub const fn xfrdone(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "NFC Data Transfer Terminated"]
#[inline(always)]
pub const fn set_xfrdone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Command Done"]
#[must_use]
#[inline(always)]
pub const fn cmddone(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Command Done"]
#[inline(always)]
pub const fn set_cmddone(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Data Timeout Error"]
#[must_use]
#[inline(always)]
pub const fn dtoe(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Data Timeout Error"]
#[inline(always)]
pub const fn set_dtoe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Undefined Area Error"]
#[must_use]
#[inline(always)]
pub const fn undef(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Undefined Area Error"]
#[inline(always)]
pub const fn set_undef(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Accessing While Busy"]
#[must_use]
#[inline(always)]
pub const fn awb(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Accessing While Busy"]
#[inline(always)]
pub const fn set_awb(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "NFC Access Size Error"]
#[must_use]
#[inline(always)]
pub const fn nfcase(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "NFC Access Size Error"]
#[inline(always)]
pub const fn set_nfcase(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Ready/Busy Line 0 Edge Detected"]
#[must_use]
#[inline(always)]
pub const fn rb_edge0(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Ready/Busy Line 0 Edge Detected"]
#[inline(always)]
pub const fn set_rb_edge0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
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("smcsts", &self.smcsts())
.field("rb_rise", &self.rb_rise())
.field("rb_fall", &self.rb_fall())
.field("nfcbusy", &self.nfcbusy())
.field("nfcwr", &self.nfcwr())
.field("nfcsid", &self.nfcsid())
.field("xfrdone", &self.xfrdone())
.field("cmddone", &self.cmddone())
.field("dtoe", &self.dtoe())
.field("undef", &self.undef())
.field("awb", &self.awb())
.field("nfcase", &self.nfcase())
.field("rb_edge0", &self.rb_edge0())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Sr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Sr {{ smcsts: {=bool:?}, rb_rise: {=bool:?}, rb_fall: {=bool:?}, nfcbusy: {=bool:?}, nfcwr: {=bool:?}, nfcsid: {=u8:?}, xfrdone: {=bool:?}, cmddone: {=bool:?}, dtoe: {=bool:?}, undef: {=bool:?}, awb: {=bool:?}, nfcase: {=bool:?}, rb_edge0: {=bool:?} }}",
self.smcsts(),
self.rb_rise(),
self.rb_fall(),
self.nfcbusy(),
self.nfcwr(),
self.nfcsid(),
self.xfrdone(),
self.cmddone(),
self.dtoe(),
self.undef(),
self.awb(),
self.nfcase(),
self.rb_edge0()
)
}
}
#[doc = "SMC Timings Register (CS_number = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings0(pub u32);
impl Timings0 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings0 {
#[inline(always)]
fn default() -> Timings0 {
Timings0(0)
}
}
impl core::fmt::Debug for Timings0 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings0")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings0 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings0 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 1)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings1(pub u32);
impl Timings1 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings1 {
#[inline(always)]
fn default() -> Timings1 {
Timings1(0)
}
}
impl core::fmt::Debug for Timings1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings1")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings1 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 2)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings2(pub u32);
impl Timings2 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings2 {
#[inline(always)]
fn default() -> Timings2 {
Timings2(0)
}
}
impl core::fmt::Debug for Timings2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings2")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings2 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 3)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings3(pub u32);
impl Timings3 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings3 {
#[inline(always)]
fn default() -> Timings3 {
Timings3(0)
}
}
impl core::fmt::Debug for Timings3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings3")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings3 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings3 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 4)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings4(pub u32);
impl Timings4 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings4 {
#[inline(always)]
fn default() -> Timings4 {
Timings4(0)
}
}
impl core::fmt::Debug for Timings4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings4")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings4 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings4 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 5)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings5(pub u32);
impl Timings5 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings5 {
#[inline(always)]
fn default() -> Timings5 {
Timings5(0)
}
}
impl core::fmt::Debug for Timings5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings5")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings5 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings5 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 6)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings6(pub u32);
impl Timings6 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings6 {
#[inline(always)]
fn default() -> Timings6 {
Timings6(0)
}
}
impl core::fmt::Debug for Timings6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings6")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings6 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings6 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "SMC Timings Register (CS_number = 7)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Timings7(pub u32);
impl Timings7 {
#[doc = "CLE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "CLE to REN Low Delay"]
#[inline(always)]
pub const fn set_tclr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "ALE to Data Start"]
#[must_use]
#[inline(always)]
pub const fn tadl(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "ALE to Data Start"]
#[inline(always)]
pub const fn set_tadl(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "ALE to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn tar(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "ALE to REN Low Delay"]
#[inline(always)]
pub const fn set_tar(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[must_use]
#[inline(always)]
pub const fn ocms(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Off Chip Memory Scrambling Enable"]
#[inline(always)]
pub const fn set_ocms(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Ready to REN Low Delay"]
#[must_use]
#[inline(always)]
pub const fn trr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Ready to REN Low Delay"]
#[inline(always)]
pub const fn set_trr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "WEN High to REN to Busy"]
#[must_use]
#[inline(always)]
pub const fn twb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "WEN High to REN to Busy"]
#[inline(always)]
pub const fn set_twb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
#[doc = "Ready/Busy Line Selection"]
#[must_use]
#[inline(always)]
pub const fn rbnsel(&self) -> u8 {
let val = (self.0 >> 28usize) & 0x07;
val as u8
}
#[doc = "Ready/Busy Line Selection"]
#[inline(always)]
pub const fn set_rbnsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 28usize)) | (((val as u32) & 0x07) << 28usize);
}
#[doc = "NAND Flash Selection"]
#[must_use]
#[inline(always)]
pub const fn nfsel(&self) -> bool {
let val = (self.0 >> 31usize) & 0x01;
val != 0
}
#[doc = "NAND Flash Selection"]
#[inline(always)]
pub const fn set_nfsel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
}
}
impl Default for Timings7 {
#[inline(always)]
fn default() -> Timings7 {
Timings7(0)
}
}
impl core::fmt::Debug for Timings7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Timings7")
.field("tclr", &self.tclr())
.field("tadl", &self.tadl())
.field("tar", &self.tar())
.field("ocms", &self.ocms())
.field("trr", &self.trr())
.field("twb", &self.twb())
.field("rbnsel", &self.rbnsel())
.field("nfsel", &self.nfsel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Timings7 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Timings7 {{ tclr: {=u8:?}, tadl: {=u8:?}, tar: {=u8:?}, ocms: {=bool:?}, trr: {=u8:?}, twb: {=u8:?}, rbnsel: {=u8:?}, nfsel: {=bool:?} }}",
self.tclr(),
self.tadl(),
self.tar(),
self.ocms(),
self.trr(),
self.twb(),
self.rbnsel(),
self.nfsel()
)
}
}
#[doc = "Write Protection Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Wpcr(pub u32);
impl Wpcr {
#[doc = "Write Protection Enable"]
#[must_use]
#[inline(always)]
pub const fn wp_en(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Protection Enable"]
#[inline(always)]
pub const fn set_wp_en(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Write Protection KEY Password"]
#[must_use]
#[inline(always)]
pub const fn wp_key(&self) -> super::vals::WpKey {
let val = (self.0 >> 8usize) & 0x00ff_ffff;
super::vals::WpKey::from_bits(val as u32)
}
#[doc = "Write Protection KEY Password"]
#[inline(always)]
pub const fn set_wp_key(&mut self, val: super::vals::WpKey) {
self.0 = (self.0 & !(0x00ff_ffff << 8usize))
| (((val.to_bits() as u32) & 0x00ff_ffff) << 8usize);
}
}
impl Default for Wpcr {
#[inline(always)]
fn default() -> Wpcr {
Wpcr(0)
}
}
impl core::fmt::Debug for Wpcr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Wpcr")
.field("wp_en", &self.wp_en())
.field("wp_key", &self.wp_key())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Wpcr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Wpcr {{ wp_en: {=bool:?}, wp_key: {:?} }}",
self.wp_en(),
self.wp_key()
)
}
}
#[doc = "Write Protection Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Wpsr(pub u32);
impl Wpsr {
#[doc = "Write Protection Violation Status"]
#[must_use]
#[inline(always)]
pub const fn wp_vs(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "Write Protection Violation Status"]
#[inline(always)]
pub const fn set_wp_vs(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "Write Protection Violation Source"]
#[must_use]
#[inline(always)]
pub const fn wp_vsrc(&self) -> u16 {
let val = (self.0 >> 8usize) & 0xffff;
val as u16
}
#[doc = "Write Protection Violation Source"]
#[inline(always)]
pub const fn set_wp_vsrc(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 8usize)) | (((val as u32) & 0xffff) << 8usize);
}
}
impl Default for Wpsr {
#[inline(always)]
fn default() -> Wpsr {
Wpsr(0)
}
}
impl core::fmt::Debug for Wpsr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Wpsr")
.field("wp_vs", &self.wp_vs())
.field("wp_vsrc", &self.wp_vsrc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Wpsr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Wpsr {{ wp_vs: {=u8:?}, wp_vsrc: {=u16:?} }}",
self.wp_vs(),
self.wp_vsrc()
)
}
}