py32f0/py32f030/tim3/
sr.rs1pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<SR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SR_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<SR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type UIF_R = crate::BitReader<bool>;
39pub type UIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, bool, O>;
41pub type CC1IF_R = crate::BitReader<CC1IFR_A>;
43#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum CC1IFR_A {
48 Match = 1,
50}
51impl From<CC1IFR_A> for bool {
52 #[inline(always)]
53 fn from(variant: CC1IFR_A) -> Self {
54 variant as u8 != 0
55 }
56}
57impl CC1IF_R {
58 #[inline(always)]
60 pub fn variant(&self) -> Option<CC1IFR_A> {
61 match self.bits {
62 true => Some(CC1IFR_A::Match),
63 _ => None,
64 }
65 }
66 #[inline(always)]
68 pub fn is_match(&self) -> bool {
69 *self == CC1IFR_A::Match
70 }
71}
72#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum CC1IFW_AW {
77 Clear = 0,
79}
80impl From<CC1IFW_AW> for bool {
81 #[inline(always)]
82 fn from(variant: CC1IFW_AW) -> Self {
83 variant as u8 != 0
84 }
85}
86pub type CC1IF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, CC1IFW_AW, O>;
88impl<'a, const O: u8> CC1IF_W<'a, O> {
89 #[inline(always)]
91 pub fn clear(self) -> &'a mut W {
92 self.variant(CC1IFW_AW::Clear)
93 }
94}
95pub use CC1IF_R as CC2IF_R;
97pub use CC1IF_R as CC3IF_R;
99pub use CC1IF_R as CC4IF_R;
101pub use CC1IF_W as CC2IF_W;
103pub use CC1IF_W as CC3IF_W;
105pub use CC1IF_W as CC4IF_W;
107pub type TIF_R = crate::BitReader<TIFR_A>;
109#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum TIFR_A {
114 NoTrigger = 0,
116 Trigger = 1,
118}
119impl From<TIFR_A> for bool {
120 #[inline(always)]
121 fn from(variant: TIFR_A) -> Self {
122 variant as u8 != 0
123 }
124}
125impl TIF_R {
126 #[inline(always)]
128 pub fn variant(&self) -> TIFR_A {
129 match self.bits {
130 false => TIFR_A::NoTrigger,
131 true => TIFR_A::Trigger,
132 }
133 }
134 #[inline(always)]
136 pub fn is_no_trigger(&self) -> bool {
137 *self == TIFR_A::NoTrigger
138 }
139 #[inline(always)]
141 pub fn is_trigger(&self) -> bool {
142 *self == TIFR_A::Trigger
143 }
144}
145#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum TIFW_AW {
150 Clear = 0,
152}
153impl From<TIFW_AW> for bool {
154 #[inline(always)]
155 fn from(variant: TIFW_AW) -> Self {
156 variant as u8 != 0
157 }
158}
159pub type TIF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, TIFW_AW, O>;
161impl<'a, const O: u8> TIF_W<'a, O> {
162 #[inline(always)]
164 pub fn clear(self) -> &'a mut W {
165 self.variant(TIFW_AW::Clear)
166 }
167}
168pub type CC1OF_R = crate::BitReader<CC1OFR_A>;
170#[derive(Clone, Copy, Debug, PartialEq, Eq)]
174pub enum CC1OFR_A {
175 Overcapture = 1,
177}
178impl From<CC1OFR_A> for bool {
179 #[inline(always)]
180 fn from(variant: CC1OFR_A) -> Self {
181 variant as u8 != 0
182 }
183}
184impl CC1OF_R {
185 #[inline(always)]
187 pub fn variant(&self) -> Option<CC1OFR_A> {
188 match self.bits {
189 true => Some(CC1OFR_A::Overcapture),
190 _ => None,
191 }
192 }
193 #[inline(always)]
195 pub fn is_overcapture(&self) -> bool {
196 *self == CC1OFR_A::Overcapture
197 }
198}
199#[derive(Clone, Copy, Debug, PartialEq, Eq)]
203pub enum CC1OFW_AW {
204 Clear = 0,
206}
207impl From<CC1OFW_AW> for bool {
208 #[inline(always)]
209 fn from(variant: CC1OFW_AW) -> Self {
210 variant as u8 != 0
211 }
212}
213pub type CC1OF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, CC1OFW_AW, O>;
215impl<'a, const O: u8> CC1OF_W<'a, O> {
216 #[inline(always)]
218 pub fn clear(self) -> &'a mut W {
219 self.variant(CC1OFW_AW::Clear)
220 }
221}
222pub use CC1OF_R as CC2OF_R;
224pub use CC1OF_R as CC3OF_R;
226pub use CC1OF_R as CC4OF_R;
228pub use CC1OF_W as CC2OF_W;
230pub use CC1OF_W as CC3OF_W;
232pub use CC1OF_W as CC4OF_W;
234impl R {
235 #[inline(always)]
237 pub fn uif(&self) -> UIF_R {
238 UIF_R::new((self.bits & 1) != 0)
239 }
240 #[inline(always)]
242 pub fn cc1if(&self) -> CC1IF_R {
243 CC1IF_R::new(((self.bits >> 1) & 1) != 0)
244 }
245 #[inline(always)]
247 pub fn cc2if(&self) -> CC2IF_R {
248 CC2IF_R::new(((self.bits >> 2) & 1) != 0)
249 }
250 #[inline(always)]
252 pub fn cc3if(&self) -> CC3IF_R {
253 CC3IF_R::new(((self.bits >> 3) & 1) != 0)
254 }
255 #[inline(always)]
257 pub fn cc4if(&self) -> CC4IF_R {
258 CC4IF_R::new(((self.bits >> 4) & 1) != 0)
259 }
260 #[inline(always)]
262 pub fn tif(&self) -> TIF_R {
263 TIF_R::new(((self.bits >> 6) & 1) != 0)
264 }
265 #[inline(always)]
267 pub fn cc1of(&self) -> CC1OF_R {
268 CC1OF_R::new(((self.bits >> 9) & 1) != 0)
269 }
270 #[inline(always)]
272 pub fn cc2of(&self) -> CC2OF_R {
273 CC2OF_R::new(((self.bits >> 10) & 1) != 0)
274 }
275 #[inline(always)]
277 pub fn cc3of(&self) -> CC3OF_R {
278 CC3OF_R::new(((self.bits >> 11) & 1) != 0)
279 }
280 #[inline(always)]
282 pub fn cc4of(&self) -> CC4OF_R {
283 CC4OF_R::new(((self.bits >> 12) & 1) != 0)
284 }
285}
286impl W {
287 #[inline(always)]
289 #[must_use]
290 pub fn uif(&mut self) -> UIF_W<0> {
291 UIF_W::new(self)
292 }
293 #[inline(always)]
295 #[must_use]
296 pub fn cc1if(&mut self) -> CC1IF_W<1> {
297 CC1IF_W::new(self)
298 }
299 #[inline(always)]
301 #[must_use]
302 pub fn cc2if(&mut self) -> CC2IF_W<2> {
303 CC2IF_W::new(self)
304 }
305 #[inline(always)]
307 #[must_use]
308 pub fn cc3if(&mut self) -> CC3IF_W<3> {
309 CC3IF_W::new(self)
310 }
311 #[inline(always)]
313 #[must_use]
314 pub fn cc4if(&mut self) -> CC4IF_W<4> {
315 CC4IF_W::new(self)
316 }
317 #[inline(always)]
319 #[must_use]
320 pub fn tif(&mut self) -> TIF_W<6> {
321 TIF_W::new(self)
322 }
323 #[inline(always)]
325 #[must_use]
326 pub fn cc1of(&mut self) -> CC1OF_W<9> {
327 CC1OF_W::new(self)
328 }
329 #[inline(always)]
331 #[must_use]
332 pub fn cc2of(&mut self) -> CC2OF_W<10> {
333 CC2OF_W::new(self)
334 }
335 #[inline(always)]
337 #[must_use]
338 pub fn cc3of(&mut self) -> CC3OF_W<11> {
339 CC3OF_W::new(self)
340 }
341 #[inline(always)]
343 #[must_use]
344 pub fn cc4of(&mut self) -> CC4OF_W<12> {
345 CC4OF_W::new(self)
346 }
347 #[inline(always)]
349 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
350 self.0.bits(bits);
351 self
352 }
353}
354pub struct SR_SPEC;
360impl crate::RegisterSpec for SR_SPEC {
361 type Ux = u32;
362}
363impl crate::Readable for SR_SPEC {
365 type Reader = R;
366}
367impl crate::Writable for SR_SPEC {
369 type Writer = W;
370 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x1e5e;
371 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
372}
373impl crate::Resettable for SR_SPEC {
375 const RESET_VALUE: Self::Ux = 0;
376}