pub type R = crate::R<CFGrs>;
pub type W = crate::W<CFGrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ARBSLOTS {
One = 0,
Two = 1,
Four = 2,
Eight = 3,
}
impl From<ARBSLOTS> for u8 {
#[inline(always)]
fn from(variant: ARBSLOTS) -> Self {
variant as _
}
}
impl crate::FieldSpec for ARBSLOTS {
type Ux = u8;
}
impl crate::IsEnum for ARBSLOTS {}
pub type ArbslotsR = crate::FieldReader<ARBSLOTS>;
impl ArbslotsR {
#[inline(always)]
pub const fn variant(&self) -> ARBSLOTS {
match self.bits {
0 => ARBSLOTS::One,
1 => ARBSLOTS::Two,
2 => ARBSLOTS::Four,
3 => ARBSLOTS::Eight,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == ARBSLOTS::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == ARBSLOTS::Two
}
#[inline(always)]
pub fn is_four(&self) -> bool {
*self == ARBSLOTS::Four
}
#[inline(always)]
pub fn is_eight(&self) -> bool {
*self == ARBSLOTS::Eight
}
}
pub type ArbslotsW<'a, REG> = crate::FieldWriter<'a, REG, 2, ARBSLOTS, crate::Safe>;
impl<'a, REG> ArbslotsW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(ARBSLOTS::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(ARBSLOTS::Two)
}
#[inline(always)]
pub fn four(self) -> &'a mut crate::W<REG> {
self.variant(ARBSLOTS::Four)
}
#[inline(always)]
pub fn eight(self) -> &'a mut crate::W<REG> {
self.variant(ARBSLOTS::Eight)
}
}
pub type SrcincsignR = crate::BitReader;
pub type SrcincsignW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DstincsignR = crate::BitReader;
pub type DstincsignW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn arbslots(&self) -> ArbslotsR {
ArbslotsR::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn srcincsign(&self) -> SrcincsignR {
SrcincsignR::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn dstincsign(&self) -> DstincsignR {
DstincsignR::new(((self.bits >> 21) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFG")
.field("arbslots", &self.arbslots())
.field("srcincsign", &self.srcincsign())
.field("dstincsign", &self.dstincsign())
.finish()
}
}
impl W {
#[inline(always)]
pub fn arbslots(&mut self) -> ArbslotsW<'_, CFGrs> {
ArbslotsW::new(self, 16)
}
#[inline(always)]
pub fn srcincsign(&mut self) -> SrcincsignW<'_, CFGrs> {
SrcincsignW::new(self, 20)
}
#[inline(always)]
pub fn dstincsign(&mut self) -> DstincsignW<'_, CFGrs> {
DstincsignW::new(self, 21)
}
}
pub struct CFGrs;
impl crate::RegisterSpec for CFGrs {
type Ux = u32;
}
impl crate::Readable for CFGrs {}
impl crate::Writable for CFGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGrs {}