pub type R = crate::R<ROUTELOC0rs>;
pub type W = crate::W<ROUTELOC0rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SWVLOC {
Loc0 = 0,
Loc1 = 1,
Loc2 = 2,
Loc3 = 3,
}
impl From<SWVLOC> for u8 {
#[inline(always)]
fn from(variant: SWVLOC) -> Self {
variant as _
}
}
impl crate::FieldSpec for SWVLOC {
type Ux = u8;
}
impl crate::IsEnum for SWVLOC {}
pub type SwvlocR = crate::FieldReader<SWVLOC>;
impl SwvlocR {
#[inline(always)]
pub const fn variant(&self) -> Option<SWVLOC> {
match self.bits {
0 => Some(SWVLOC::Loc0),
1 => Some(SWVLOC::Loc1),
2 => Some(SWVLOC::Loc2),
3 => Some(SWVLOC::Loc3),
_ => None,
}
}
#[inline(always)]
pub fn is_loc0(&self) -> bool {
*self == SWVLOC::Loc0
}
#[inline(always)]
pub fn is_loc1(&self) -> bool {
*self == SWVLOC::Loc1
}
#[inline(always)]
pub fn is_loc2(&self) -> bool {
*self == SWVLOC::Loc2
}
#[inline(always)]
pub fn is_loc3(&self) -> bool {
*self == SWVLOC::Loc3
}
}
pub type SwvlocW<'a, REG> = crate::FieldWriter<'a, REG, 6, SWVLOC>;
impl<'a, REG> SwvlocW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn loc0(self) -> &'a mut crate::W<REG> {
self.variant(SWVLOC::Loc0)
}
#[inline(always)]
pub fn loc1(self) -> &'a mut crate::W<REG> {
self.variant(SWVLOC::Loc1)
}
#[inline(always)]
pub fn loc2(self) -> &'a mut crate::W<REG> {
self.variant(SWVLOC::Loc2)
}
#[inline(always)]
pub fn loc3(self) -> &'a mut crate::W<REG> {
self.variant(SWVLOC::Loc3)
}
}
impl R {
#[inline(always)]
pub fn swvloc(&self) -> SwvlocR {
SwvlocR::new((self.bits & 0x3f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ROUTELOC0")
.field("swvloc", &self.swvloc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn swvloc(&mut self) -> SwvlocW<'_, ROUTELOC0rs> {
SwvlocW::new(self, 0)
}
}
pub struct ROUTELOC0rs;
impl crate::RegisterSpec for ROUTELOC0rs {
type Ux = u32;
}
impl crate::Readable for ROUTELOC0rs {}
impl crate::Writable for ROUTELOC0rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ROUTELOC0rs {}