1#[doc = "Register `CR` writer"]
2pub struct W(crate::W<CR_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<CR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl core::ops::DerefMut for W {
11 #[inline(always)]
12 fn deref_mut(&mut self) -> &mut Self::Target {
13 &mut self.0
14 }
15}
16impl From<crate::W<CR_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<CR_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Field `WDRSTT` writer - Watchdog Restart"]
23pub type WDRSTT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
24#[doc = "Password."]
25#[derive(Clone, Copy, Debug, PartialEq, Eq)]
26#[repr(u8)]
27pub enum KEY_AW {
28 #[doc = "165: Writing any other value in this field aborts the write operation."]
29 PASSWD = 165,
30}
31impl From<KEY_AW> for u8 {
32 #[inline(always)]
33 fn from(variant: KEY_AW) -> Self {
34 variant as _
35 }
36}
37#[doc = "Field `KEY` writer - Password."]
38pub type KEY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR_SPEC, u8, KEY_AW, 8, O>;
39impl<'a, const O: u8> KEY_W<'a, O> {
40 #[doc = "Writing any other value in this field aborts the write operation."]
41 #[inline(always)]
42 pub fn passwd(self) -> &'a mut W {
43 self.variant(KEY_AW::PASSWD)
44 }
45}
46impl W {
47 #[doc = "Bit 0 - Watchdog Restart"]
48 #[inline(always)]
49 #[must_use]
50 pub fn wdrstt(&mut self) -> WDRSTT_W<0> {
51 WDRSTT_W::new(self)
52 }
53 #[doc = "Bits 24:31 - Password."]
54 #[inline(always)]
55 #[must_use]
56 pub fn key(&mut self) -> KEY_W<24> {
57 KEY_W::new(self)
58 }
59 #[doc = "Writes raw bits to the register."]
60 #[inline(always)]
61 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
62 self.0.bits(bits);
63 self
64 }
65}
66#[doc = "Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"]
67pub struct CR_SPEC;
68impl crate::RegisterSpec for CR_SPEC {
69 type Ux = u32;
70}
71#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
72impl crate::Writable for CR_SPEC {
73 type Writer = W;
74 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
75 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
76}