pub type R = crate::R<IOPSMENrs>;
pub type W = crate::W<IOPSMENrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IOPASMEN {
Disabled = 0,
Enabled = 1,
}
impl From<IOPASMEN> for bool {
#[inline(always)]
fn from(variant: IOPASMEN) -> Self {
variant as u8 != 0
}
}
pub type IOPASMEN_R = crate::BitReader<IOPASMEN>;
impl IOPASMEN_R {
#[inline(always)]
pub const fn variant(&self) -> IOPASMEN {
match self.bits {
false => IOPASMEN::Disabled,
true => IOPASMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == IOPASMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == IOPASMEN::Enabled
}
}
pub type IOPASMEN_W<'a, REG> = crate::BitWriter<'a, REG, IOPASMEN>;
impl<'a, REG> IOPASMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(IOPASMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(IOPASMEN::Enabled)
}
}
pub use IOPASMEN_R as IOPBSMEN_R;
pub use IOPASMEN_R as IOPCSMEN_R;
pub use IOPASMEN_R as IOPDSMEN_R;
pub use IOPASMEN_R as IOPESMEN_R;
pub use IOPASMEN_R as IOPHSMEN_R;
pub use IOPASMEN_W as IOPBSMEN_W;
pub use IOPASMEN_W as IOPCSMEN_W;
pub use IOPASMEN_W as IOPDSMEN_W;
pub use IOPASMEN_W as IOPESMEN_W;
pub use IOPASMEN_W as IOPHSMEN_W;
impl R {
#[inline(always)]
pub fn iopasmen(&self) -> IOPASMEN_R {
IOPASMEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn iopbsmen(&self) -> IOPBSMEN_R {
IOPBSMEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn iopcsmen(&self) -> IOPCSMEN_R {
IOPCSMEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn iopdsmen(&self) -> IOPDSMEN_R {
IOPDSMEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn iopesmen(&self) -> IOPESMEN_R {
IOPESMEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn iophsmen(&self) -> IOPHSMEN_R {
IOPHSMEN_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("IOPSMEN")
.field("iopasmen", &self.iopasmen())
.field("iophsmen", &self.iophsmen())
.field("iopdsmen", &self.iopdsmen())
.field("iopcsmen", &self.iopcsmen())
.field("iopbsmen", &self.iopbsmen())
.field("iopesmen", &self.iopesmen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn iopasmen(&mut self) -> IOPASMEN_W<IOPSMENrs> {
IOPASMEN_W::new(self, 0)
}
#[inline(always)]
pub fn iopbsmen(&mut self) -> IOPBSMEN_W<IOPSMENrs> {
IOPBSMEN_W::new(self, 1)
}
#[inline(always)]
pub fn iopcsmen(&mut self) -> IOPCSMEN_W<IOPSMENrs> {
IOPCSMEN_W::new(self, 2)
}
#[inline(always)]
pub fn iopdsmen(&mut self) -> IOPDSMEN_W<IOPSMENrs> {
IOPDSMEN_W::new(self, 3)
}
#[inline(always)]
pub fn iopesmen(&mut self) -> IOPESMEN_W<IOPSMENrs> {
IOPESMEN_W::new(self, 4)
}
#[inline(always)]
pub fn iophsmen(&mut self) -> IOPHSMEN_W<IOPSMENrs> {
IOPHSMEN_W::new(self, 7)
}
}
pub struct IOPSMENrs;
impl crate::RegisterSpec for IOPSMENrs {
type Ux = u32;
}
impl crate::Readable for IOPSMENrs {}
impl crate::Writable for IOPSMENrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for IOPSMENrs {
const RESET_VALUE: u32 = 0x8f;
}