pub type R = crate::R<GCRrs>;
pub type W = crate::W<GCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WW1RSC {
Clear = 0,
Set = 1,
}
impl From<WW1RSC> for bool {
#[inline(always)]
fn from(variant: WW1RSC) -> Self {
variant as u8 != 0
}
}
pub type WW1RSC_R = crate::BitReader<WW1RSC>;
impl WW1RSC_R {
#[inline(always)]
pub const fn variant(&self) -> WW1RSC {
match self.bits {
false => WW1RSC::Clear,
true => WW1RSC::Set,
}
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == WW1RSC::Clear
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == WW1RSC::Set
}
}
pub type WW1RSC_W<'a, REG> = crate::BitWriter<'a, REG, WW1RSC>;
impl<'a, REG> WW1RSC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(WW1RSC::Clear)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(WW1RSC::Set)
}
}
pub type WW2RSC_R = crate::BitReader;
pub type WW2RSC_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BOOT_C1_R = crate::BitReader;
pub type BOOT_C1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BOOT_C2_R = crate::BitReader;
pub type BOOT_C2_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn ww1rsc(&self) -> WW1RSC_R {
WW1RSC_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn ww2rsc(&self) -> WW2RSC_R {
WW2RSC_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn boot_c1(&self) -> BOOT_C1_R {
BOOT_C1_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn boot_c2(&self) -> BOOT_C2_R {
BOOT_C2_R::new(((self.bits >> 3) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GCR")
.field("ww1rsc", &self.ww1rsc())
.field("ww2rsc", &self.ww2rsc())
.field("boot_c1", &self.boot_c1())
.field("boot_c2", &self.boot_c2())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ww1rsc(&mut self) -> WW1RSC_W<GCRrs> {
WW1RSC_W::new(self, 0)
}
#[inline(always)]
pub fn ww2rsc(&mut self) -> WW2RSC_W<GCRrs> {
WW2RSC_W::new(self, 1)
}
#[inline(always)]
pub fn boot_c1(&mut self) -> BOOT_C1_W<GCRrs> {
BOOT_C1_W::new(self, 2)
}
#[inline(always)]
pub fn boot_c2(&mut self) -> BOOT_C2_W<GCRrs> {
BOOT_C2_W::new(self, 3)
}
}
pub struct GCRrs;
impl crate::RegisterSpec for GCRrs {
type Ux = u32;
}
impl crate::Readable for GCRrs {}
impl crate::Writable for GCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for GCRrs {}