#[doc = "Register `CFG` reader"]
pub struct R(crate::R<CFG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CFG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CFG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CFG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CFG` writer"]
pub struct W(crate::W<CFG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CFG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<CFG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CFG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Debug Mode Run Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DEBUGRUN_A {
#[doc = "0: SYSRTC is frozen in debug mode"]
DISABLE = 0,
#[doc = "1: SYSRTC is running in debug mode"]
ENABLE = 1,
}
impl From<DEBUGRUN_A> for bool {
#[inline(always)]
fn from(variant: DEBUGRUN_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
pub type DEBUGRUN_R = crate::BitReader<DEBUGRUN_A>;
impl DEBUGRUN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DEBUGRUN_A {
match self.bits {
false => DEBUGRUN_A::DISABLE,
true => DEBUGRUN_A::ENABLE,
}
}
#[doc = "Checks if the value of the field is `DISABLE`"]
#[inline(always)]
pub fn is_disable(&self) -> bool {
*self == DEBUGRUN_A::DISABLE
}
#[doc = "Checks if the value of the field is `ENABLE`"]
#[inline(always)]
pub fn is_enable(&self) -> bool {
*self == DEBUGRUN_A::ENABLE
}
}
#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
pub type DEBUGRUN_W<'a> = crate::BitWriter<'a, u32, CFG_SPEC, DEBUGRUN_A, 0>;
impl<'a> DEBUGRUN_W<'a> {
#[doc = "SYSRTC is frozen in debug mode"]
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(DEBUGRUN_A::DISABLE)
}
#[doc = "SYSRTC is running in debug mode"]
#[inline(always)]
pub fn enable(self) -> &'a mut W {
self.variant(DEBUGRUN_A::ENABLE)
}
}
impl R {
#[doc = "Bit 0 - Debug Mode Run Enable"]
#[inline(always)]
pub fn debugrun(&self) -> DEBUGRUN_R {
DEBUGRUN_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Debug Mode Run Enable"]
#[inline(always)]
pub fn debugrun(&mut self) -> DEBUGRUN_W {
DEBUGRUN_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "No Description\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CFG_SPEC;
impl crate::RegisterSpec for CFG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [cfg::R](R) reader structure"]
impl crate::Readable for CFG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"]
impl crate::Writable for CFG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CFG to value 0"]
impl crate::Resettable for CFG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}