1pub type R = crate::R<CFGR2rs>;
3pub type W = crate::W<CFGR2rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum ROVSE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<ROVSE> for bool {
17 #[inline(always)]
18 fn from(variant: ROVSE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type ROVSE_R = crate::BitReader<ROVSE>;
24impl ROVSE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> ROVSE {
28 match self.bits {
29 false => ROVSE::Disabled,
30 true => ROVSE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == ROVSE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == ROVSE::Enabled
42 }
43}
44pub type ROVSE_W<'a, REG> = crate::BitWriter<'a, REG, ROVSE>;
46impl<'a, REG> ROVSE_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(ROVSE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(ROVSE::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum JOVSE {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<JOVSE> for bool {
73 #[inline(always)]
74 fn from(variant: JOVSE) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type JOVSE_R = crate::BitReader<JOVSE>;
80impl JOVSE_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> JOVSE {
84 match self.bits {
85 false => JOVSE::Disabled,
86 true => JOVSE::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == JOVSE::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == JOVSE::Enabled
98 }
99}
100pub type JOVSE_W<'a, REG> = crate::BitWriter<'a, REG, JOVSE>;
102impl<'a, REG> JOVSE_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn disabled(self) -> &'a mut crate::W<REG> {
109 self.variant(JOVSE::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(JOVSE::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122#[repr(u8)]
123pub enum OVSR {
124 Ratio2 = 0,
126 Ratio4 = 1,
128 Ratio8 = 2,
130 Ratio16 = 3,
132 Ratio32 = 4,
134 Ratio64 = 5,
136 Ratio128 = 6,
138 Ratio256 = 7,
140}
141impl From<OVSR> for u8 {
142 #[inline(always)]
143 fn from(variant: OVSR) -> Self {
144 variant as _
145 }
146}
147impl crate::FieldSpec for OVSR {
148 type Ux = u8;
149}
150impl crate::IsEnum for OVSR {}
151pub type OVSR_R = crate::FieldReader<OVSR>;
153impl OVSR_R {
154 #[inline(always)]
156 pub const fn variant(&self) -> OVSR {
157 match self.bits {
158 0 => OVSR::Ratio2,
159 1 => OVSR::Ratio4,
160 2 => OVSR::Ratio8,
161 3 => OVSR::Ratio16,
162 4 => OVSR::Ratio32,
163 5 => OVSR::Ratio64,
164 6 => OVSR::Ratio128,
165 7 => OVSR::Ratio256,
166 _ => unreachable!(),
167 }
168 }
169 #[inline(always)]
171 pub fn is_ratio2(&self) -> bool {
172 *self == OVSR::Ratio2
173 }
174 #[inline(always)]
176 pub fn is_ratio4(&self) -> bool {
177 *self == OVSR::Ratio4
178 }
179 #[inline(always)]
181 pub fn is_ratio8(&self) -> bool {
182 *self == OVSR::Ratio8
183 }
184 #[inline(always)]
186 pub fn is_ratio16(&self) -> bool {
187 *self == OVSR::Ratio16
188 }
189 #[inline(always)]
191 pub fn is_ratio32(&self) -> bool {
192 *self == OVSR::Ratio32
193 }
194 #[inline(always)]
196 pub fn is_ratio64(&self) -> bool {
197 *self == OVSR::Ratio64
198 }
199 #[inline(always)]
201 pub fn is_ratio128(&self) -> bool {
202 *self == OVSR::Ratio128
203 }
204 #[inline(always)]
206 pub fn is_ratio256(&self) -> bool {
207 *self == OVSR::Ratio256
208 }
209}
210pub type OVSR_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OVSR, crate::Safe>;
212impl<'a, REG> OVSR_W<'a, REG>
213where
214 REG: crate::Writable + crate::RegisterSpec,
215 REG::Ux: From<u8>,
216{
217 #[inline(always)]
219 pub fn ratio2(self) -> &'a mut crate::W<REG> {
220 self.variant(OVSR::Ratio2)
221 }
222 #[inline(always)]
224 pub fn ratio4(self) -> &'a mut crate::W<REG> {
225 self.variant(OVSR::Ratio4)
226 }
227 #[inline(always)]
229 pub fn ratio8(self) -> &'a mut crate::W<REG> {
230 self.variant(OVSR::Ratio8)
231 }
232 #[inline(always)]
234 pub fn ratio16(self) -> &'a mut crate::W<REG> {
235 self.variant(OVSR::Ratio16)
236 }
237 #[inline(always)]
239 pub fn ratio32(self) -> &'a mut crate::W<REG> {
240 self.variant(OVSR::Ratio32)
241 }
242 #[inline(always)]
244 pub fn ratio64(self) -> &'a mut crate::W<REG> {
245 self.variant(OVSR::Ratio64)
246 }
247 #[inline(always)]
249 pub fn ratio128(self) -> &'a mut crate::W<REG> {
250 self.variant(OVSR::Ratio128)
251 }
252 #[inline(always)]
254 pub fn ratio256(self) -> &'a mut crate::W<REG> {
255 self.variant(OVSR::Ratio256)
256 }
257}
258#[cfg_attr(feature = "defmt", derive(defmt::Format))]
262#[derive(Clone, Copy, Debug, PartialEq, Eq)]
263#[repr(u8)]
264pub enum OVSS {
265 NoShift = 0,
267 Shift1bit = 1,
269 Shift2bit = 2,
271 Shift3bit = 3,
273 Shift4bit = 4,
275 Shift5bit = 5,
277 Shift6bit = 6,
279 Shift7bit = 7,
281 Shift8bit = 8,
283}
284impl From<OVSS> for u8 {
285 #[inline(always)]
286 fn from(variant: OVSS) -> Self {
287 variant as _
288 }
289}
290impl crate::FieldSpec for OVSS {
291 type Ux = u8;
292}
293impl crate::IsEnum for OVSS {}
294pub type OVSS_R = crate::FieldReader<OVSS>;
296impl OVSS_R {
297 #[inline(always)]
299 pub const fn variant(&self) -> Option<OVSS> {
300 match self.bits {
301 0 => Some(OVSS::NoShift),
302 1 => Some(OVSS::Shift1bit),
303 2 => Some(OVSS::Shift2bit),
304 3 => Some(OVSS::Shift3bit),
305 4 => Some(OVSS::Shift4bit),
306 5 => Some(OVSS::Shift5bit),
307 6 => Some(OVSS::Shift6bit),
308 7 => Some(OVSS::Shift7bit),
309 8 => Some(OVSS::Shift8bit),
310 _ => None,
311 }
312 }
313 #[inline(always)]
315 pub fn is_no_shift(&self) -> bool {
316 *self == OVSS::NoShift
317 }
318 #[inline(always)]
320 pub fn is_shift1bit(&self) -> bool {
321 *self == OVSS::Shift1bit
322 }
323 #[inline(always)]
325 pub fn is_shift2bit(&self) -> bool {
326 *self == OVSS::Shift2bit
327 }
328 #[inline(always)]
330 pub fn is_shift3bit(&self) -> bool {
331 *self == OVSS::Shift3bit
332 }
333 #[inline(always)]
335 pub fn is_shift4bit(&self) -> bool {
336 *self == OVSS::Shift4bit
337 }
338 #[inline(always)]
340 pub fn is_shift5bit(&self) -> bool {
341 *self == OVSS::Shift5bit
342 }
343 #[inline(always)]
345 pub fn is_shift6bit(&self) -> bool {
346 *self == OVSS::Shift6bit
347 }
348 #[inline(always)]
350 pub fn is_shift7bit(&self) -> bool {
351 *self == OVSS::Shift7bit
352 }
353 #[inline(always)]
355 pub fn is_shift8bit(&self) -> bool {
356 *self == OVSS::Shift8bit
357 }
358}
359pub type OVSS_W<'a, REG> = crate::FieldWriter<'a, REG, 4, OVSS>;
361impl<'a, REG> OVSS_W<'a, REG>
362where
363 REG: crate::Writable + crate::RegisterSpec,
364 REG::Ux: From<u8>,
365{
366 #[inline(always)]
368 pub fn no_shift(self) -> &'a mut crate::W<REG> {
369 self.variant(OVSS::NoShift)
370 }
371 #[inline(always)]
373 pub fn shift1bit(self) -> &'a mut crate::W<REG> {
374 self.variant(OVSS::Shift1bit)
375 }
376 #[inline(always)]
378 pub fn shift2bit(self) -> &'a mut crate::W<REG> {
379 self.variant(OVSS::Shift2bit)
380 }
381 #[inline(always)]
383 pub fn shift3bit(self) -> &'a mut crate::W<REG> {
384 self.variant(OVSS::Shift3bit)
385 }
386 #[inline(always)]
388 pub fn shift4bit(self) -> &'a mut crate::W<REG> {
389 self.variant(OVSS::Shift4bit)
390 }
391 #[inline(always)]
393 pub fn shift5bit(self) -> &'a mut crate::W<REG> {
394 self.variant(OVSS::Shift5bit)
395 }
396 #[inline(always)]
398 pub fn shift6bit(self) -> &'a mut crate::W<REG> {
399 self.variant(OVSS::Shift6bit)
400 }
401 #[inline(always)]
403 pub fn shift7bit(self) -> &'a mut crate::W<REG> {
404 self.variant(OVSS::Shift7bit)
405 }
406 #[inline(always)]
408 pub fn shift8bit(self) -> &'a mut crate::W<REG> {
409 self.variant(OVSS::Shift8bit)
410 }
411}
412#[cfg_attr(feature = "defmt", derive(defmt::Format))]
416#[derive(Clone, Copy, Debug, PartialEq, Eq)]
417pub enum TOVS {
418 All = 0,
420 Single = 1,
422}
423impl From<TOVS> for bool {
424 #[inline(always)]
425 fn from(variant: TOVS) -> Self {
426 variant as u8 != 0
427 }
428}
429pub type TOVS_R = crate::BitReader<TOVS>;
431impl TOVS_R {
432 #[inline(always)]
434 pub const fn variant(&self) -> TOVS {
435 match self.bits {
436 false => TOVS::All,
437 true => TOVS::Single,
438 }
439 }
440 #[inline(always)]
442 pub fn is_all(&self) -> bool {
443 *self == TOVS::All
444 }
445 #[inline(always)]
447 pub fn is_single(&self) -> bool {
448 *self == TOVS::Single
449 }
450}
451pub type TOVS_W<'a, REG> = crate::BitWriter<'a, REG, TOVS>;
453impl<'a, REG> TOVS_W<'a, REG>
454where
455 REG: crate::Writable + crate::RegisterSpec,
456{
457 #[inline(always)]
459 pub fn all(self) -> &'a mut crate::W<REG> {
460 self.variant(TOVS::All)
461 }
462 #[inline(always)]
464 pub fn single(self) -> &'a mut crate::W<REG> {
465 self.variant(TOVS::Single)
466 }
467}
468#[cfg_attr(feature = "defmt", derive(defmt::Format))]
472#[derive(Clone, Copy, Debug, PartialEq, Eq)]
473pub enum ROVSM {
474 ContinuedMode = 0,
476 ResumedMode = 1,
478}
479impl From<ROVSM> for bool {
480 #[inline(always)]
481 fn from(variant: ROVSM) -> Self {
482 variant as u8 != 0
483 }
484}
485pub type ROVSM_R = crate::BitReader<ROVSM>;
487impl ROVSM_R {
488 #[inline(always)]
490 pub const fn variant(&self) -> ROVSM {
491 match self.bits {
492 false => ROVSM::ContinuedMode,
493 true => ROVSM::ResumedMode,
494 }
495 }
496 #[inline(always)]
498 pub fn is_continued_mode(&self) -> bool {
499 *self == ROVSM::ContinuedMode
500 }
501 #[inline(always)]
503 pub fn is_resumed_mode(&self) -> bool {
504 *self == ROVSM::ResumedMode
505 }
506}
507pub type ROVSM_W<'a, REG> = crate::BitWriter<'a, REG, ROVSM>;
509impl<'a, REG> ROVSM_W<'a, REG>
510where
511 REG: crate::Writable + crate::RegisterSpec,
512{
513 #[inline(always)]
515 pub fn continued_mode(self) -> &'a mut crate::W<REG> {
516 self.variant(ROVSM::ContinuedMode)
517 }
518 #[inline(always)]
520 pub fn resumed_mode(self) -> &'a mut crate::W<REG> {
521 self.variant(ROVSM::ResumedMode)
522 }
523}
524impl R {
525 #[inline(always)]
527 pub fn rovse(&self) -> ROVSE_R {
528 ROVSE_R::new((self.bits & 1) != 0)
529 }
530 #[inline(always)]
532 pub fn jovse(&self) -> JOVSE_R {
533 JOVSE_R::new(((self.bits >> 1) & 1) != 0)
534 }
535 #[inline(always)]
537 pub fn ovsr(&self) -> OVSR_R {
538 OVSR_R::new(((self.bits >> 2) & 7) as u8)
539 }
540 #[inline(always)]
542 pub fn ovss(&self) -> OVSS_R {
543 OVSS_R::new(((self.bits >> 5) & 0x0f) as u8)
544 }
545 #[inline(always)]
547 pub fn tovs(&self) -> TOVS_R {
548 TOVS_R::new(((self.bits >> 9) & 1) != 0)
549 }
550 #[inline(always)]
552 pub fn rovsm(&self) -> ROVSM_R {
553 ROVSM_R::new(((self.bits >> 10) & 1) != 0)
554 }
555}
556impl core::fmt::Debug for R {
557 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
558 f.debug_struct("CFGR2")
559 .field("rovsm", &self.rovsm())
560 .field("tovs", &self.tovs())
561 .field("ovss", &self.ovss())
562 .field("ovsr", &self.ovsr())
563 .field("jovse", &self.jovse())
564 .field("rovse", &self.rovse())
565 .finish()
566 }
567}
568impl W {
569 #[inline(always)]
571 pub fn rovse(&mut self) -> ROVSE_W<CFGR2rs> {
572 ROVSE_W::new(self, 0)
573 }
574 #[inline(always)]
576 pub fn jovse(&mut self) -> JOVSE_W<CFGR2rs> {
577 JOVSE_W::new(self, 1)
578 }
579 #[inline(always)]
581 pub fn ovsr(&mut self) -> OVSR_W<CFGR2rs> {
582 OVSR_W::new(self, 2)
583 }
584 #[inline(always)]
586 pub fn ovss(&mut self) -> OVSS_W<CFGR2rs> {
587 OVSS_W::new(self, 5)
588 }
589 #[inline(always)]
591 pub fn tovs(&mut self) -> TOVS_W<CFGR2rs> {
592 TOVS_W::new(self, 9)
593 }
594 #[inline(always)]
596 pub fn rovsm(&mut self) -> ROVSM_W<CFGR2rs> {
597 ROVSM_W::new(self, 10)
598 }
599}
600pub struct CFGR2rs;
606impl crate::RegisterSpec for CFGR2rs {
607 type Ux = u32;
608}
609impl crate::Readable for CFGR2rs {}
611impl crate::Writable for CFGR2rs {
613 type Safety = crate::Unsafe;
614}
615impl crate::Resettable for CFGR2rs {}