mcxa_pac/dac0/
param.rs

1#[doc = "Register `PARAM` reader"]
2pub type R = crate::R<ParamSpec>;
3#[doc = "FIFO Size\n\nValue on reset: 3"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6#[repr(u8)]
7pub enum Fifosz {
8    #[doc = "1: FIFO depth is 4"]
9    Val1 = 1,
10    #[doc = "2: FIFO depth is 8"]
11    Val2 = 2,
12    #[doc = "3: FIFO depth is 16"]
13    Val3 = 3,
14    #[doc = "4: FIFO depth is 32"]
15    Val4 = 4,
16    #[doc = "5: FIFO depth is 64"]
17    Val5 = 5,
18    #[doc = "6: FIFO depth is 128"]
19    Val6 = 6,
20    #[doc = "7: FIFO depth is 256"]
21    Val7 = 7,
22}
23impl From<Fifosz> for u8 {
24    #[inline(always)]
25    fn from(variant: Fifosz) -> Self {
26        variant as _
27    }
28}
29impl crate::FieldSpec for Fifosz {
30    type Ux = u8;
31}
32impl crate::IsEnum for Fifosz {}
33#[doc = "Field `FIFOSZ` reader - FIFO Size"]
34pub type FifoszR = crate::FieldReader<Fifosz>;
35impl FifoszR {
36    #[doc = "Get enumerated values variant"]
37    #[inline(always)]
38    pub const fn variant(&self) -> Option<Fifosz> {
39        match self.bits {
40            1 => Some(Fifosz::Val1),
41            2 => Some(Fifosz::Val2),
42            3 => Some(Fifosz::Val3),
43            4 => Some(Fifosz::Val4),
44            5 => Some(Fifosz::Val5),
45            6 => Some(Fifosz::Val6),
46            7 => Some(Fifosz::Val7),
47            _ => None,
48        }
49    }
50    #[doc = "FIFO depth is 4"]
51    #[inline(always)]
52    pub fn is_val_1(&self) -> bool {
53        *self == Fifosz::Val1
54    }
55    #[doc = "FIFO depth is 8"]
56    #[inline(always)]
57    pub fn is_val_2(&self) -> bool {
58        *self == Fifosz::Val2
59    }
60    #[doc = "FIFO depth is 16"]
61    #[inline(always)]
62    pub fn is_val_3(&self) -> bool {
63        *self == Fifosz::Val3
64    }
65    #[doc = "FIFO depth is 32"]
66    #[inline(always)]
67    pub fn is_val_4(&self) -> bool {
68        *self == Fifosz::Val4
69    }
70    #[doc = "FIFO depth is 64"]
71    #[inline(always)]
72    pub fn is_val_5(&self) -> bool {
73        *self == Fifosz::Val5
74    }
75    #[doc = "FIFO depth is 128"]
76    #[inline(always)]
77    pub fn is_val_6(&self) -> bool {
78        *self == Fifosz::Val6
79    }
80    #[doc = "FIFO depth is 256"]
81    #[inline(always)]
82    pub fn is_val_7(&self) -> bool {
83        *self == Fifosz::Val7
84    }
85}
86impl R {
87    #[doc = "Bits 0:2 - FIFO Size"]
88    #[inline(always)]
89    pub fn fifosz(&self) -> FifoszR {
90        FifoszR::new((self.bits & 7) as u8)
91    }
92}
93#[cfg(feature = "debug")]
94impl core::fmt::Debug for R {
95    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
96        f.debug_struct("PARAM").field("fifosz", &self.fifosz()).finish()
97    }
98}
99#[doc = "Parameter\n\nYou can [`read`](crate::Reg::read) this register and get [`param::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct ParamSpec;
101impl crate::RegisterSpec for ParamSpec {
102    type Ux = u32;
103}
104#[doc = "`read()` method returns [`param::R`](R) reader structure"]
105impl crate::Readable for ParamSpec {}
106#[doc = "`reset()` method sets PARAM to value 0x03"]
107impl crate::Resettable for ParamSpec {
108    const RESET_VALUE: u32 = 0x03;
109}