mimxrt595s/usbphy/
debug1_tog.rs

1#[doc = "Register `DEBUG1_TOG` reader"]
2pub struct R(crate::R<DEBUG1_TOG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DEBUG1_TOG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DEBUG1_TOG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DEBUG1_TOG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DEBUG1_TOG` writer"]
17pub struct W(crate::W<DEBUG1_TOG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DEBUG1_TOG_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<DEBUG1_TOG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DEBUG1_TOG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ENTAILADJVD` reader - Enable delay increment"]
38pub type ENTAILADJVD_R = crate::FieldReader<u8, ENTAILADJVD_A>;
39#[doc = "Enable delay increment\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum ENTAILADJVD_A {
43    #[doc = "0: No effect"]
44    DISABLE = 0,
45    #[doc = "1: Clears the corresponding DEBUG1 bit"]
46    ENABLE = 1,
47}
48impl From<ENTAILADJVD_A> for u8 {
49    #[inline(always)]
50    fn from(variant: ENTAILADJVD_A) -> Self {
51        variant as _
52    }
53}
54impl ENTAILADJVD_R {
55    #[doc = "Get enumerated values variant"]
56    #[inline(always)]
57    pub fn variant(&self) -> Option<ENTAILADJVD_A> {
58        match self.bits {
59            0 => Some(ENTAILADJVD_A::DISABLE),
60            1 => Some(ENTAILADJVD_A::ENABLE),
61            _ => None,
62        }
63    }
64    #[doc = "Checks if the value of the field is `DISABLE`"]
65    #[inline(always)]
66    pub fn is_disable(&self) -> bool {
67        *self == ENTAILADJVD_A::DISABLE
68    }
69    #[doc = "Checks if the value of the field is `ENABLE`"]
70    #[inline(always)]
71    pub fn is_enable(&self) -> bool {
72        *self == ENTAILADJVD_A::ENABLE
73    }
74}
75#[doc = "Field `ENTAILADJVD` writer - Enable delay increment"]
76pub type ENTAILADJVD_W<'a, const O: u8> =
77    crate::FieldWriter<'a, u32, DEBUG1_TOG_SPEC, u8, ENTAILADJVD_A, 2, O>;
78impl<'a, const O: u8> ENTAILADJVD_W<'a, O> {
79    #[doc = "No effect"]
80    #[inline(always)]
81    pub fn disable(self) -> &'a mut W {
82        self.variant(ENTAILADJVD_A::DISABLE)
83    }
84    #[doc = "Clears the corresponding DEBUG1 bit"]
85    #[inline(always)]
86    pub fn enable(self) -> &'a mut W {
87        self.variant(ENTAILADJVD_A::ENABLE)
88    }
89}
90#[doc = "Field `USB2_REFBIAS_VBGADJ` reader - Bandgap adjustment"]
91pub type USB2_REFBIAS_VBGADJ_R = crate::FieldReader<u8, USB2_REFBIAS_VBGADJ_A>;
92#[doc = "Bandgap adjustment\n\nValue on reset: 0"]
93#[derive(Clone, Copy, Debug, PartialEq, Eq)]
94#[repr(u8)]
95pub enum USB2_REFBIAS_VBGADJ_A {
96    #[doc = "0: No effect"]
97    DISABLE = 0,
98    #[doc = "1: Toggles the corresponding DEBUG1 bit"]
99    ENABLE = 1,
100}
101impl From<USB2_REFBIAS_VBGADJ_A> for u8 {
102    #[inline(always)]
103    fn from(variant: USB2_REFBIAS_VBGADJ_A) -> Self {
104        variant as _
105    }
106}
107impl USB2_REFBIAS_VBGADJ_R {
108    #[doc = "Get enumerated values variant"]
109    #[inline(always)]
110    pub fn variant(&self) -> Option<USB2_REFBIAS_VBGADJ_A> {
111        match self.bits {
112            0 => Some(USB2_REFBIAS_VBGADJ_A::DISABLE),
113            1 => Some(USB2_REFBIAS_VBGADJ_A::ENABLE),
114            _ => None,
115        }
116    }
117    #[doc = "Checks if the value of the field is `DISABLE`"]
118    #[inline(always)]
119    pub fn is_disable(&self) -> bool {
120        *self == USB2_REFBIAS_VBGADJ_A::DISABLE
121    }
122    #[doc = "Checks if the value of the field is `ENABLE`"]
123    #[inline(always)]
124    pub fn is_enable(&self) -> bool {
125        *self == USB2_REFBIAS_VBGADJ_A::ENABLE
126    }
127}
128#[doc = "Field `USB2_REFBIAS_VBGADJ` writer - Bandgap adjustment"]
129pub type USB2_REFBIAS_VBGADJ_W<'a, const O: u8> =
130    crate::FieldWriter<'a, u32, DEBUG1_TOG_SPEC, u8, USB2_REFBIAS_VBGADJ_A, 3, O>;
131impl<'a, const O: u8> USB2_REFBIAS_VBGADJ_W<'a, O> {
132    #[doc = "No effect"]
133    #[inline(always)]
134    pub fn disable(self) -> &'a mut W {
135        self.variant(USB2_REFBIAS_VBGADJ_A::DISABLE)
136    }
137    #[doc = "Toggles the corresponding DEBUG1 bit"]
138    #[inline(always)]
139    pub fn enable(self) -> &'a mut W {
140        self.variant(USB2_REFBIAS_VBGADJ_A::ENABLE)
141    }
142}
143#[doc = "Field `USB2_REFBIAS_TST` reader - Bias current control"]
144pub type USB2_REFBIAS_TST_R = crate::FieldReader<u8, USB2_REFBIAS_TST_A>;
145#[doc = "Bias current control\n\nValue on reset: 0"]
146#[derive(Clone, Copy, Debug, PartialEq, Eq)]
147#[repr(u8)]
148pub enum USB2_REFBIAS_TST_A {
149    #[doc = "0: No effect"]
150    DISABLE = 0,
151    #[doc = "1: Toggles the corresponding DEBUG1 bit"]
152    ENABLE = 1,
153}
154impl From<USB2_REFBIAS_TST_A> for u8 {
155    #[inline(always)]
156    fn from(variant: USB2_REFBIAS_TST_A) -> Self {
157        variant as _
158    }
159}
160impl USB2_REFBIAS_TST_R {
161    #[doc = "Get enumerated values variant"]
162    #[inline(always)]
163    pub fn variant(&self) -> Option<USB2_REFBIAS_TST_A> {
164        match self.bits {
165            0 => Some(USB2_REFBIAS_TST_A::DISABLE),
166            1 => Some(USB2_REFBIAS_TST_A::ENABLE),
167            _ => None,
168        }
169    }
170    #[doc = "Checks if the value of the field is `DISABLE`"]
171    #[inline(always)]
172    pub fn is_disable(&self) -> bool {
173        *self == USB2_REFBIAS_TST_A::DISABLE
174    }
175    #[doc = "Checks if the value of the field is `ENABLE`"]
176    #[inline(always)]
177    pub fn is_enable(&self) -> bool {
178        *self == USB2_REFBIAS_TST_A::ENABLE
179    }
180}
181#[doc = "Field `USB2_REFBIAS_TST` writer - Bias current control"]
182pub type USB2_REFBIAS_TST_W<'a, const O: u8> =
183    crate::FieldWriter<'a, u32, DEBUG1_TOG_SPEC, u8, USB2_REFBIAS_TST_A, 2, O>;
184impl<'a, const O: u8> USB2_REFBIAS_TST_W<'a, O> {
185    #[doc = "No effect"]
186    #[inline(always)]
187    pub fn disable(self) -> &'a mut W {
188        self.variant(USB2_REFBIAS_TST_A::DISABLE)
189    }
190    #[doc = "Toggles the corresponding DEBUG1 bit"]
191    #[inline(always)]
192    pub fn enable(self) -> &'a mut W {
193        self.variant(USB2_REFBIAS_TST_A::ENABLE)
194    }
195}
196impl R {
197    #[doc = "Bits 13:14 - Enable delay increment"]
198    #[inline(always)]
199    pub fn entailadjvd(&self) -> ENTAILADJVD_R {
200        ENTAILADJVD_R::new(((self.bits >> 13) & 3) as u8)
201    }
202    #[doc = "Bits 18:20 - Bandgap adjustment"]
203    #[inline(always)]
204    pub fn usb2_refbias_vbgadj(&self) -> USB2_REFBIAS_VBGADJ_R {
205        USB2_REFBIAS_VBGADJ_R::new(((self.bits >> 18) & 7) as u8)
206    }
207    #[doc = "Bits 21:22 - Bias current control"]
208    #[inline(always)]
209    pub fn usb2_refbias_tst(&self) -> USB2_REFBIAS_TST_R {
210        USB2_REFBIAS_TST_R::new(((self.bits >> 21) & 3) as u8)
211    }
212}
213impl W {
214    #[doc = "Bits 13:14 - Enable delay increment"]
215    #[inline(always)]
216    #[must_use]
217    pub fn entailadjvd(&mut self) -> ENTAILADJVD_W<13> {
218        ENTAILADJVD_W::new(self)
219    }
220    #[doc = "Bits 18:20 - Bandgap adjustment"]
221    #[inline(always)]
222    #[must_use]
223    pub fn usb2_refbias_vbgadj(&mut self) -> USB2_REFBIAS_VBGADJ_W<18> {
224        USB2_REFBIAS_VBGADJ_W::new(self)
225    }
226    #[doc = "Bits 21:22 - Bias current control"]
227    #[inline(always)]
228    #[must_use]
229    pub fn usb2_refbias_tst(&mut self) -> USB2_REFBIAS_TST_W<21> {
230        USB2_REFBIAS_TST_W::new(self)
231    }
232    #[doc = "Writes raw bits to the register."]
233    #[inline(always)]
234    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
235        self.0.bits(bits);
236        self
237    }
238}
239#[doc = "UTMI Debug 1 Toggle\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [debug1_tog](index.html) module"]
240pub struct DEBUG1_TOG_SPEC;
241impl crate::RegisterSpec for DEBUG1_TOG_SPEC {
242    type Ux = u32;
243}
244#[doc = "`read()` method returns [debug1_tog::R](R) reader structure"]
245impl crate::Readable for DEBUG1_TOG_SPEC {
246    type Reader = R;
247}
248#[doc = "`write(|w| ..)` method takes [debug1_tog::W](W) writer structure"]
249impl crate::Writable for DEBUG1_TOG_SPEC {
250    type Writer = W;
251    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
252    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
253}
254#[doc = "`reset()` method sets DEBUG1_TOG to value 0"]
255impl crate::Resettable for DEBUG1_TOG_SPEC {
256    const RESET_VALUE: Self::Ux = 0;
257}