#[doc = "Register `CTRL` reader"]
pub type R = crate::R<CTRL_SPEC>;
#[doc = "Register `CTRL` writer"]
pub type W = crate::W<CTRL_SPEC>;
#[doc = "Field `ENABLE` reader - Enable"]
pub type ENABLE_R = crate::BitReader;
#[doc = "Field `ENABLE` writer - Enable"]
pub type ENABLE_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O>;
#[doc = "Field `WEN` reader - Watchdog Timer Window Mode Enable"]
pub type WEN_R = crate::BitReader;
#[doc = "Field `WEN` writer - Watchdog Timer Window Mode Enable"]
pub type WEN_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O>;
#[doc = "Field `ALWAYSON` reader - Always-On"]
pub type ALWAYSON_R = crate::BitReader;
#[doc = "Field `ALWAYSON` writer - Always-On"]
pub type ALWAYSON_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O>;
impl R {
#[doc = "Bit 1 - Enable"]
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Watchdog Timer Window Mode Enable"]
#[inline(always)]
pub fn wen(&self) -> WEN_R {
WEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 7 - Always-On"]
#[inline(always)]
pub fn alwayson(&self) -> ALWAYSON_R {
ALWAYSON_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl W {
#[doc = "Bit 1 - Enable"]
#[inline(always)]
#[must_use]
pub fn enable(&mut self) -> ENABLE_W<CTRL_SPEC, 1> {
ENABLE_W::new(self)
}
#[doc = "Bit 2 - Watchdog Timer Window Mode Enable"]
#[inline(always)]
#[must_use]
pub fn wen(&mut self) -> WEN_W<CTRL_SPEC, 2> {
WEN_W::new(self)
}
#[doc = "Bit 7 - Always-On"]
#[inline(always)]
#[must_use]
pub fn alwayson(&mut self) -> ALWAYSON_W<CTRL_SPEC, 7> {
ALWAYSON_W::new(self)
}
#[doc = r" Writes raw bits to the register."]
#[doc = r""]
#[doc = r" # Safety"]
#[doc = r""]
#[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
self.bits = bits;
self
}
}
#[doc = "Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CTRL_SPEC;
impl crate::RegisterSpec for CTRL_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [`ctrl::R`](R) reader structure"]
impl crate::Readable for CTRL_SPEC {}
#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
impl crate::Writable for CTRL_SPEC {
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets CTRL to value 0"]
impl crate::Resettable for CTRL_SPEC {
const RESET_VALUE: Self::Ux = 0;
}