#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct Arch(u8);
impl Arch {
#[doc = "SAM3AxC (100-pin version)"]
pub const SAM3AX_C: Self = Self(0x83);
#[doc = "SAM3XxC (100-pin version)"]
pub const SAM3XX_C: Self = Self(0x84);
#[doc = "SAM3XxE (144-pin version)"]
pub const SAM3XX_E: Self = Self(0x85);
#[doc = "SAM3XxG (208/217-pin version)"]
pub const SAM3XX_G: Self = Self(0x86);
}
impl Arch {
pub const fn from_bits(val: u8) -> Arch {
Self(val & 0xff)
}
pub const fn to_bits(self) -> u8 {
self.0
}
}
impl core::fmt::Debug for Arch {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match self.0 {
0x83 => f.write_str("SAM3AX_C"),
0x84 => f.write_str("SAM3XX_C"),
0x85 => f.write_str("SAM3XX_E"),
0x86 => f.write_str("SAM3XX_G"),
other => core::write!(f, "0x{:02X}", other),
}
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Arch {
fn format(&self, f: defmt::Formatter) {
match self.0 {
0x83 => defmt::write!(f, "SAM3AX_C"),
0x84 => defmt::write!(f, "SAM3XX_C"),
0x85 => defmt::write!(f, "SAM3XX_E"),
0x86 => defmt::write!(f, "SAM3XX_G"),
other => defmt::write!(f, "0x{:02X}", other),
}
}
}
impl From<u8> for Arch {
#[inline(always)]
fn from(val: u8) -> Arch {
Arch::from_bits(val)
}
}
impl From<Arch> for u8 {
#[inline(always)]
fn from(val: Arch) -> u8 {
Arch::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Eproc {
_RESERVED_0 = 0x0,
#[doc = "ARM946ES"]
ARM946ES = 0x01,
#[doc = "ARM7TDMI"]
ARM7TDMI = 0x02,
#[doc = "Cortex-M3"]
CM3 = 0x03,
#[doc = "ARM920T"]
ARM920T = 0x04,
#[doc = "ARM926EJS"]
ARM926EJS = 0x05,
#[doc = "Cortex-A5"]
CA5 = 0x06,
#[doc = "Cortex-M4"]
CM4 = 0x07,
}
impl Eproc {
#[inline(always)]
pub const fn from_bits(val: u8) -> Eproc {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Eproc {
#[inline(always)]
fn from(val: u8) -> Eproc {
Eproc::from_bits(val)
}
}
impl From<Eproc> for u8 {
#[inline(always)]
fn from(val: Eproc) -> u8 {
Eproc::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Nvpsiz {
#[doc = "None"]
NONE = 0x0,
#[doc = "8 Kbytes"]
_8K = 0x01,
#[doc = "16 Kbytes"]
_16K = 0x02,
#[doc = "32 Kbytes"]
_32K = 0x03,
_RESERVED_4 = 0x04,
#[doc = "64 Kbytes"]
_64K = 0x05,
_RESERVED_6 = 0x06,
#[doc = "128 Kbytes"]
_128K = 0x07,
_RESERVED_8 = 0x08,
#[doc = "256 Kbytes"]
_256K = 0x09,
#[doc = "512 Kbytes"]
_512K = 0x0a,
_RESERVED_b = 0x0b,
#[doc = "1024 Kbytes"]
_1024K = 0x0c,
_RESERVED_d = 0x0d,
#[doc = "2048 Kbytes"]
_2048K = 0x0e,
_RESERVED_f = 0x0f,
}
impl Nvpsiz {
#[inline(always)]
pub const fn from_bits(val: u8) -> Nvpsiz {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Nvpsiz {
#[inline(always)]
fn from(val: u8) -> Nvpsiz {
Nvpsiz::from_bits(val)
}
}
impl From<Nvpsiz> for u8 {
#[inline(always)]
fn from(val: Nvpsiz) -> u8 {
Nvpsiz::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Nvpsiz2 {
#[doc = "None"]
NONE = 0x0,
#[doc = "8 Kbytes"]
_8K = 0x01,
#[doc = "16 Kbytes"]
_16K = 0x02,
#[doc = "32 Kbytes"]
_32K = 0x03,
_RESERVED_4 = 0x04,
#[doc = "64 Kbytes"]
_64K = 0x05,
_RESERVED_6 = 0x06,
#[doc = "128 Kbytes"]
_128K = 0x07,
_RESERVED_8 = 0x08,
#[doc = "256 Kbytes"]
_256K = 0x09,
#[doc = "512 Kbytes"]
_512K = 0x0a,
_RESERVED_b = 0x0b,
#[doc = "1024 Kbytes"]
_1024K = 0x0c,
_RESERVED_d = 0x0d,
#[doc = "2048 Kbytes"]
_2048K = 0x0e,
_RESERVED_f = 0x0f,
}
impl Nvpsiz2 {
#[inline(always)]
pub const fn from_bits(val: u8) -> Nvpsiz2 {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Nvpsiz2 {
#[inline(always)]
fn from(val: u8) -> Nvpsiz2 {
Nvpsiz2::from_bits(val)
}
}
impl From<Nvpsiz2> for u8 {
#[inline(always)]
fn from(val: Nvpsiz2) -> u8 {
Nvpsiz2::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Nvptyp {
#[doc = "ROM"]
ROM = 0x0,
#[doc = "ROMless or on-chip Flash"]
ROMLESS = 0x01,
#[doc = "Embedded Flash Memory"]
FLASH = 0x02,
#[doc = "ROM and Embedded Flash Memory- NVPSIZ is ROM size- NVPSIZ2 is Flash size"]
ROM_FLASH = 0x03,
#[doc = "SRAM emulating ROM"]
SRAM = 0x04,
_RESERVED_5 = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl Nvptyp {
#[inline(always)]
pub const fn from_bits(val: u8) -> Nvptyp {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Nvptyp {
#[inline(always)]
fn from(val: u8) -> Nvptyp {
Nvptyp::from_bits(val)
}
}
impl From<Nvptyp> for u8 {
#[inline(always)]
fn from(val: Nvptyp) -> u8 {
Nvptyp::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Sramsiz {
#[doc = "48 Kbytes"]
_48K = 0x0,
#[doc = "192 Kbytes"]
_192K = 0x01,
#[doc = "2 Kbytes"]
_2K = 0x02,
#[doc = "6 Kbytes"]
_6K = 0x03,
#[doc = "24 Kbytes"]
_24K = 0x04,
#[doc = "4 Kbytes"]
_4K = 0x05,
#[doc = "80 Kbytes"]
_80K = 0x06,
#[doc = "160 Kbytes"]
_160K = 0x07,
#[doc = "8 Kbytes"]
_8K = 0x08,
#[doc = "16 Kbytes"]
_16K = 0x09,
#[doc = "32 Kbytes"]
_32K = 0x0a,
#[doc = "64 Kbytes"]
_64K = 0x0b,
#[doc = "128 Kbytes"]
_128K = 0x0c,
#[doc = "256 Kbytes"]
_256K = 0x0d,
#[doc = "96 Kbytes"]
_96K = 0x0e,
#[doc = "512 Kbytes"]
_512K = 0x0f,
}
impl Sramsiz {
#[inline(always)]
pub const fn from_bits(val: u8) -> Sramsiz {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Sramsiz {
#[inline(always)]
fn from(val: u8) -> Sramsiz {
Sramsiz::from_bits(val)
}
}
impl From<Sramsiz> for u8 {
#[inline(always)]
fn from(val: Sramsiz) -> u8 {
Sramsiz::to_bits(val)
}
}