py32f0/py32f030/rtc/
crh.rs1pub struct R(crate::R<CRH_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CRH_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CRH_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CRH_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<CRH_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CRH_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<CRH_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CRH_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type SECIE_R = crate::BitReader<SECIE_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum SECIE_A {
44 Disabled = 0,
46 Enabled = 1,
48}
49impl From<SECIE_A> for bool {
50 #[inline(always)]
51 fn from(variant: SECIE_A) -> Self {
52 variant as u8 != 0
53 }
54}
55impl SECIE_R {
56 #[inline(always)]
58 pub fn variant(&self) -> SECIE_A {
59 match self.bits {
60 false => SECIE_A::Disabled,
61 true => SECIE_A::Enabled,
62 }
63 }
64 #[inline(always)]
66 pub fn is_disabled(&self) -> bool {
67 *self == SECIE_A::Disabled
68 }
69 #[inline(always)]
71 pub fn is_enabled(&self) -> bool {
72 *self == SECIE_A::Enabled
73 }
74}
75pub type SECIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CRH_SPEC, SECIE_A, O>;
77impl<'a, const O: u8> SECIE_W<'a, O> {
78 #[inline(always)]
80 pub fn disabled(self) -> &'a mut W {
81 self.variant(SECIE_A::Disabled)
82 }
83 #[inline(always)]
85 pub fn enabled(self) -> &'a mut W {
86 self.variant(SECIE_A::Enabled)
87 }
88}
89pub type ALRIE_R = crate::BitReader<ALRIE_A>;
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95pub enum ALRIE_A {
96 Disabled = 0,
98 Enabled = 1,
100}
101impl From<ALRIE_A> for bool {
102 #[inline(always)]
103 fn from(variant: ALRIE_A) -> Self {
104 variant as u8 != 0
105 }
106}
107impl ALRIE_R {
108 #[inline(always)]
110 pub fn variant(&self) -> ALRIE_A {
111 match self.bits {
112 false => ALRIE_A::Disabled,
113 true => ALRIE_A::Enabled,
114 }
115 }
116 #[inline(always)]
118 pub fn is_disabled(&self) -> bool {
119 *self == ALRIE_A::Disabled
120 }
121 #[inline(always)]
123 pub fn is_enabled(&self) -> bool {
124 *self == ALRIE_A::Enabled
125 }
126}
127pub type ALRIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CRH_SPEC, ALRIE_A, O>;
129impl<'a, const O: u8> ALRIE_W<'a, O> {
130 #[inline(always)]
132 pub fn disabled(self) -> &'a mut W {
133 self.variant(ALRIE_A::Disabled)
134 }
135 #[inline(always)]
137 pub fn enabled(self) -> &'a mut W {
138 self.variant(ALRIE_A::Enabled)
139 }
140}
141pub type OWIE_R = crate::BitReader<OWIE_A>;
143#[derive(Clone, Copy, Debug, PartialEq, Eq)]
147pub enum OWIE_A {
148 Disabled = 0,
150 Enabled = 1,
152}
153impl From<OWIE_A> for bool {
154 #[inline(always)]
155 fn from(variant: OWIE_A) -> Self {
156 variant as u8 != 0
157 }
158}
159impl OWIE_R {
160 #[inline(always)]
162 pub fn variant(&self) -> OWIE_A {
163 match self.bits {
164 false => OWIE_A::Disabled,
165 true => OWIE_A::Enabled,
166 }
167 }
168 #[inline(always)]
170 pub fn is_disabled(&self) -> bool {
171 *self == OWIE_A::Disabled
172 }
173 #[inline(always)]
175 pub fn is_enabled(&self) -> bool {
176 *self == OWIE_A::Enabled
177 }
178}
179pub type OWIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CRH_SPEC, OWIE_A, O>;
181impl<'a, const O: u8> OWIE_W<'a, O> {
182 #[inline(always)]
184 pub fn disabled(self) -> &'a mut W {
185 self.variant(OWIE_A::Disabled)
186 }
187 #[inline(always)]
189 pub fn enabled(self) -> &'a mut W {
190 self.variant(OWIE_A::Enabled)
191 }
192}
193impl R {
194 #[inline(always)]
196 pub fn secie(&self) -> SECIE_R {
197 SECIE_R::new((self.bits & 1) != 0)
198 }
199 #[inline(always)]
201 pub fn alrie(&self) -> ALRIE_R {
202 ALRIE_R::new(((self.bits >> 1) & 1) != 0)
203 }
204 #[inline(always)]
206 pub fn owie(&self) -> OWIE_R {
207 OWIE_R::new(((self.bits >> 2) & 1) != 0)
208 }
209}
210impl W {
211 #[inline(always)]
213 #[must_use]
214 pub fn secie(&mut self) -> SECIE_W<0> {
215 SECIE_W::new(self)
216 }
217 #[inline(always)]
219 #[must_use]
220 pub fn alrie(&mut self) -> ALRIE_W<1> {
221 ALRIE_W::new(self)
222 }
223 #[inline(always)]
225 #[must_use]
226 pub fn owie(&mut self) -> OWIE_W<2> {
227 OWIE_W::new(self)
228 }
229 #[inline(always)]
231 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
232 self.0.bits(bits);
233 self
234 }
235}
236pub struct CRH_SPEC;
242impl crate::RegisterSpec for CRH_SPEC {
243 type Ux = u32;
244}
245impl crate::Readable for CRH_SPEC {
247 type Reader = R;
248}
249impl crate::Writable for CRH_SPEC {
251 type Writer = W;
252 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
253 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
254}
255impl crate::Resettable for CRH_SPEC {
257 const RESET_VALUE: Self::Ux = 0;
258}