mimxrt685s_pac/trng/
vid2.rs1#[doc = "Register `VID2` reader"]
2pub type R = crate::R<Vid2Spec>;
3#[doc = "Shows the IP's Configuaration options for the TRNG.\n\nValue on reset: 0"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6#[repr(u8)]
7pub enum ConfigOpt {
8 #[doc = "0: TRNG_CONFIG_OPT for TRNG."]
9 ConfigOpt0 = 0,
10}
11impl From<ConfigOpt> for u8 {
12 #[inline(always)]
13 fn from(variant: ConfigOpt) -> Self {
14 variant as _
15 }
16}
17impl crate::FieldSpec for ConfigOpt {
18 type Ux = u8;
19}
20impl crate::IsEnum for ConfigOpt {}
21#[doc = "Field `CONFIG_OPT` reader - Shows the IP's Configuaration options for the TRNG."]
22pub type ConfigOptR = crate::FieldReader<ConfigOpt>;
23impl ConfigOptR {
24 #[doc = "Get enumerated values variant"]
25 #[inline(always)]
26 pub const fn variant(&self) -> Option<ConfigOpt> {
27 match self.bits {
28 0 => Some(ConfigOpt::ConfigOpt0),
29 _ => None,
30 }
31 }
32 #[doc = "TRNG_CONFIG_OPT for TRNG."]
33 #[inline(always)]
34 pub fn is_config_opt_0(&self) -> bool {
35 *self == ConfigOpt::ConfigOpt0
36 }
37}
38#[doc = "Shows the IP's ECO revision of the TRNG.\n\nValue on reset: 0"]
39#[cfg_attr(feature = "defmt", derive(defmt::Format))]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum EcoRev {
43 #[doc = "0: TRNG_ECO_REV for TRNG."]
44 EcoRev0 = 0,
45}
46impl From<EcoRev> for u8 {
47 #[inline(always)]
48 fn from(variant: EcoRev) -> Self {
49 variant as _
50 }
51}
52impl crate::FieldSpec for EcoRev {
53 type Ux = u8;
54}
55impl crate::IsEnum for EcoRev {}
56#[doc = "Field `ECO_REV` reader - Shows the IP's ECO revision of the TRNG."]
57pub type EcoRevR = crate::FieldReader<EcoRev>;
58impl EcoRevR {
59 #[doc = "Get enumerated values variant"]
60 #[inline(always)]
61 pub const fn variant(&self) -> Option<EcoRev> {
62 match self.bits {
63 0 => Some(EcoRev::EcoRev0),
64 _ => None,
65 }
66 }
67 #[doc = "TRNG_ECO_REV for TRNG."]
68 #[inline(always)]
69 pub fn is_eco_rev_0(&self) -> bool {
70 *self == EcoRev::EcoRev0
71 }
72}
73#[doc = "Shows the integration options for the TRNG.\n\nValue on reset: 0"]
74#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76#[repr(u8)]
77pub enum IntgOpt {
78 #[doc = "0: INTG_OPT for TRNG."]
79 IntgOpt0 = 0,
80}
81impl From<IntgOpt> for u8 {
82 #[inline(always)]
83 fn from(variant: IntgOpt) -> Self {
84 variant as _
85 }
86}
87impl crate::FieldSpec for IntgOpt {
88 type Ux = u8;
89}
90impl crate::IsEnum for IntgOpt {}
91#[doc = "Field `INTG_OPT` reader - Shows the integration options for the TRNG."]
92pub type IntgOptR = crate::FieldReader<IntgOpt>;
93impl IntgOptR {
94 #[doc = "Get enumerated values variant"]
95 #[inline(always)]
96 pub const fn variant(&self) -> Option<IntgOpt> {
97 match self.bits {
98 0 => Some(IntgOpt::IntgOpt0),
99 _ => None,
100 }
101 }
102 #[doc = "INTG_OPT for TRNG."]
103 #[inline(always)]
104 pub fn is_intg_opt_0(&self) -> bool {
105 *self == IntgOpt::IntgOpt0
106 }
107}
108#[doc = "Shows the compile options for the TRNG.\n\nValue on reset: 0"]
109#[cfg_attr(feature = "defmt", derive(defmt::Format))]
110#[derive(Clone, Copy, Debug, PartialEq, Eq)]
111#[repr(u8)]
112pub enum Era {
113 #[doc = "0: COMPILE_OPT for TRNG."]
114 Era0 = 0,
115}
116impl From<Era> for u8 {
117 #[inline(always)]
118 fn from(variant: Era) -> Self {
119 variant as _
120 }
121}
122impl crate::FieldSpec for Era {
123 type Ux = u8;
124}
125impl crate::IsEnum for Era {}
126#[doc = "Field `ERA` reader - Shows the compile options for the TRNG."]
127pub type EraR = crate::FieldReader<Era>;
128impl EraR {
129 #[doc = "Get enumerated values variant"]
130 #[inline(always)]
131 pub const fn variant(&self) -> Option<Era> {
132 match self.bits {
133 0 => Some(Era::Era0),
134 _ => None,
135 }
136 }
137 #[doc = "COMPILE_OPT for TRNG."]
138 #[inline(always)]
139 pub fn is_era_0(&self) -> bool {
140 *self == Era::Era0
141 }
142}
143impl R {
144 #[doc = "Bits 0:7 - Shows the IP's Configuaration options for the TRNG."]
145 #[inline(always)]
146 pub fn config_opt(&self) -> ConfigOptR {
147 ConfigOptR::new((self.bits & 0xff) as u8)
148 }
149 #[doc = "Bits 8:15 - Shows the IP's ECO revision of the TRNG."]
150 #[inline(always)]
151 pub fn eco_rev(&self) -> EcoRevR {
152 EcoRevR::new(((self.bits >> 8) & 0xff) as u8)
153 }
154 #[doc = "Bits 16:23 - Shows the integration options for the TRNG."]
155 #[inline(always)]
156 pub fn intg_opt(&self) -> IntgOptR {
157 IntgOptR::new(((self.bits >> 16) & 0xff) as u8)
158 }
159 #[doc = "Bits 24:31 - Shows the compile options for the TRNG."]
160 #[inline(always)]
161 pub fn era(&self) -> EraR {
162 EraR::new(((self.bits >> 24) & 0xff) as u8)
163 }
164}
165#[cfg(feature = "debug")]
166impl core::fmt::Debug for R {
167 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
168 f.debug_struct("VID2")
169 .field("config_opt", &self.config_opt())
170 .field("eco_rev", &self.eco_rev())
171 .field("intg_opt", &self.intg_opt())
172 .field("era", &self.era())
173 .finish()
174 }
175}
176#[doc = "Version ID Register (LS)\n\nYou can [`read`](crate::Reg::read) this register and get [`vid2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
177pub struct Vid2Spec;
178impl crate::RegisterSpec for Vid2Spec {
179 type Ux = u32;
180}
181#[doc = "`read()` method returns [`vid2::R`](R) reader structure"]
182impl crate::Readable for Vid2Spec {}
183#[doc = "`reset()` method sets VID2 to value 0"]
184impl crate::Resettable for Vid2Spec {
185 const RESET_VALUE: u32 = 0;
186}