#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Dtomul {
#[doc = "DTOCYC"]
X1 = 0x0,
#[doc = "DTOCYC x 16"]
X16 = 0x01,
#[doc = "DTOCYC x 128"]
X128 = 0x02,
#[doc = "DTOCYC x 256"]
X256 = 0x03,
#[doc = "DTOCYC x 1024"]
X1024 = 0x04,
#[doc = "DTOCYC x 4096"]
X4096 = 0x05,
#[doc = "DTOCYC x 65536"]
X65536 = 0x06,
#[doc = "DTOCYC x 1048576"]
X1048576 = 0x07,
}
impl Dtomul {
#[inline(always)]
pub const fn from_bits(val: u8) -> Dtomul {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Dtomul {
#[inline(always)]
fn from(val: u8) -> Dtomul {
Dtomul::from_bits(val)
}
}
impl From<Dtomul> for u8 {
#[inline(always)]
fn from(val: Dtomul) -> u8 {
Dtomul::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum EccPagesize {
#[doc = "Main area 512 Words"]
PS512 = 0x0,
#[doc = "Main area 1024 Words"]
PS1024 = 0x01,
#[doc = "Main area 2048 Words"]
PS2048 = 0x02,
#[doc = "Main area 4096 Words"]
PS4096 = 0x03,
}
impl EccPagesize {
#[inline(always)]
pub const fn from_bits(val: u8) -> EccPagesize {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for EccPagesize {
#[inline(always)]
fn from(val: u8) -> EccPagesize {
EccPagesize::from_bits(val)
}
}
impl From<EccPagesize> for u8 {
#[inline(always)]
fn from(val: EccPagesize) -> u8 {
EccPagesize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode0Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode0Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode0Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode0Dbw {
#[inline(always)]
fn from(val: u8) -> Mode0Dbw {
Mode0Dbw::from_bits(val)
}
}
impl From<Mode0Dbw> for u8 {
#[inline(always)]
fn from(val: Mode0Dbw) -> u8 {
Mode0Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode0ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode0ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode0ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode0ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode0ExnwMode {
Mode0ExnwMode::from_bits(val)
}
}
impl From<Mode0ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode0ExnwMode) -> u8 {
Mode0ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode0ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode0ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode0ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode0ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode0ReadMode {
Mode0ReadMode::from_bits(val)
}
}
impl From<Mode0ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode0ReadMode) -> u8 {
Mode0ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode0WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode0WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode0WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode0WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode0WriteMode {
Mode0WriteMode::from_bits(val)
}
}
impl From<Mode0WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode0WriteMode) -> u8 {
Mode0WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode1Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode1Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode1Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode1Dbw {
#[inline(always)]
fn from(val: u8) -> Mode1Dbw {
Mode1Dbw::from_bits(val)
}
}
impl From<Mode1Dbw> for u8 {
#[inline(always)]
fn from(val: Mode1Dbw) -> u8 {
Mode1Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode1ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode1ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode1ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode1ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode1ExnwMode {
Mode1ExnwMode::from_bits(val)
}
}
impl From<Mode1ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode1ExnwMode) -> u8 {
Mode1ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode1ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode1ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode1ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode1ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode1ReadMode {
Mode1ReadMode::from_bits(val)
}
}
impl From<Mode1ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode1ReadMode) -> u8 {
Mode1ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode1WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode1WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode1WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode1WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode1WriteMode {
Mode1WriteMode::from_bits(val)
}
}
impl From<Mode1WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode1WriteMode) -> u8 {
Mode1WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode2Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode2Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode2Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode2Dbw {
#[inline(always)]
fn from(val: u8) -> Mode2Dbw {
Mode2Dbw::from_bits(val)
}
}
impl From<Mode2Dbw> for u8 {
#[inline(always)]
fn from(val: Mode2Dbw) -> u8 {
Mode2Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode2ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode2ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode2ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode2ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode2ExnwMode {
Mode2ExnwMode::from_bits(val)
}
}
impl From<Mode2ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode2ExnwMode) -> u8 {
Mode2ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode2ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode2ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode2ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode2ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode2ReadMode {
Mode2ReadMode::from_bits(val)
}
}
impl From<Mode2ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode2ReadMode) -> u8 {
Mode2ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode2WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode2WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode2WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode2WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode2WriteMode {
Mode2WriteMode::from_bits(val)
}
}
impl From<Mode2WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode2WriteMode) -> u8 {
Mode2WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode3Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode3Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode3Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode3Dbw {
#[inline(always)]
fn from(val: u8) -> Mode3Dbw {
Mode3Dbw::from_bits(val)
}
}
impl From<Mode3Dbw> for u8 {
#[inline(always)]
fn from(val: Mode3Dbw) -> u8 {
Mode3Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode3ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode3ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode3ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode3ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode3ExnwMode {
Mode3ExnwMode::from_bits(val)
}
}
impl From<Mode3ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode3ExnwMode) -> u8 {
Mode3ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode3ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode3ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode3ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode3ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode3ReadMode {
Mode3ReadMode::from_bits(val)
}
}
impl From<Mode3ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode3ReadMode) -> u8 {
Mode3ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode3WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode3WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode3WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode3WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode3WriteMode {
Mode3WriteMode::from_bits(val)
}
}
impl From<Mode3WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode3WriteMode) -> u8 {
Mode3WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode4Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode4Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode4Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode4Dbw {
#[inline(always)]
fn from(val: u8) -> Mode4Dbw {
Mode4Dbw::from_bits(val)
}
}
impl From<Mode4Dbw> for u8 {
#[inline(always)]
fn from(val: Mode4Dbw) -> u8 {
Mode4Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode4ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode4ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode4ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode4ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode4ExnwMode {
Mode4ExnwMode::from_bits(val)
}
}
impl From<Mode4ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode4ExnwMode) -> u8 {
Mode4ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode4ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode4ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode4ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode4ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode4ReadMode {
Mode4ReadMode::from_bits(val)
}
}
impl From<Mode4ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode4ReadMode) -> u8 {
Mode4ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode4WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode4WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode4WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode4WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode4WriteMode {
Mode4WriteMode::from_bits(val)
}
}
impl From<Mode4WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode4WriteMode) -> u8 {
Mode4WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode5Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode5Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode5Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode5Dbw {
#[inline(always)]
fn from(val: u8) -> Mode5Dbw {
Mode5Dbw::from_bits(val)
}
}
impl From<Mode5Dbw> for u8 {
#[inline(always)]
fn from(val: Mode5Dbw) -> u8 {
Mode5Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode5ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode5ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode5ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode5ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode5ExnwMode {
Mode5ExnwMode::from_bits(val)
}
}
impl From<Mode5ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode5ExnwMode) -> u8 {
Mode5ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode5ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode5ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode5ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode5ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode5ReadMode {
Mode5ReadMode::from_bits(val)
}
}
impl From<Mode5ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode5ReadMode) -> u8 {
Mode5ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode5WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode5WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode5WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode5WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode5WriteMode {
Mode5WriteMode::from_bits(val)
}
}
impl From<Mode5WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode5WriteMode) -> u8 {
Mode5WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode6Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode6Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode6Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode6Dbw {
#[inline(always)]
fn from(val: u8) -> Mode6Dbw {
Mode6Dbw::from_bits(val)
}
}
impl From<Mode6Dbw> for u8 {
#[inline(always)]
fn from(val: Mode6Dbw) -> u8 {
Mode6Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode6ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode6ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode6ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode6ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode6ExnwMode {
Mode6ExnwMode::from_bits(val)
}
}
impl From<Mode6ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode6ExnwMode) -> u8 {
Mode6ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode6ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode6ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode6ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode6ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode6ReadMode {
Mode6ReadMode::from_bits(val)
}
}
impl From<Mode6ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode6ReadMode) -> u8 {
Mode6ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode6WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode6WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode6WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode6WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode6WriteMode {
Mode6WriteMode::from_bits(val)
}
}
impl From<Mode6WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode6WriteMode) -> u8 {
Mode6WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode7Dbw {
#[doc = "8-bit bus"]
BIT_8 = 0x0,
#[doc = "16-bit bus"]
BIT_16 = 0x01,
}
impl Mode7Dbw {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode7Dbw {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode7Dbw {
#[inline(always)]
fn from(val: u8) -> Mode7Dbw {
Mode7Dbw::from_bits(val)
}
}
impl From<Mode7Dbw> for u8 {
#[inline(always)]
fn from(val: Mode7Dbw) -> u8 {
Mode7Dbw::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode7ExnwMode {
#[doc = "Disabled"]
DISABLED = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Frozen Mode"]
FROZEN = 0x02,
#[doc = "Ready Mode"]
READY = 0x03,
}
impl Mode7ExnwMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode7ExnwMode {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode7ExnwMode {
#[inline(always)]
fn from(val: u8) -> Mode7ExnwMode {
Mode7ExnwMode::from_bits(val)
}
}
impl From<Mode7ExnwMode> for u8 {
#[inline(always)]
fn from(val: Mode7ExnwMode) -> u8 {
Mode7ExnwMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode7ReadMode {
#[doc = "The Read operation is controlled by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Read operation is controlled by the NRD signal."]
NRD_CTRL = 0x01,
}
impl Mode7ReadMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode7ReadMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode7ReadMode {
#[inline(always)]
fn from(val: u8) -> Mode7ReadMode {
Mode7ReadMode::from_bits(val)
}
}
impl From<Mode7ReadMode> for u8 {
#[inline(always)]
fn from(val: Mode7ReadMode) -> u8 {
Mode7ReadMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode7WriteMode {
#[doc = "The Write operation is controller by the NCS signal."]
NCS_CTRL = 0x0,
#[doc = "The Write operation is controlled by the NWE signal."]
NWE_CTRL = 0x01,
}
impl Mode7WriteMode {
#[inline(always)]
pub const fn from_bits(val: u8) -> Mode7WriteMode {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Mode7WriteMode {
#[inline(always)]
fn from(val: u8) -> Mode7WriteMode {
Mode7WriteMode::from_bits(val)
}
}
impl From<Mode7WriteMode> for u8 {
#[inline(always)]
fn from(val: Mode7WriteMode) -> u8 {
Mode7WriteMode::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Pagesize {
#[doc = "Main area 512 Bytes"]
PS512 = 0x0,
#[doc = "Main area 1024 Bytes"]
PS1024 = 0x01,
#[doc = "Main area 2048 Bytes"]
PS2048 = 0x02,
#[doc = "Main area 4096 Bytes"]
PS4096 = 0x03,
}
impl Pagesize {
#[inline(always)]
pub const fn from_bits(val: u8) -> Pagesize {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Pagesize {
#[inline(always)]
fn from(val: u8) -> Pagesize {
Pagesize::from_bits(val)
}
}
impl From<Pagesize> for u8 {
#[inline(always)]
fn from(val: Pagesize) -> u8 {
Pagesize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Typcorrec {
#[doc = "1 bit correction for a page of 512/1024/2048/4096 Bytes (for 8 or 16-bit NAND Flash)"]
CPAGE = 0x0,
#[doc = "1 bit correction for 256 Bytes of data for a page of 512/2048/4096 bytes (for 8-bit NAND Flash only)"]
C256B = 0x01,
#[doc = "1 bit correction for 512 Bytes of data for a page of 512/2048/4096 bytes (for 8-bit NAND Flash only)"]
C512B = 0x02,
_RESERVED_3 = 0x03,
}
impl Typcorrec {
#[inline(always)]
pub const fn from_bits(val: u8) -> Typcorrec {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Typcorrec {
#[inline(always)]
fn from(val: u8) -> Typcorrec {
Typcorrec::from_bits(val)
}
}
impl From<Typcorrec> for u8 {
#[inline(always)]
fn from(val: Typcorrec) -> u8 {
Typcorrec::to_bits(val)
}
}
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct WpKey(u32);
impl WpKey {
#[doc = "Writing any other value in this field aborts the write operation of the WP_EN bit. Always reads as 0."]
pub const PASSWD: Self = Self(0x0053_4d43);
}
impl WpKey {
pub const fn from_bits(val: u32) -> WpKey {
Self(val & 0x00ff_ffff)
}
pub const fn to_bits(self) -> u32 {
self.0
}
}
impl core::fmt::Debug for WpKey {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match self.0 {
0x0053_4d43 => f.write_str("PASSWD"),
other => core::write!(f, "0x{:02X}", other),
}
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for WpKey {
fn format(&self, f: defmt::Formatter) {
match self.0 {
0x0053_4d43 => defmt::write!(f, "PASSWD"),
other => defmt::write!(f, "0x{:02X}", other),
}
}
}
impl From<u32> for WpKey {
#[inline(always)]
fn from(val: u32) -> WpKey {
WpKey::from_bits(val)
}
}
impl From<WpKey> for u32 {
#[inline(always)]
fn from(val: WpKey) -> u32 {
WpKey::to_bits(val)
}
}