pub type R = crate::R<PWRCRrs>;
pub type W = crate::W<PWRCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ODEN {
Disabled = 0,
Enabled = 1,
}
impl From<ODEN> for bool {
#[inline(always)]
fn from(variant: ODEN) -> Self {
variant as u8 != 0
}
}
pub type ODEN_R = crate::BitReader<ODEN>;
impl ODEN_R {
#[inline(always)]
pub const fn variant(&self) -> ODEN {
match self.bits {
false => ODEN::Disabled,
true => ODEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ODEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ODEN::Enabled
}
}
pub type ODEN_W<'a, REG> = crate::BitWriter<'a, REG, ODEN>;
impl<'a, REG> ODEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ODEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ODEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn oden(&self) -> ODEN_R {
ODEN_R::new((self.bits & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PWRCR").field("oden", &self.oden()).finish()
}
}
impl W {
#[inline(always)]
pub fn oden(&mut self) -> ODEN_W<PWRCRrs> {
ODEN_W::new(self, 0)
}
}
pub struct PWRCRrs;
impl crate::RegisterSpec for PWRCRrs {
type Ux = u32;
}
impl crate::Readable for PWRCRrs {}
impl crate::Writable for PWRCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for PWRCRrs {}