py32f0/py32f030/wwdg/
cr.rs1pub struct R(crate::R<CR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<CR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type T_R = crate::FieldReader<u8, u8>;
39pub type T_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CR_SPEC, u8, u8, 7, O>;
41pub type WDGA_R = crate::BitReader<WDGA_A>;
43#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum WDGA_A {
48 Disabled = 0,
50 Enabled = 1,
52}
53impl From<WDGA_A> for bool {
54 #[inline(always)]
55 fn from(variant: WDGA_A) -> Self {
56 variant as u8 != 0
57 }
58}
59impl WDGA_R {
60 #[inline(always)]
62 pub fn variant(&self) -> WDGA_A {
63 match self.bits {
64 false => WDGA_A::Disabled,
65 true => WDGA_A::Enabled,
66 }
67 }
68 #[inline(always)]
70 pub fn is_disabled(&self) -> bool {
71 *self == WDGA_A::Disabled
72 }
73 #[inline(always)]
75 pub fn is_enabled(&self) -> bool {
76 *self == WDGA_A::Enabled
77 }
78}
79pub type WDGA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, WDGA_A, O>;
81impl<'a, const O: u8> WDGA_W<'a, O> {
82 #[inline(always)]
84 pub fn disabled(self) -> &'a mut W {
85 self.variant(WDGA_A::Disabled)
86 }
87 #[inline(always)]
89 pub fn enabled(self) -> &'a mut W {
90 self.variant(WDGA_A::Enabled)
91 }
92}
93impl R {
94 #[inline(always)]
96 pub fn t(&self) -> T_R {
97 T_R::new((self.bits & 0x7f) as u8)
98 }
99 #[inline(always)]
101 pub fn wdga(&self) -> WDGA_R {
102 WDGA_R::new(((self.bits >> 7) & 1) != 0)
103 }
104}
105impl W {
106 #[inline(always)]
108 #[must_use]
109 pub fn t(&mut self) -> T_W<0> {
110 T_W::new(self)
111 }
112 #[inline(always)]
114 #[must_use]
115 pub fn wdga(&mut self) -> WDGA_W<7> {
116 WDGA_W::new(self)
117 }
118 #[inline(always)]
120 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
121 self.0.bits(bits);
122 self
123 }
124}
125pub struct CR_SPEC;
131impl crate::RegisterSpec for CR_SPEC {
132 type Ux = u32;
133}
134impl crate::Readable for CR_SPEC {
136 type Reader = R;
137}
138impl crate::Writable for CR_SPEC {
140 type Writer = W;
141 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
142 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
143}
144impl crate::Resettable for CR_SPEC {
146 const RESET_VALUE: Self::Ux = 0x7f;
147}