pub type R = crate::R<IOPENRrs>;
pub type W = crate::W<IOPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IOPAEN {
Disabled = 0,
Enabled = 1,
}
impl From<IOPAEN> for bool {
#[inline(always)]
fn from(variant: IOPAEN) -> Self {
variant as u8 != 0
}
}
pub type IOPAEN_R = crate::BitReader<IOPAEN>;
impl IOPAEN_R {
#[inline(always)]
pub const fn variant(&self) -> IOPAEN {
match self.bits {
false => IOPAEN::Disabled,
true => IOPAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == IOPAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == IOPAEN::Enabled
}
}
pub type IOPAEN_W<'a, REG> = crate::BitWriter<'a, REG, IOPAEN>;
impl<'a, REG> IOPAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(IOPAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(IOPAEN::Enabled)
}
}
pub use IOPAEN_R as IOPBEN_R;
pub use IOPAEN_R as IOPCEN_R;
pub use IOPAEN_R as IOPDEN_R;
pub use IOPAEN_R as IOPEEN_R;
pub use IOPAEN_R as IOPHEN_R;
pub use IOPAEN_W as IOPBEN_W;
pub use IOPAEN_W as IOPCEN_W;
pub use IOPAEN_W as IOPDEN_W;
pub use IOPAEN_W as IOPEEN_W;
pub use IOPAEN_W as IOPHEN_W;
impl R {
#[inline(always)]
pub fn iopaen(&self) -> IOPAEN_R {
IOPAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn iopben(&self) -> IOPBEN_R {
IOPBEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn iopcen(&self) -> IOPCEN_R {
IOPCEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn iopden(&self) -> IOPDEN_R {
IOPDEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn iopeen(&self) -> IOPEEN_R {
IOPEEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn iophen(&self) -> IOPHEN_R {
IOPHEN_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("IOPENR")
.field("iopaen", &self.iopaen())
.field("iophen", &self.iophen())
.field("iopden", &self.iopden())
.field("iopcen", &self.iopcen())
.field("iopben", &self.iopben())
.field("iopeen", &self.iopeen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn iopaen(&mut self) -> IOPAEN_W<IOPENRrs> {
IOPAEN_W::new(self, 0)
}
#[inline(always)]
pub fn iopben(&mut self) -> IOPBEN_W<IOPENRrs> {
IOPBEN_W::new(self, 1)
}
#[inline(always)]
pub fn iopcen(&mut self) -> IOPCEN_W<IOPENRrs> {
IOPCEN_W::new(self, 2)
}
#[inline(always)]
pub fn iopden(&mut self) -> IOPDEN_W<IOPENRrs> {
IOPDEN_W::new(self, 3)
}
#[inline(always)]
pub fn iopeen(&mut self) -> IOPEEN_W<IOPENRrs> {
IOPEEN_W::new(self, 4)
}
#[inline(always)]
pub fn iophen(&mut self) -> IOPHEN_W<IOPENRrs> {
IOPHEN_W::new(self, 7)
}
}
pub struct IOPENRrs;
impl crate::RegisterSpec for IOPENRrs {
type Ux = u32;
}
impl crate::Readable for IOPENRrs {}
impl crate::Writable for IOPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for IOPENRrs {}