#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Atacs {
#[doc = "Normal operation mode."]
NORMAL = 0x0,
#[doc = "This bit indicates that a completion signal is expected within a programmed amount of time (HSMCI_CSTOR)."]
COMPLETION = 0x01,
}
impl Atacs {
#[inline(always)]
pub const fn from_bits(val: u8) -> Atacs {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Atacs {
#[inline(always)]
fn from(val: u8) -> Atacs {
Atacs::from_bits(val)
}
}
impl From<Atacs> for u8 {
#[inline(always)]
fn from(val: Atacs) -> u8 {
Atacs::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Chksize {
#[doc = "1 data available"]
_1 = 0x0,
#[doc = "4 data available"]
_4 = 0x01,
}
impl Chksize {
#[inline(always)]
pub const fn from_bits(val: u8) -> Chksize {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Chksize {
#[inline(always)]
fn from(val: u8) -> Chksize {
Chksize::from_bits(val)
}
}
impl From<Chksize> for u8 {
#[inline(always)]
fn from(val: Chksize) -> u8 {
Chksize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Cstomul {
#[doc = "CSTOCYC x 1"]
_1 = 0x0,
#[doc = "CSTOCYC x 16"]
_16 = 0x01,
#[doc = "CSTOCYC x 128"]
_128 = 0x02,
#[doc = "CSTOCYC x 256"]
_256 = 0x03,
#[doc = "CSTOCYC x 1024"]
_1024 = 0x04,
#[doc = "CSTOCYC x 4096"]
_4096 = 0x05,
#[doc = "CSTOCYC x 65536"]
_65536 = 0x06,
#[doc = "CSTOCYC x 1048576"]
_1048576 = 0x07,
}
impl Cstomul {
#[inline(always)]
pub const fn from_bits(val: u8) -> Cstomul {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Cstomul {
#[inline(always)]
fn from(val: u8) -> Cstomul {
Cstomul::from_bits(val)
}
}
impl From<Cstomul> for u8 {
#[inline(always)]
fn from(val: Cstomul) -> u8 {
Cstomul::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Dtomul {
#[doc = "DTOCYC"]
_1 = 0x0,
#[doc = "DTOCYC x 16"]
_16 = 0x01,
#[doc = "DTOCYC x 128"]
_128 = 0x02,
#[doc = "DTOCYC x 256"]
_256 = 0x03,
#[doc = "DTOCYC x 1024"]
_1024 = 0x04,
#[doc = "DTOCYC x 4096"]
_4096 = 0x05,
#[doc = "DTOCYC x 65536"]
_65536 = 0x06,
#[doc = "DTOCYC x 1048576"]
_1048576 = 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 Iospcmd {
#[doc = "Not an SDIO Special Command"]
STD = 0x0,
#[doc = "SDIO Suspend Command"]
SUSPEND = 0x01,
#[doc = "SDIO Resume Command"]
RESUME = 0x02,
_RESERVED_3 = 0x03,
}
impl Iospcmd {
#[inline(always)]
pub const fn from_bits(val: u8) -> Iospcmd {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Iospcmd {
#[inline(always)]
fn from(val: u8) -> Iospcmd {
Iospcmd::from_bits(val)
}
}
impl From<Iospcmd> for u8 {
#[inline(always)]
fn from(val: Iospcmd) -> u8 {
Iospcmd::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Maxlat {
#[doc = "5-cycle max latency."]
_5 = 0x0,
#[doc = "64-cycle max latency."]
_64 = 0x01,
}
impl Maxlat {
#[inline(always)]
pub const fn from_bits(val: u8) -> Maxlat {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Maxlat {
#[inline(always)]
fn from(val: u8) -> Maxlat {
Maxlat::from_bits(val)
}
}
impl From<Maxlat> for u8 {
#[inline(always)]
fn from(val: Maxlat) -> u8 {
Maxlat::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Opdcmd {
#[doc = "Push pull command."]
PUSHPULL = 0x0,
#[doc = "Open drain command."]
OPENDRAIN = 0x01,
}
impl Opdcmd {
#[inline(always)]
pub const fn from_bits(val: u8) -> Opdcmd {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Opdcmd {
#[inline(always)]
fn from(val: u8) -> Opdcmd {
Opdcmd::from_bits(val)
}
}
impl From<Opdcmd> for u8 {
#[inline(always)]
fn from(val: Opdcmd) -> u8 {
Opdcmd::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Rsptyp {
#[doc = "No response"]
NORESP = 0x0,
#[doc = "48-bit response"]
_48_BIT = 0x01,
#[doc = "136-bit response"]
_136_BIT = 0x02,
#[doc = "R1b response type"]
R1B = 0x03,
}
impl Rsptyp {
#[inline(always)]
pub const fn from_bits(val: u8) -> Rsptyp {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Rsptyp {
#[inline(always)]
fn from(val: u8) -> Rsptyp {
Rsptyp::from_bits(val)
}
}
impl From<Rsptyp> for u8 {
#[inline(always)]
fn from(val: Rsptyp) -> u8 {
Rsptyp::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Sdcbus {
#[doc = "1 bit"]
_1 = 0x0,
_RESERVED_1 = 0x01,
#[doc = "4 bits"]
_4 = 0x02,
#[doc = "8 bits"]
_8 = 0x03,
}
impl Sdcbus {
#[inline(always)]
pub const fn from_bits(val: u8) -> Sdcbus {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Sdcbus {
#[inline(always)]
fn from(val: u8) -> Sdcbus {
Sdcbus::from_bits(val)
}
}
impl From<Sdcbus> for u8 {
#[inline(always)]
fn from(val: Sdcbus) -> u8 {
Sdcbus::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Sdcsel {
#[doc = "Slot A is selected."]
SLOTA = 0x0,
#[doc = "SDCARD/SDIO Slot B selected"]
SLOTB = 0x01,
#[doc = "-"]
SLOTC = 0x02,
#[doc = "-"]
SLOTD = 0x03,
}
impl Sdcsel {
#[inline(always)]
pub const fn from_bits(val: u8) -> Sdcsel {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Sdcsel {
#[inline(always)]
fn from(val: u8) -> Sdcsel {
Sdcsel::from_bits(val)
}
}
impl From<Sdcsel> for u8 {
#[inline(always)]
fn from(val: Sdcsel) -> u8 {
Sdcsel::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Spcmd {
#[doc = "Not a special CMD."]
STD = 0x0,
#[doc = "Initialization CMD: 74 clock cycles for initialization sequence."]
INIT = 0x01,
#[doc = "Synchronized CMD: Wait for the end of the current data block transfer before sending the pending command."]
SYNC = 0x02,
#[doc = "CE-ATA Completion Signal disable Command. The host cancels the ability for the device to return a command completion signal on the command line."]
CE_ATA = 0x03,
#[doc = "Interrupt command: Corresponds to the Interrupt Mode (CMD40)."]
IT_CMD = 0x04,
#[doc = "Interrupt response: Corresponds to the Interrupt Mode (CMD40)."]
IT_RESP = 0x05,
#[doc = "Boot Operation Request. Start a boot operation mode, the host processor can read boot data from the MMC device directly."]
BOR = 0x06,
#[doc = "End Boot Operation. This command allows the host processor to terminate the boot operation mode."]
EBO = 0x07,
}
impl Spcmd {
#[inline(always)]
pub const fn from_bits(val: u8) -> Spcmd {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Spcmd {
#[inline(always)]
fn from(val: u8) -> Spcmd {
Spcmd::from_bits(val)
}
}
impl From<Spcmd> for u8 {
#[inline(always)]
fn from(val: Spcmd) -> u8 {
Spcmd::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Trcmd {
#[doc = "No data transfer"]
NO_DATA = 0x0,
#[doc = "Start data transfer"]
START_DATA = 0x01,
#[doc = "Stop data transfer"]
STOP_DATA = 0x02,
_RESERVED_3 = 0x03,
}
impl Trcmd {
#[inline(always)]
pub const fn from_bits(val: u8) -> Trcmd {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Trcmd {
#[inline(always)]
fn from(val: u8) -> Trcmd {
Trcmd::from_bits(val)
}
}
impl From<Trcmd> for u8 {
#[inline(always)]
fn from(val: Trcmd) -> u8 {
Trcmd::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Trdir {
#[doc = "Write."]
WRITE = 0x0,
#[doc = "Read."]
READ = 0x01,
}
impl Trdir {
#[inline(always)]
pub const fn from_bits(val: u8) -> Trdir {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Trdir {
#[inline(always)]
fn from(val: u8) -> Trdir {
Trdir::from_bits(val)
}
}
impl From<Trdir> for u8 {
#[inline(always)]
fn from(val: Trdir) -> u8 {
Trdir::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Trtyp {
#[doc = "MMC/SD Card Single Block"]
SINGLE = 0x0,
#[doc = "MMC/SD Card Multiple Block"]
MULTIPLE = 0x01,
#[doc = "MMC Stream"]
STREAM = 0x02,
_RESERVED_3 = 0x03,
#[doc = "SDIO Byte"]
BYTE = 0x04,
#[doc = "SDIO Block"]
BLOCK = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl Trtyp {
#[inline(always)]
pub const fn from_bits(val: u8) -> Trtyp {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Trtyp {
#[inline(always)]
fn from(val: u8) -> Trtyp {
Trtyp::from_bits(val)
}
}
impl From<Trtyp> for u8 {
#[inline(always)]
fn from(val: Trtyp) -> u8 {
Trtyp::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 WPEN bit.Always reads as 0."]
pub const PASSWD: Self = Self(0x004d_4349);
}
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 {
0x004d_4349 => 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 {
0x004d_4349 => 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)
}
}