#[doc = "Register `CTL` writer"]
pub type W = crate::W<CtlSpec>;
#[doc = "Key value\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Cmd {
#[doc = "21845: Enable access to PR, RLR and WINR registers (0x5555)"]
Enable = 21845,
#[doc = "43690: Reset the watchdog value (0xAAAA)"]
Reset = 43690,
#[doc = "52428: Start the watchdog (0xCCCC)"]
Start = 52428,
}
impl From<Cmd> for u16 {
#[inline(always)]
fn from(variant: Cmd) -> Self {
variant as _
}
}
impl crate::FieldSpec for Cmd {
type Ux = u16;
}
#[doc = "Field `CMD` writer - Key value"]
pub type CmdW<'a, REG> = crate::FieldWriter<'a, REG, 16, Cmd>;
impl<'a, REG> CmdW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u16>,
{
#[doc = "Enable access to PR, RLR and WINR registers (0x5555)"]
#[inline(always)]
pub fn enable(self) -> &'a mut crate::W<REG> {
self.variant(Cmd::Enable)
}
#[doc = "Reset the watchdog value (0xAAAA)"]
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(Cmd::Reset)
}
#[doc = "Start the watchdog (0xCCCC)"]
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(Cmd::Start)
}
}
impl W {
#[doc = "Bits 0:15 - Key value"]
#[inline(always)]
#[must_use]
pub fn cmd(&mut self) -> CmdW<CtlSpec> {
CmdW::new(self, 0)
}
}
#[doc = "Control register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctl::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CtlSpec;
impl crate::RegisterSpec for CtlSpec {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [`ctl::W`](W) writer structure"]
impl crate::Writable for CtlSpec {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CTL to value 0"]
impl crate::Resettable for CtlSpec {
const RESET_VALUE: u32 = 0;
}