1pub type R = crate::R<BCDRrs>;
3pub type W = crate::W<BCDRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum BCDEN {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<BCDEN> for bool {
17 #[inline(always)]
18 fn from(variant: BCDEN) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type BCDEN_R = crate::BitReader<BCDEN>;
24impl BCDEN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> BCDEN {
28 match self.bits {
29 false => BCDEN::Disabled,
30 true => BCDEN::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == BCDEN::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == BCDEN::Enabled
42 }
43}
44pub type BCDEN_W<'a, REG> = crate::BitWriter<'a, REG, BCDEN>;
46impl<'a, REG> BCDEN_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(BCDEN::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(BCDEN::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum DCDEN {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<DCDEN> for bool {
73 #[inline(always)]
74 fn from(variant: DCDEN) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type DCDEN_R = crate::BitReader<DCDEN>;
80impl DCDEN_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> DCDEN {
84 match self.bits {
85 false => DCDEN::Disabled,
86 true => DCDEN::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == DCDEN::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == DCDEN::Enabled
98 }
99}
100pub type DCDEN_W<'a, REG> = crate::BitWriter<'a, REG, DCDEN>;
102impl<'a, REG> DCDEN_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(DCDEN::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(DCDEN::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum PDEN {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<PDEN> for bool {
129 #[inline(always)]
130 fn from(variant: PDEN) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type PDEN_R = crate::BitReader<PDEN>;
136impl PDEN_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> PDEN {
140 match self.bits {
141 false => PDEN::Disabled,
142 true => PDEN::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == PDEN::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == PDEN::Enabled
154 }
155}
156pub type PDEN_W<'a, REG> = crate::BitWriter<'a, REG, PDEN>;
158impl<'a, REG> PDEN_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn disabled(self) -> &'a mut crate::W<REG> {
165 self.variant(PDEN::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(PDEN::Enabled)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum SDEN {
179 Disabled = 0,
181 Enabled = 1,
183}
184impl From<SDEN> for bool {
185 #[inline(always)]
186 fn from(variant: SDEN) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type SDEN_R = crate::BitReader<SDEN>;
192impl SDEN_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> SDEN {
196 match self.bits {
197 false => SDEN::Disabled,
198 true => SDEN::Enabled,
199 }
200 }
201 #[inline(always)]
203 pub fn is_disabled(&self) -> bool {
204 *self == SDEN::Disabled
205 }
206 #[inline(always)]
208 pub fn is_enabled(&self) -> bool {
209 *self == SDEN::Enabled
210 }
211}
212pub type SDEN_W<'a, REG> = crate::BitWriter<'a, REG, SDEN>;
214impl<'a, REG> SDEN_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn disabled(self) -> &'a mut crate::W<REG> {
221 self.variant(SDEN::Disabled)
222 }
223 #[inline(always)]
225 pub fn enabled(self) -> &'a mut crate::W<REG> {
226 self.variant(SDEN::Enabled)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum DCDET {
235 NotDetected = 0,
237 Detected = 1,
239}
240impl From<DCDET> for bool {
241 #[inline(always)]
242 fn from(variant: DCDET) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type DCDET_R = crate::BitReader<DCDET>;
248impl DCDET_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> DCDET {
252 match self.bits {
253 false => DCDET::NotDetected,
254 true => DCDET::Detected,
255 }
256 }
257 #[inline(always)]
259 pub fn is_not_detected(&self) -> bool {
260 *self == DCDET::NotDetected
261 }
262 #[inline(always)]
264 pub fn is_detected(&self) -> bool {
265 *self == DCDET::Detected
266 }
267}
268#[cfg_attr(feature = "defmt", derive(defmt::Format))]
272#[derive(Clone, Copy, Debug, PartialEq, Eq)]
273pub enum PDET {
274 NoBcd = 0,
276 Bcd = 1,
278}
279impl From<PDET> for bool {
280 #[inline(always)]
281 fn from(variant: PDET) -> Self {
282 variant as u8 != 0
283 }
284}
285pub type PDET_R = crate::BitReader<PDET>;
287impl PDET_R {
288 #[inline(always)]
290 pub const fn variant(&self) -> PDET {
291 match self.bits {
292 false => PDET::NoBcd,
293 true => PDET::Bcd,
294 }
295 }
296 #[inline(always)]
298 pub fn is_no_bcd(&self) -> bool {
299 *self == PDET::NoBcd
300 }
301 #[inline(always)]
303 pub fn is_bcd(&self) -> bool {
304 *self == PDET::Bcd
305 }
306}
307#[cfg_attr(feature = "defmt", derive(defmt::Format))]
311#[derive(Clone, Copy, Debug, PartialEq, Eq)]
312pub enum SDET {
313 Cdp = 0,
315 Dcp = 1,
317}
318impl From<SDET> for bool {
319 #[inline(always)]
320 fn from(variant: SDET) -> Self {
321 variant as u8 != 0
322 }
323}
324pub type SDET_R = crate::BitReader<SDET>;
326impl SDET_R {
327 #[inline(always)]
329 pub const fn variant(&self) -> SDET {
330 match self.bits {
331 false => SDET::Cdp,
332 true => SDET::Dcp,
333 }
334 }
335 #[inline(always)]
337 pub fn is_cdp(&self) -> bool {
338 *self == SDET::Cdp
339 }
340 #[inline(always)]
342 pub fn is_dcp(&self) -> bool {
343 *self == SDET::Dcp
344 }
345}
346#[cfg_attr(feature = "defmt", derive(defmt::Format))]
350#[derive(Clone, Copy, Debug, PartialEq, Eq)]
351pub enum PS2DET {
352 Normal = 0,
354 Ps2 = 1,
356}
357impl From<PS2DET> for bool {
358 #[inline(always)]
359 fn from(variant: PS2DET) -> Self {
360 variant as u8 != 0
361 }
362}
363pub type PS2DET_R = crate::BitReader<PS2DET>;
365impl PS2DET_R {
366 #[inline(always)]
368 pub const fn variant(&self) -> PS2DET {
369 match self.bits {
370 false => PS2DET::Normal,
371 true => PS2DET::Ps2,
372 }
373 }
374 #[inline(always)]
376 pub fn is_normal(&self) -> bool {
377 *self == PS2DET::Normal
378 }
379 #[inline(always)]
381 pub fn is_ps2(&self) -> bool {
382 *self == PS2DET::Ps2
383 }
384}
385#[cfg_attr(feature = "defmt", derive(defmt::Format))]
389#[derive(Clone, Copy, Debug, PartialEq, Eq)]
390pub enum DPPU {
391 Disabled = 0,
393 Enabled = 1,
395}
396impl From<DPPU> for bool {
397 #[inline(always)]
398 fn from(variant: DPPU) -> Self {
399 variant as u8 != 0
400 }
401}
402pub type DPPU_R = crate::BitReader<DPPU>;
404impl DPPU_R {
405 #[inline(always)]
407 pub const fn variant(&self) -> DPPU {
408 match self.bits {
409 false => DPPU::Disabled,
410 true => DPPU::Enabled,
411 }
412 }
413 #[inline(always)]
415 pub fn is_disabled(&self) -> bool {
416 *self == DPPU::Disabled
417 }
418 #[inline(always)]
420 pub fn is_enabled(&self) -> bool {
421 *self == DPPU::Enabled
422 }
423}
424pub type DPPU_W<'a, REG> = crate::BitWriter<'a, REG, DPPU>;
426impl<'a, REG> DPPU_W<'a, REG>
427where
428 REG: crate::Writable + crate::RegisterSpec,
429{
430 #[inline(always)]
432 pub fn disabled(self) -> &'a mut crate::W<REG> {
433 self.variant(DPPU::Disabled)
434 }
435 #[inline(always)]
437 pub fn enabled(self) -> &'a mut crate::W<REG> {
438 self.variant(DPPU::Enabled)
439 }
440}
441impl R {
442 #[inline(always)]
444 pub fn bcden(&self) -> BCDEN_R {
445 BCDEN_R::new((self.bits & 1) != 0)
446 }
447 #[inline(always)]
449 pub fn dcden(&self) -> DCDEN_R {
450 DCDEN_R::new(((self.bits >> 1) & 1) != 0)
451 }
452 #[inline(always)]
454 pub fn pden(&self) -> PDEN_R {
455 PDEN_R::new(((self.bits >> 2) & 1) != 0)
456 }
457 #[inline(always)]
459 pub fn sden(&self) -> SDEN_R {
460 SDEN_R::new(((self.bits >> 3) & 1) != 0)
461 }
462 #[inline(always)]
464 pub fn dcdet(&self) -> DCDET_R {
465 DCDET_R::new(((self.bits >> 4) & 1) != 0)
466 }
467 #[inline(always)]
469 pub fn pdet(&self) -> PDET_R {
470 PDET_R::new(((self.bits >> 5) & 1) != 0)
471 }
472 #[inline(always)]
474 pub fn sdet(&self) -> SDET_R {
475 SDET_R::new(((self.bits >> 6) & 1) != 0)
476 }
477 #[inline(always)]
479 pub fn ps2det(&self) -> PS2DET_R {
480 PS2DET_R::new(((self.bits >> 7) & 1) != 0)
481 }
482 #[inline(always)]
484 pub fn dppu(&self) -> DPPU_R {
485 DPPU_R::new(((self.bits >> 15) & 1) != 0)
486 }
487}
488impl core::fmt::Debug for R {
489 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
490 f.debug_struct("BCDR")
491 .field("bcden", &self.bcden())
492 .field("dcden", &self.dcden())
493 .field("pden", &self.pden())
494 .field("sden", &self.sden())
495 .field("dcdet", &self.dcdet())
496 .field("pdet", &self.pdet())
497 .field("sdet", &self.sdet())
498 .field("ps2det", &self.ps2det())
499 .field("dppu", &self.dppu())
500 .finish()
501 }
502}
503impl W {
504 #[inline(always)]
506 pub fn bcden(&mut self) -> BCDEN_W<BCDRrs> {
507 BCDEN_W::new(self, 0)
508 }
509 #[inline(always)]
511 pub fn dcden(&mut self) -> DCDEN_W<BCDRrs> {
512 DCDEN_W::new(self, 1)
513 }
514 #[inline(always)]
516 pub fn pden(&mut self) -> PDEN_W<BCDRrs> {
517 PDEN_W::new(self, 2)
518 }
519 #[inline(always)]
521 pub fn sden(&mut self) -> SDEN_W<BCDRrs> {
522 SDEN_W::new(self, 3)
523 }
524 #[inline(always)]
526 pub fn dppu(&mut self) -> DPPU_W<BCDRrs> {
527 DPPU_W::new(self, 15)
528 }
529}
530pub struct BCDRrs;
536impl crate::RegisterSpec for BCDRrs {
537 type Ux = u32;
538}
539impl crate::Readable for BCDRrs {}
541impl crate::Writable for BCDRrs {
543 type Safety = crate::Unsafe;
544}
545impl crate::Resettable for BCDRrs {}