pub type R = crate::R<SWIER2rs>;
pub type W = crate::W<SWIER2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFTWARE_INTERRUPT {
Pend = 1,
}
impl From<SOFTWARE_INTERRUPT> for bool {
#[inline(always)]
fn from(variant: SOFTWARE_INTERRUPT) -> Self {
variant as u8 != 0
}
}
pub type SWIER49_R = crate::BitReader<SOFTWARE_INTERRUPT>;
impl SWIER49_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SOFTWARE_INTERRUPT> {
match self.bits {
true => Some(SOFTWARE_INTERRUPT::Pend),
_ => None,
}
}
#[inline(always)]
pub fn is_pend(&self) -> bool {
*self == SOFTWARE_INTERRUPT::Pend
}
}
pub type SWIER49_W<'a, REG> = crate::BitWriter<'a, REG, SOFTWARE_INTERRUPT>;
impl<'a, REG> SWIER49_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn pend(self) -> &'a mut crate::W<REG> {
self.variant(SOFTWARE_INTERRUPT::Pend)
}
}
pub use SWIER49_R as SWIER51_R;
pub use SWIER49_W as SWIER51_W;
impl R {
#[inline(always)]
pub fn swier49(&self) -> SWIER49_R {
SWIER49_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn swier51(&self) -> SWIER51_R {
SWIER51_R::new(((self.bits >> 19) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SWIER2")
.field("swier49", &self.swier49())
.field("swier51", &self.swier51())
.finish()
}
}
impl W {
#[inline(always)]
pub fn swier49(&mut self) -> SWIER49_W<SWIER2rs> {
SWIER49_W::new(self, 17)
}
#[inline(always)]
pub fn swier51(&mut self) -> SWIER51_W<SWIER2rs> {
SWIER51_W::new(self, 19)
}
}
pub struct SWIER2rs;
impl crate::RegisterSpec for SWIER2rs {
type Ux = u32;
}
impl crate::Readable for SWIER2rs {}
impl crate::Writable for SWIER2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SWIER2rs {}