mimxrt595s/adc0/
param.rs

1#[doc = "Register `PARAM` reader"]
2pub struct R(crate::R<PARAM_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PARAM_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PARAM_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PARAM_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `TRIG_NUM` reader - Trigger Number"]
17pub type TRIG_NUM_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `FIFOSIZE` reader - Result FIFO Depth"]
19pub type FIFOSIZE_R = crate::FieldReader<u8, FIFOSIZE_A>;
20#[doc = "Result FIFO Depth\n\nValue on reset: 16"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22#[repr(u8)]
23pub enum FIFOSIZE_A {
24    #[doc = "1: 2"]
25    ENTRIES_2 = 1,
26    #[doc = "4: 4"]
27    ENTRIES_4 = 4,
28    #[doc = "8: 8"]
29    ENTRIES_8 = 8,
30    #[doc = "16: 16"]
31    ENTRIES_16 = 16,
32    #[doc = "32: 32"]
33    ENTRIES_32 = 32,
34    #[doc = "64: 64"]
35    ENTRIES_64 = 64,
36}
37impl From<FIFOSIZE_A> for u8 {
38    #[inline(always)]
39    fn from(variant: FIFOSIZE_A) -> Self {
40        variant as _
41    }
42}
43impl FIFOSIZE_R {
44    #[doc = "Get enumerated values variant"]
45    #[inline(always)]
46    pub fn variant(&self) -> Option<FIFOSIZE_A> {
47        match self.bits {
48            1 => Some(FIFOSIZE_A::ENTRIES_2),
49            4 => Some(FIFOSIZE_A::ENTRIES_4),
50            8 => Some(FIFOSIZE_A::ENTRIES_8),
51            16 => Some(FIFOSIZE_A::ENTRIES_16),
52            32 => Some(FIFOSIZE_A::ENTRIES_32),
53            64 => Some(FIFOSIZE_A::ENTRIES_64),
54            _ => None,
55        }
56    }
57    #[doc = "Checks if the value of the field is `ENTRIES_2`"]
58    #[inline(always)]
59    pub fn is_entries_2(&self) -> bool {
60        *self == FIFOSIZE_A::ENTRIES_2
61    }
62    #[doc = "Checks if the value of the field is `ENTRIES_4`"]
63    #[inline(always)]
64    pub fn is_entries_4(&self) -> bool {
65        *self == FIFOSIZE_A::ENTRIES_4
66    }
67    #[doc = "Checks if the value of the field is `ENTRIES_8`"]
68    #[inline(always)]
69    pub fn is_entries_8(&self) -> bool {
70        *self == FIFOSIZE_A::ENTRIES_8
71    }
72    #[doc = "Checks if the value of the field is `ENTRIES_16`"]
73    #[inline(always)]
74    pub fn is_entries_16(&self) -> bool {
75        *self == FIFOSIZE_A::ENTRIES_16
76    }
77    #[doc = "Checks if the value of the field is `ENTRIES_32`"]
78    #[inline(always)]
79    pub fn is_entries_32(&self) -> bool {
80        *self == FIFOSIZE_A::ENTRIES_32
81    }
82    #[doc = "Checks if the value of the field is `ENTRIES_64`"]
83    #[inline(always)]
84    pub fn is_entries_64(&self) -> bool {
85        *self == FIFOSIZE_A::ENTRIES_64
86    }
87}
88#[doc = "Field `CV_NUM` reader - Compare Value Number"]
89pub type CV_NUM_R = crate::FieldReader<u8, u8>;
90#[doc = "Field `CMD_NUM` reader - Command Buffer Number"]
91pub type CMD_NUM_R = crate::FieldReader<u8, u8>;
92impl R {
93    #[doc = "Bits 0:7 - Trigger Number"]
94    #[inline(always)]
95    pub fn trig_num(&self) -> TRIG_NUM_R {
96        TRIG_NUM_R::new((self.bits & 0xff) as u8)
97    }
98    #[doc = "Bits 8:15 - Result FIFO Depth"]
99    #[inline(always)]
100    pub fn fifosize(&self) -> FIFOSIZE_R {
101        FIFOSIZE_R::new(((self.bits >> 8) & 0xff) as u8)
102    }
103    #[doc = "Bits 16:23 - Compare Value Number"]
104    #[inline(always)]
105    pub fn cv_num(&self) -> CV_NUM_R {
106        CV_NUM_R::new(((self.bits >> 16) & 0xff) as u8)
107    }
108    #[doc = "Bits 24:31 - Command Buffer Number"]
109    #[inline(always)]
110    pub fn cmd_num(&self) -> CMD_NUM_R {
111        CMD_NUM_R::new(((self.bits >> 24) & 0xff) as u8)
112    }
113}
114#[doc = "Parameter Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [param](index.html) module"]
115pub struct PARAM_SPEC;
116impl crate::RegisterSpec for PARAM_SPEC {
117    type Ux = u32;
118}
119#[doc = "`read()` method returns [param::R](R) reader structure"]
120impl crate::Readable for PARAM_SPEC {
121    type Reader = R;
122}
123#[doc = "`reset()` method sets PARAM to value 0x0f04_1010"]
124impl crate::Resettable for PARAM_SPEC {
125    const RESET_VALUE: Self::Ux = 0x0f04_1010;
126}