pub type R = crate::R<SLOTRrs>;
pub type W = crate::W<SLOTRrs>;
pub type FBOFF_R = crate::FieldReader;
pub type FBOFF_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SLOTSZ {
DataSize = 0,
Bit16 = 1,
Bit32 = 2,
}
impl From<SLOTSZ> for u8 {
#[inline(always)]
fn from(variant: SLOTSZ) -> Self {
variant as _
}
}
impl crate::FieldSpec for SLOTSZ {
type Ux = u8;
}
impl crate::IsEnum for SLOTSZ {}
pub type SLOTSZ_R = crate::FieldReader<SLOTSZ>;
impl SLOTSZ_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SLOTSZ> {
match self.bits {
0 => Some(SLOTSZ::DataSize),
1 => Some(SLOTSZ::Bit16),
2 => Some(SLOTSZ::Bit32),
_ => None,
}
}
#[inline(always)]
pub fn is_data_size(&self) -> bool {
*self == SLOTSZ::DataSize
}
#[inline(always)]
pub fn is_bit16(&self) -> bool {
*self == SLOTSZ::Bit16
}
#[inline(always)]
pub fn is_bit32(&self) -> bool {
*self == SLOTSZ::Bit32
}
}
pub type SLOTSZ_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SLOTSZ>;
impl<'a, REG> SLOTSZ_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn data_size(self) -> &'a mut crate::W<REG> {
self.variant(SLOTSZ::DataSize)
}
#[inline(always)]
pub fn bit16(self) -> &'a mut crate::W<REG> {
self.variant(SLOTSZ::Bit16)
}
#[inline(always)]
pub fn bit32(self) -> &'a mut crate::W<REG> {
self.variant(SLOTSZ::Bit32)
}
}
pub type NBSLOT_R = crate::FieldReader;
pub type NBSLOT_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum SLOTEN {
Inactive = 0,
Active = 1,
}
impl From<SLOTEN> for u16 {
#[inline(always)]
fn from(variant: SLOTEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for SLOTEN {
type Ux = u16;
}
impl crate::IsEnum for SLOTEN {}
pub type SLOTEN_R = crate::FieldReader<SLOTEN>;
impl SLOTEN_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SLOTEN> {
match self.bits {
0 => Some(SLOTEN::Inactive),
1 => Some(SLOTEN::Active),
_ => None,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == SLOTEN::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == SLOTEN::Active
}
}
pub type SLOTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 16, SLOTEN>;
impl<'a, REG> SLOTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u16>,
{
#[inline(always)]
pub fn inactive(self) -> &'a mut crate::W<REG> {
self.variant(SLOTEN::Inactive)
}
#[inline(always)]
pub fn active(self) -> &'a mut crate::W<REG> {
self.variant(SLOTEN::Active)
}
}
impl R {
#[inline(always)]
pub fn fboff(&self) -> FBOFF_R {
FBOFF_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn slotsz(&self) -> SLOTSZ_R {
SLOTSZ_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn nbslot(&self) -> NBSLOT_R {
NBSLOT_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn sloten(&self) -> SLOTEN_R {
SLOTEN_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SLOTR")
.field("fboff", &self.fboff())
.field("slotsz", &self.slotsz())
.field("nbslot", &self.nbslot())
.field("sloten", &self.sloten())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fboff(&mut self) -> FBOFF_W<SLOTRrs> {
FBOFF_W::new(self, 0)
}
#[inline(always)]
pub fn slotsz(&mut self) -> SLOTSZ_W<SLOTRrs> {
SLOTSZ_W::new(self, 6)
}
#[inline(always)]
pub fn nbslot(&mut self) -> NBSLOT_W<SLOTRrs> {
NBSLOT_W::new(self, 8)
}
#[inline(always)]
pub fn sloten(&mut self) -> SLOTEN_W<SLOTRrs> {
SLOTEN_W::new(self, 16)
}
}
pub struct SLOTRrs;
impl crate::RegisterSpec for SLOTRrs {
type Ux = u32;
}
impl crate::Readable for SLOTRrs {}
impl crate::Writable for SLOTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SLOTRrs {}