stm32f1_staging/stm32f100/tim16/
sr.rs1pub type R = crate::R<SRrs>;
3pub type W = crate::W<SRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum UIFR {
11 NoUpdateOccurred = 0,
13 UpdatePending = 1,
15}
16impl From<UIFR> for bool {
17 #[inline(always)]
18 fn from(variant: UIFR) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type UIF_R = crate::BitReader<UIFR>;
24impl UIF_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> UIFR {
28 match self.bits {
29 false => UIFR::NoUpdateOccurred,
30 true => UIFR::UpdatePending,
31 }
32 }
33 #[inline(always)]
35 pub fn is_no_update_occurred(&self) -> bool {
36 *self == UIFR::NoUpdateOccurred
37 }
38 #[inline(always)]
40 pub fn is_update_pending(&self) -> bool {
41 *self == UIFR::UpdatePending
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum UIFW {
50 Clear = 0,
52}
53impl From<UIFW> for bool {
54 #[inline(always)]
55 fn from(variant: UIFW) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type UIF_W<'a, REG> = crate::BitWriter0C<'a, REG, UIFW>;
61impl<'a, REG> UIF_W<'a, REG>
62where
63 REG: crate::Writable + crate::RegisterSpec,
64{
65 #[inline(always)]
67 pub fn clear(self) -> &'a mut crate::W<REG> {
68 self.variant(UIFW::Clear)
69 }
70}
71#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum CC1IFR {
77 NoMatch = 0,
79 Match = 1,
81}
82impl From<CC1IFR> for bool {
83 #[inline(always)]
84 fn from(variant: CC1IFR) -> Self {
85 variant as u8 != 0
86 }
87}
88pub type CCIF_R = crate::BitReader<CC1IFR>;
90impl CCIF_R {
91 #[inline(always)]
93 pub const fn variant(&self) -> CC1IFR {
94 match self.bits {
95 false => CC1IFR::NoMatch,
96 true => CC1IFR::Match,
97 }
98 }
99 #[inline(always)]
101 pub fn is_no_match(&self) -> bool {
102 *self == CC1IFR::NoMatch
103 }
104 #[inline(always)]
106 pub fn is_match(&self) -> bool {
107 *self == CC1IFR::Match
108 }
109}
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum CC1IFW {
116 Clear = 0,
118}
119impl From<CC1IFW> for bool {
120 #[inline(always)]
121 fn from(variant: CC1IFW) -> Self {
122 variant as u8 != 0
123 }
124}
125pub type CCIF_W<'a, REG> = crate::BitWriter0C<'a, REG, CC1IFW>;
127impl<'a, REG> CCIF_W<'a, REG>
128where
129 REG: crate::Writable + crate::RegisterSpec,
130{
131 #[inline(always)]
133 pub fn clear(self) -> &'a mut crate::W<REG> {
134 self.variant(CC1IFW::Clear)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum COMIFR {
143 NoCom = 0,
145 Com = 1,
147}
148impl From<COMIFR> for bool {
149 #[inline(always)]
150 fn from(variant: COMIFR) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type COMIF_R = crate::BitReader<COMIFR>;
156impl COMIF_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> COMIFR {
160 match self.bits {
161 false => COMIFR::NoCom,
162 true => COMIFR::Com,
163 }
164 }
165 #[inline(always)]
167 pub fn is_no_com(&self) -> bool {
168 *self == COMIFR::NoCom
169 }
170 #[inline(always)]
172 pub fn is_com(&self) -> bool {
173 *self == COMIFR::Com
174 }
175}
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
180#[derive(Clone, Copy, Debug, PartialEq, Eq)]
181pub enum COMIFW {
182 Clear = 0,
184}
185impl From<COMIFW> for bool {
186 #[inline(always)]
187 fn from(variant: COMIFW) -> Self {
188 variant as u8 != 0
189 }
190}
191pub type COMIF_W<'a, REG> = crate::BitWriter0C<'a, REG, COMIFW>;
193impl<'a, REG> COMIF_W<'a, REG>
194where
195 REG: crate::Writable + crate::RegisterSpec,
196{
197 #[inline(always)]
199 pub fn clear(self) -> &'a mut crate::W<REG> {
200 self.variant(COMIFW::Clear)
201 }
202}
203pub type TIF_R = crate::BitReader;
205pub type TIF_W<'a, REG> = crate::BitWriter<'a, REG>;
207#[cfg_attr(feature = "defmt", derive(defmt::Format))]
211#[derive(Clone, Copy, Debug, PartialEq, Eq)]
212pub enum BIFR {
213 NoTrigger = 0,
215 Trigger = 1,
217}
218impl From<BIFR> for bool {
219 #[inline(always)]
220 fn from(variant: BIFR) -> Self {
221 variant as u8 != 0
222 }
223}
224pub type BIF_R = crate::BitReader<BIFR>;
226impl BIF_R {
227 #[inline(always)]
229 pub const fn variant(&self) -> BIFR {
230 match self.bits {
231 false => BIFR::NoTrigger,
232 true => BIFR::Trigger,
233 }
234 }
235 #[inline(always)]
237 pub fn is_no_trigger(&self) -> bool {
238 *self == BIFR::NoTrigger
239 }
240 #[inline(always)]
242 pub fn is_trigger(&self) -> bool {
243 *self == BIFR::Trigger
244 }
245}
246#[cfg_attr(feature = "defmt", derive(defmt::Format))]
250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251pub enum BIFW {
252 Clear = 0,
254}
255impl From<BIFW> for bool {
256 #[inline(always)]
257 fn from(variant: BIFW) -> Self {
258 variant as u8 != 0
259 }
260}
261pub type BIF_W<'a, REG> = crate::BitWriter0C<'a, REG, BIFW>;
263impl<'a, REG> BIF_W<'a, REG>
264where
265 REG: crate::Writable + crate::RegisterSpec,
266{
267 #[inline(always)]
269 pub fn clear(self) -> &'a mut crate::W<REG> {
270 self.variant(BIFW::Clear)
271 }
272}
273#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum CC1OFR {
279 NoOvercapture = 0,
281 Overcapture = 1,
283}
284impl From<CC1OFR> for bool {
285 #[inline(always)]
286 fn from(variant: CC1OFR) -> Self {
287 variant as u8 != 0
288 }
289}
290pub type CCOF_R = crate::BitReader<CC1OFR>;
292impl CCOF_R {
293 #[inline(always)]
295 pub const fn variant(&self) -> CC1OFR {
296 match self.bits {
297 false => CC1OFR::NoOvercapture,
298 true => CC1OFR::Overcapture,
299 }
300 }
301 #[inline(always)]
303 pub fn is_no_overcapture(&self) -> bool {
304 *self == CC1OFR::NoOvercapture
305 }
306 #[inline(always)]
308 pub fn is_overcapture(&self) -> bool {
309 *self == CC1OFR::Overcapture
310 }
311}
312#[cfg_attr(feature = "defmt", derive(defmt::Format))]
316#[derive(Clone, Copy, Debug, PartialEq, Eq)]
317pub enum CC1OFW {
318 Clear = 0,
320}
321impl From<CC1OFW> for bool {
322 #[inline(always)]
323 fn from(variant: CC1OFW) -> Self {
324 variant as u8 != 0
325 }
326}
327pub type CCOF_W<'a, REG> = crate::BitWriter0C<'a, REG, CC1OFW>;
329impl<'a, REG> CCOF_W<'a, REG>
330where
331 REG: crate::Writable + crate::RegisterSpec,
332{
333 #[inline(always)]
335 pub fn clear(self) -> &'a mut crate::W<REG> {
336 self.variant(CC1OFW::Clear)
337 }
338}
339impl R {
340 #[inline(always)]
342 pub fn uif(&self) -> UIF_R {
343 UIF_R::new((self.bits & 1) != 0)
344 }
345 #[inline(always)]
349 pub fn ccif(&self, n: u8) -> CCIF_R {
350 #[allow(clippy::no_effect)] [(); 1][n as usize];
351 CCIF_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0)
352 }
353 #[inline(always)]
356 pub fn ccif_iter(&self) -> impl Iterator<Item = CCIF_R> + '_ {
357 (0..1).map(move |n| CCIF_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0))
358 }
359 #[inline(always)]
361 pub fn cc1if(&self) -> CCIF_R {
362 CCIF_R::new(((self.bits >> 1) & 1) != 0)
363 }
364 #[inline(always)]
366 pub fn comif(&self) -> COMIF_R {
367 COMIF_R::new(((self.bits >> 5) & 1) != 0)
368 }
369 #[inline(always)]
371 pub fn tif(&self) -> TIF_R {
372 TIF_R::new(((self.bits >> 6) & 1) != 0)
373 }
374 #[inline(always)]
376 pub fn bif(&self) -> BIF_R {
377 BIF_R::new(((self.bits >> 7) & 1) != 0)
378 }
379 #[inline(always)]
383 pub fn ccof(&self, n: u8) -> CCOF_R {
384 #[allow(clippy::no_effect)] [(); 1][n as usize];
385 CCOF_R::new(((self.bits >> (n * 0 + 9)) & 1) != 0)
386 }
387 #[inline(always)]
390 pub fn ccof_iter(&self) -> impl Iterator<Item = CCOF_R> + '_ {
391 (0..1).map(move |n| CCOF_R::new(((self.bits >> (n * 0 + 9)) & 1) != 0))
392 }
393 #[inline(always)]
395 pub fn cc1of(&self) -> CCOF_R {
396 CCOF_R::new(((self.bits >> 9) & 1) != 0)
397 }
398}
399impl core::fmt::Debug for R {
400 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
401 f.debug_struct("SR")
402 .field("cc1of", &self.cc1of())
403 .field("bif", &self.bif())
404 .field("tif", &self.tif())
405 .field("comif", &self.comif())
406 .field("cc1if", &self.cc1if())
407 .field("uif", &self.uif())
408 .finish()
409 }
410}
411impl W {
412 #[inline(always)]
414 pub fn uif(&mut self) -> UIF_W<SRrs> {
415 UIF_W::new(self, 0)
416 }
417 #[inline(always)]
421 pub fn ccif(&mut self, n: u8) -> CCIF_W<SRrs> {
422 #[allow(clippy::no_effect)] [(); 1][n as usize];
423 CCIF_W::new(self, n * 0 + 1)
424 }
425 #[inline(always)]
427 pub fn cc1if(&mut self) -> CCIF_W<SRrs> {
428 CCIF_W::new(self, 1)
429 }
430 #[inline(always)]
432 pub fn comif(&mut self) -> COMIF_W<SRrs> {
433 COMIF_W::new(self, 5)
434 }
435 #[inline(always)]
437 pub fn tif(&mut self) -> TIF_W<SRrs> {
438 TIF_W::new(self, 6)
439 }
440 #[inline(always)]
442 pub fn bif(&mut self) -> BIF_W<SRrs> {
443 BIF_W::new(self, 7)
444 }
445 #[inline(always)]
449 pub fn ccof(&mut self, n: u8) -> CCOF_W<SRrs> {
450 #[allow(clippy::no_effect)] [(); 1][n as usize];
451 CCOF_W::new(self, n * 0 + 9)
452 }
453 #[inline(always)]
455 pub fn cc1of(&mut self) -> CCOF_W<SRrs> {
456 CCOF_W::new(self, 9)
457 }
458}
459pub struct SRrs;
465impl crate::RegisterSpec for SRrs {
466 type Ux = u32;
467}
468impl crate::Readable for SRrs {}
470impl crate::Writable for SRrs {
472 type Safety = crate::Unsafe;
473 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x02a3;
474}
475impl crate::Resettable for SRrs {}