mimxrt595s/usbphy/
usb1_loopback_set.rs

1#[doc = "Register `USB1_LOOPBACK_SET` reader"]
2pub struct R(crate::R<USB1_LOOPBACK_SET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<USB1_LOOPBACK_SET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<USB1_LOOPBACK_SET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<USB1_LOOPBACK_SET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `USB1_LOOPBACK_SET` writer"]
17pub struct W(crate::W<USB1_LOOPBACK_SET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<USB1_LOOPBACK_SET_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<USB1_LOOPBACK_SET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<USB1_LOOPBACK_SET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `UTMI_TESTSTART` reader - USB loopback test."]
38pub type UTMI_TESTSTART_R = crate::BitReader<UTMI_TESTSTART_A>;
39#[doc = "USB loopback test.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum UTMI_TESTSTART_A {
42    #[doc = "0: No effect"]
43    DISABLE = 0,
44    #[doc = "1: Sets the corresponding bit"]
45    ENABLE = 1,
46}
47impl From<UTMI_TESTSTART_A> for bool {
48    #[inline(always)]
49    fn from(variant: UTMI_TESTSTART_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl UTMI_TESTSTART_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> UTMI_TESTSTART_A {
57        match self.bits {
58            false => UTMI_TESTSTART_A::DISABLE,
59            true => UTMI_TESTSTART_A::ENABLE,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLE`"]
63    #[inline(always)]
64    pub fn is_disable(&self) -> bool {
65        *self == UTMI_TESTSTART_A::DISABLE
66    }
67    #[doc = "Checks if the value of the field is `ENABLE`"]
68    #[inline(always)]
69    pub fn is_enable(&self) -> bool {
70        *self == UTMI_TESTSTART_A::ENABLE
71    }
72}
73#[doc = "Field `UTMI_TESTSTART` writer - USB loopback test."]
74pub type UTMI_TESTSTART_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, UTMI_TESTSTART_A, O>;
76impl<'a, const O: u8> UTMI_TESTSTART_W<'a, O> {
77    #[doc = "No effect"]
78    #[inline(always)]
79    pub fn disable(self) -> &'a mut W {
80        self.variant(UTMI_TESTSTART_A::DISABLE)
81    }
82    #[doc = "Sets the corresponding bit"]
83    #[inline(always)]
84    pub fn enable(self) -> &'a mut W {
85        self.variant(UTMI_TESTSTART_A::ENABLE)
86    }
87}
88#[doc = "Field `UTMI_DIG_TST0` reader - Mode control for USB loopback test."]
89pub type UTMI_DIG_TST0_R = crate::BitReader<UTMI_DIG_TST0_A>;
90#[doc = "Mode control for USB loopback test.\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum UTMI_DIG_TST0_A {
93    #[doc = "0: No effect"]
94    DISABLE = 0,
95    #[doc = "1: Sets the corresponding bit"]
96    ENABLE = 1,
97}
98impl From<UTMI_DIG_TST0_A> for bool {
99    #[inline(always)]
100    fn from(variant: UTMI_DIG_TST0_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl UTMI_DIG_TST0_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> UTMI_DIG_TST0_A {
108        match self.bits {
109            false => UTMI_DIG_TST0_A::DISABLE,
110            true => UTMI_DIG_TST0_A::ENABLE,
111        }
112    }
113    #[doc = "Checks if the value of the field is `DISABLE`"]
114    #[inline(always)]
115    pub fn is_disable(&self) -> bool {
116        *self == UTMI_DIG_TST0_A::DISABLE
117    }
118    #[doc = "Checks if the value of the field is `ENABLE`"]
119    #[inline(always)]
120    pub fn is_enable(&self) -> bool {
121        *self == UTMI_DIG_TST0_A::ENABLE
122    }
123}
124#[doc = "Field `UTMI_DIG_TST0` writer - Mode control for USB loopback test."]
125pub type UTMI_DIG_TST0_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, UTMI_DIG_TST0_A, O>;
127impl<'a, const O: u8> UTMI_DIG_TST0_W<'a, O> {
128    #[doc = "No effect"]
129    #[inline(always)]
130    pub fn disable(self) -> &'a mut W {
131        self.variant(UTMI_DIG_TST0_A::DISABLE)
132    }
133    #[doc = "Sets the corresponding bit"]
134    #[inline(always)]
135    pub fn enable(self) -> &'a mut W {
136        self.variant(UTMI_DIG_TST0_A::ENABLE)
137    }
138}
139#[doc = "Field `UTMI_DIG_TST1` reader - Mode control for USB loopback test."]
140pub type UTMI_DIG_TST1_R = crate::BitReader<UTMI_DIG_TST1_A>;
141#[doc = "Mode control for USB loopback test.\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143pub enum UTMI_DIG_TST1_A {
144    #[doc = "0: No effect"]
145    DISABLE = 0,
146    #[doc = "1: Sets the corresponding bit"]
147    ENABLE = 1,
148}
149impl From<UTMI_DIG_TST1_A> for bool {
150    #[inline(always)]
151    fn from(variant: UTMI_DIG_TST1_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl UTMI_DIG_TST1_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> UTMI_DIG_TST1_A {
159        match self.bits {
160            false => UTMI_DIG_TST1_A::DISABLE,
161            true => UTMI_DIG_TST1_A::ENABLE,
162        }
163    }
164    #[doc = "Checks if the value of the field is `DISABLE`"]
165    #[inline(always)]
166    pub fn is_disable(&self) -> bool {
167        *self == UTMI_DIG_TST1_A::DISABLE
168    }
169    #[doc = "Checks if the value of the field is `ENABLE`"]
170    #[inline(always)]
171    pub fn is_enable(&self) -> bool {
172        *self == UTMI_DIG_TST1_A::ENABLE
173    }
174}
175#[doc = "Field `UTMI_DIG_TST1` writer - Mode control for USB loopback test."]
176pub type UTMI_DIG_TST1_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, UTMI_DIG_TST1_A, O>;
178impl<'a, const O: u8> UTMI_DIG_TST1_W<'a, O> {
179    #[doc = "No effect"]
180    #[inline(always)]
181    pub fn disable(self) -> &'a mut W {
182        self.variant(UTMI_DIG_TST1_A::DISABLE)
183    }
184    #[doc = "Sets the corresponding bit"]
185    #[inline(always)]
186    pub fn enable(self) -> &'a mut W {
187        self.variant(UTMI_DIG_TST1_A::ENABLE)
188    }
189}
190#[doc = "Field `TSTI_TX_HS_MODE` reader - Select HS or FS mode for USB loopback testing."]
191pub type TSTI_TX_HS_MODE_R = crate::BitReader<bool>;
192#[doc = "Field `TSTI_TX_HS_MODE` writer - Select HS or FS mode for USB loopback testing."]
193pub type TSTI_TX_HS_MODE_W<'a, const O: u8> =
194    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, bool, O>;
195#[doc = "Field `TSTI_TX_LS_MODE` reader - Select HS or FS mode for USB loopback testing."]
196pub type TSTI_TX_LS_MODE_R = crate::BitReader<TSTI_TX_LS_MODE_A>;
197#[doc = "Select HS or FS mode for USB loopback testing.\n\nValue on reset: 0"]
198#[derive(Clone, Copy, Debug, PartialEq, Eq)]
199pub enum TSTI_TX_LS_MODE_A {
200    #[doc = "0: No effect"]
201    DISABLE = 0,
202    #[doc = "1: Sets the corresponding bit"]
203    ENABLE = 1,
204}
205impl From<TSTI_TX_LS_MODE_A> for bool {
206    #[inline(always)]
207    fn from(variant: TSTI_TX_LS_MODE_A) -> Self {
208        variant as u8 != 0
209    }
210}
211impl TSTI_TX_LS_MODE_R {
212    #[doc = "Get enumerated values variant"]
213    #[inline(always)]
214    pub fn variant(&self) -> TSTI_TX_LS_MODE_A {
215        match self.bits {
216            false => TSTI_TX_LS_MODE_A::DISABLE,
217            true => TSTI_TX_LS_MODE_A::ENABLE,
218        }
219    }
220    #[doc = "Checks if the value of the field is `DISABLE`"]
221    #[inline(always)]
222    pub fn is_disable(&self) -> bool {
223        *self == TSTI_TX_LS_MODE_A::DISABLE
224    }
225    #[doc = "Checks if the value of the field is `ENABLE`"]
226    #[inline(always)]
227    pub fn is_enable(&self) -> bool {
228        *self == TSTI_TX_LS_MODE_A::ENABLE
229    }
230}
231#[doc = "Field `TSTI_TX_LS_MODE` writer - Select HS or FS mode for USB loopback testing."]
232pub type TSTI_TX_LS_MODE_W<'a, const O: u8> =
233    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, TSTI_TX_LS_MODE_A, O>;
234impl<'a, const O: u8> TSTI_TX_LS_MODE_W<'a, O> {
235    #[doc = "No effect"]
236    #[inline(always)]
237    pub fn disable(self) -> &'a mut W {
238        self.variant(TSTI_TX_LS_MODE_A::DISABLE)
239    }
240    #[doc = "Sets the corresponding bit"]
241    #[inline(always)]
242    pub fn enable(self) -> &'a mut W {
243        self.variant(TSTI_TX_LS_MODE_A::ENABLE)
244    }
245}
246#[doc = "Field `TSTI_TX_EN` reader - Enable TX for USB loopback test."]
247pub type TSTI_TX_EN_R = crate::BitReader<TSTI_TX_EN_A>;
248#[doc = "Enable TX for USB loopback test.\n\nValue on reset: 0"]
249#[derive(Clone, Copy, Debug, PartialEq, Eq)]
250pub enum TSTI_TX_EN_A {
251    #[doc = "0: No effect"]
252    DISABLE = 0,
253    #[doc = "1: Sets the corresponding bit"]
254    ENABLE = 1,
255}
256impl From<TSTI_TX_EN_A> for bool {
257    #[inline(always)]
258    fn from(variant: TSTI_TX_EN_A) -> Self {
259        variant as u8 != 0
260    }
261}
262impl TSTI_TX_EN_R {
263    #[doc = "Get enumerated values variant"]
264    #[inline(always)]
265    pub fn variant(&self) -> TSTI_TX_EN_A {
266        match self.bits {
267            false => TSTI_TX_EN_A::DISABLE,
268            true => TSTI_TX_EN_A::ENABLE,
269        }
270    }
271    #[doc = "Checks if the value of the field is `DISABLE`"]
272    #[inline(always)]
273    pub fn is_disable(&self) -> bool {
274        *self == TSTI_TX_EN_A::DISABLE
275    }
276    #[doc = "Checks if the value of the field is `ENABLE`"]
277    #[inline(always)]
278    pub fn is_enable(&self) -> bool {
279        *self == TSTI_TX_EN_A::ENABLE
280    }
281}
282#[doc = "Field `TSTI_TX_EN` writer - Enable TX for USB loopback test."]
283pub type TSTI_TX_EN_W<'a, const O: u8> =
284    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, TSTI_TX_EN_A, O>;
285impl<'a, const O: u8> TSTI_TX_EN_W<'a, O> {
286    #[doc = "No effect"]
287    #[inline(always)]
288    pub fn disable(self) -> &'a mut W {
289        self.variant(TSTI_TX_EN_A::DISABLE)
290    }
291    #[doc = "Sets the corresponding bit"]
292    #[inline(always)]
293    pub fn enable(self) -> &'a mut W {
294        self.variant(TSTI_TX_EN_A::ENABLE)
295    }
296}
297#[doc = "Field `TSTI_TX_HIZ` reader - Sets TX Hi-Z for USB loopback test."]
298pub type TSTI_TX_HIZ_R = crate::BitReader<TSTI_TX_HIZ_A>;
299#[doc = "Sets TX Hi-Z for USB loopback test.\n\nValue on reset: 0"]
300#[derive(Clone, Copy, Debug, PartialEq, Eq)]
301pub enum TSTI_TX_HIZ_A {
302    #[doc = "0: No effect"]
303    DISABLE = 0,
304    #[doc = "1: Sets the corresponding bit"]
305    ENABLE = 1,
306}
307impl From<TSTI_TX_HIZ_A> for bool {
308    #[inline(always)]
309    fn from(variant: TSTI_TX_HIZ_A) -> Self {
310        variant as u8 != 0
311    }
312}
313impl TSTI_TX_HIZ_R {
314    #[doc = "Get enumerated values variant"]
315    #[inline(always)]
316    pub fn variant(&self) -> TSTI_TX_HIZ_A {
317        match self.bits {
318            false => TSTI_TX_HIZ_A::DISABLE,
319            true => TSTI_TX_HIZ_A::ENABLE,
320        }
321    }
322    #[doc = "Checks if the value of the field is `DISABLE`"]
323    #[inline(always)]
324    pub fn is_disable(&self) -> bool {
325        *self == TSTI_TX_HIZ_A::DISABLE
326    }
327    #[doc = "Checks if the value of the field is `ENABLE`"]
328    #[inline(always)]
329    pub fn is_enable(&self) -> bool {
330        *self == TSTI_TX_HIZ_A::ENABLE
331    }
332}
333#[doc = "Field `TSTI_TX_HIZ` writer - Sets TX Hi-Z for USB loopback test."]
334pub type TSTI_TX_HIZ_W<'a, const O: u8> =
335    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, TSTI_TX_HIZ_A, O>;
336impl<'a, const O: u8> TSTI_TX_HIZ_W<'a, O> {
337    #[doc = "No effect"]
338    #[inline(always)]
339    pub fn disable(self) -> &'a mut W {
340        self.variant(TSTI_TX_HIZ_A::DISABLE)
341    }
342    #[doc = "Sets the corresponding bit"]
343    #[inline(always)]
344    pub fn enable(self) -> &'a mut W {
345        self.variant(TSTI_TX_HIZ_A::ENABLE)
346    }
347}
348#[doc = "Field `UTMO_DIG_TST0` reader - Status bit for USB loopback test."]
349pub type UTMO_DIG_TST0_R = crate::BitReader<UTMO_DIG_TST0_A>;
350#[doc = "Status bit for USB loopback test.\n\nValue on reset: 0"]
351#[derive(Clone, Copy, Debug, PartialEq, Eq)]
352pub enum UTMO_DIG_TST0_A {
353    #[doc = "0: No effect"]
354    DISABLE = 0,
355    #[doc = "1: Sets the corresponding bit"]
356    ENABLE = 1,
357}
358impl From<UTMO_DIG_TST0_A> for bool {
359    #[inline(always)]
360    fn from(variant: UTMO_DIG_TST0_A) -> Self {
361        variant as u8 != 0
362    }
363}
364impl UTMO_DIG_TST0_R {
365    #[doc = "Get enumerated values variant"]
366    #[inline(always)]
367    pub fn variant(&self) -> UTMO_DIG_TST0_A {
368        match self.bits {
369            false => UTMO_DIG_TST0_A::DISABLE,
370            true => UTMO_DIG_TST0_A::ENABLE,
371        }
372    }
373    #[doc = "Checks if the value of the field is `DISABLE`"]
374    #[inline(always)]
375    pub fn is_disable(&self) -> bool {
376        *self == UTMO_DIG_TST0_A::DISABLE
377    }
378    #[doc = "Checks if the value of the field is `ENABLE`"]
379    #[inline(always)]
380    pub fn is_enable(&self) -> bool {
381        *self == UTMO_DIG_TST0_A::ENABLE
382    }
383}
384#[doc = "Field `UTMO_DIG_TST1` reader - Status bit for USB loopback test."]
385pub type UTMO_DIG_TST1_R = crate::BitReader<UTMO_DIG_TST1_A>;
386#[doc = "Status bit for USB loopback test.\n\nValue on reset: 0"]
387#[derive(Clone, Copy, Debug, PartialEq, Eq)]
388pub enum UTMO_DIG_TST1_A {
389    #[doc = "0: No effect"]
390    DISABLE = 0,
391    #[doc = "1: Sets the corresponding bit"]
392    ENABLE = 1,
393}
394impl From<UTMO_DIG_TST1_A> for bool {
395    #[inline(always)]
396    fn from(variant: UTMO_DIG_TST1_A) -> Self {
397        variant as u8 != 0
398    }
399}
400impl UTMO_DIG_TST1_R {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub fn variant(&self) -> UTMO_DIG_TST1_A {
404        match self.bits {
405            false => UTMO_DIG_TST1_A::DISABLE,
406            true => UTMO_DIG_TST1_A::ENABLE,
407        }
408    }
409    #[doc = "Checks if the value of the field is `DISABLE`"]
410    #[inline(always)]
411    pub fn is_disable(&self) -> bool {
412        *self == UTMO_DIG_TST1_A::DISABLE
413    }
414    #[doc = "Checks if the value of the field is `ENABLE`"]
415    #[inline(always)]
416    pub fn is_enable(&self) -> bool {
417        *self == UTMO_DIG_TST1_A::ENABLE
418    }
419}
420#[doc = "Field `TSTI_HSFS_MODE_EN` reader - TSTI_HSFS_MODE_EN"]
421pub type TSTI_HSFS_MODE_EN_R = crate::BitReader<TSTI_HSFS_MODE_EN_A>;
422#[doc = "TSTI_HSFS_MODE_EN\n\nValue on reset: 0"]
423#[derive(Clone, Copy, Debug, PartialEq, Eq)]
424pub enum TSTI_HSFS_MODE_EN_A {
425    #[doc = "0: No effect"]
426    DISABLE = 0,
427    #[doc = "1: Sets the corresponding bit"]
428    ENABLE = 1,
429}
430impl From<TSTI_HSFS_MODE_EN_A> for bool {
431    #[inline(always)]
432    fn from(variant: TSTI_HSFS_MODE_EN_A) -> Self {
433        variant as u8 != 0
434    }
435}
436impl TSTI_HSFS_MODE_EN_R {
437    #[doc = "Get enumerated values variant"]
438    #[inline(always)]
439    pub fn variant(&self) -> TSTI_HSFS_MODE_EN_A {
440        match self.bits {
441            false => TSTI_HSFS_MODE_EN_A::DISABLE,
442            true => TSTI_HSFS_MODE_EN_A::ENABLE,
443        }
444    }
445    #[doc = "Checks if the value of the field is `DISABLE`"]
446    #[inline(always)]
447    pub fn is_disable(&self) -> bool {
448        *self == TSTI_HSFS_MODE_EN_A::DISABLE
449    }
450    #[doc = "Checks if the value of the field is `ENABLE`"]
451    #[inline(always)]
452    pub fn is_enable(&self) -> bool {
453        *self == TSTI_HSFS_MODE_EN_A::ENABLE
454    }
455}
456#[doc = "Field `TSTI_HSFS_MODE_EN` writer - TSTI_HSFS_MODE_EN"]
457pub type TSTI_HSFS_MODE_EN_W<'a, const O: u8> =
458    crate::BitWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, TSTI_HSFS_MODE_EN_A, O>;
459impl<'a, const O: u8> TSTI_HSFS_MODE_EN_W<'a, O> {
460    #[doc = "No effect"]
461    #[inline(always)]
462    pub fn disable(self) -> &'a mut W {
463        self.variant(TSTI_HSFS_MODE_EN_A::DISABLE)
464    }
465    #[doc = "Sets the corresponding bit"]
466    #[inline(always)]
467    pub fn enable(self) -> &'a mut W {
468        self.variant(TSTI_HSFS_MODE_EN_A::ENABLE)
469    }
470}
471#[doc = "Field `TSTPKT` reader - Test packet"]
472pub type TSTPKT_R = crate::FieldReader<u8, TSTPKT_A>;
473#[doc = "Test packet\n\nValue on reset: 85"]
474#[derive(Clone, Copy, Debug, PartialEq, Eq)]
475#[repr(u8)]
476pub enum TSTPKT_A {
477    #[doc = "0: No effect"]
478    DISABLE = 0,
479    #[doc = "1: Sets the corresponding bit"]
480    ENABLE = 1,
481}
482impl From<TSTPKT_A> for u8 {
483    #[inline(always)]
484    fn from(variant: TSTPKT_A) -> Self {
485        variant as _
486    }
487}
488impl TSTPKT_R {
489    #[doc = "Get enumerated values variant"]
490    #[inline(always)]
491    pub fn variant(&self) -> Option<TSTPKT_A> {
492        match self.bits {
493            0 => Some(TSTPKT_A::DISABLE),
494            1 => Some(TSTPKT_A::ENABLE),
495            _ => None,
496        }
497    }
498    #[doc = "Checks if the value of the field is `DISABLE`"]
499    #[inline(always)]
500    pub fn is_disable(&self) -> bool {
501        *self == TSTPKT_A::DISABLE
502    }
503    #[doc = "Checks if the value of the field is `ENABLE`"]
504    #[inline(always)]
505    pub fn is_enable(&self) -> bool {
506        *self == TSTPKT_A::ENABLE
507    }
508}
509#[doc = "Field `TSTPKT` writer - Test packet"]
510pub type TSTPKT_W<'a, const O: u8> =
511    crate::FieldWriter<'a, u32, USB1_LOOPBACK_SET_SPEC, u8, TSTPKT_A, 8, O>;
512impl<'a, const O: u8> TSTPKT_W<'a, O> {
513    #[doc = "No effect"]
514    #[inline(always)]
515    pub fn disable(self) -> &'a mut W {
516        self.variant(TSTPKT_A::DISABLE)
517    }
518    #[doc = "Sets the corresponding bit"]
519    #[inline(always)]
520    pub fn enable(self) -> &'a mut W {
521        self.variant(TSTPKT_A::ENABLE)
522    }
523}
524impl R {
525    #[doc = "Bit 0 - USB loopback test."]
526    #[inline(always)]
527    pub fn utmi_teststart(&self) -> UTMI_TESTSTART_R {
528        UTMI_TESTSTART_R::new((self.bits & 1) != 0)
529    }
530    #[doc = "Bit 1 - Mode control for USB loopback test."]
531    #[inline(always)]
532    pub fn utmi_dig_tst0(&self) -> UTMI_DIG_TST0_R {
533        UTMI_DIG_TST0_R::new(((self.bits >> 1) & 1) != 0)
534    }
535    #[doc = "Bit 2 - Mode control for USB loopback test."]
536    #[inline(always)]
537    pub fn utmi_dig_tst1(&self) -> UTMI_DIG_TST1_R {
538        UTMI_DIG_TST1_R::new(((self.bits >> 2) & 1) != 0)
539    }
540    #[doc = "Bit 3 - Select HS or FS mode for USB loopback testing."]
541    #[inline(always)]
542    pub fn tsti_tx_hs_mode(&self) -> TSTI_TX_HS_MODE_R {
543        TSTI_TX_HS_MODE_R::new(((self.bits >> 3) & 1) != 0)
544    }
545    #[doc = "Bit 4 - Select HS or FS mode for USB loopback testing."]
546    #[inline(always)]
547    pub fn tsti_tx_ls_mode(&self) -> TSTI_TX_LS_MODE_R {
548        TSTI_TX_LS_MODE_R::new(((self.bits >> 4) & 1) != 0)
549    }
550    #[doc = "Bit 5 - Enable TX for USB loopback test."]
551    #[inline(always)]
552    pub fn tsti_tx_en(&self) -> TSTI_TX_EN_R {
553        TSTI_TX_EN_R::new(((self.bits >> 5) & 1) != 0)
554    }
555    #[doc = "Bit 6 - Sets TX Hi-Z for USB loopback test."]
556    #[inline(always)]
557    pub fn tsti_tx_hiz(&self) -> TSTI_TX_HIZ_R {
558        TSTI_TX_HIZ_R::new(((self.bits >> 6) & 1) != 0)
559    }
560    #[doc = "Bit 7 - Status bit for USB loopback test."]
561    #[inline(always)]
562    pub fn utmo_dig_tst0(&self) -> UTMO_DIG_TST0_R {
563        UTMO_DIG_TST0_R::new(((self.bits >> 7) & 1) != 0)
564    }
565    #[doc = "Bit 8 - Status bit for USB loopback test."]
566    #[inline(always)]
567    pub fn utmo_dig_tst1(&self) -> UTMO_DIG_TST1_R {
568        UTMO_DIG_TST1_R::new(((self.bits >> 8) & 1) != 0)
569    }
570    #[doc = "Bit 15 - TSTI_HSFS_MODE_EN"]
571    #[inline(always)]
572    pub fn tsti_hsfs_mode_en(&self) -> TSTI_HSFS_MODE_EN_R {
573        TSTI_HSFS_MODE_EN_R::new(((self.bits >> 15) & 1) != 0)
574    }
575    #[doc = "Bits 16:23 - Test packet"]
576    #[inline(always)]
577    pub fn tstpkt(&self) -> TSTPKT_R {
578        TSTPKT_R::new(((self.bits >> 16) & 0xff) as u8)
579    }
580}
581impl W {
582    #[doc = "Bit 0 - USB loopback test."]
583    #[inline(always)]
584    #[must_use]
585    pub fn utmi_teststart(&mut self) -> UTMI_TESTSTART_W<0> {
586        UTMI_TESTSTART_W::new(self)
587    }
588    #[doc = "Bit 1 - Mode control for USB loopback test."]
589    #[inline(always)]
590    #[must_use]
591    pub fn utmi_dig_tst0(&mut self) -> UTMI_DIG_TST0_W<1> {
592        UTMI_DIG_TST0_W::new(self)
593    }
594    #[doc = "Bit 2 - Mode control for USB loopback test."]
595    #[inline(always)]
596    #[must_use]
597    pub fn utmi_dig_tst1(&mut self) -> UTMI_DIG_TST1_W<2> {
598        UTMI_DIG_TST1_W::new(self)
599    }
600    #[doc = "Bit 3 - Select HS or FS mode for USB loopback testing."]
601    #[inline(always)]
602    #[must_use]
603    pub fn tsti_tx_hs_mode(&mut self) -> TSTI_TX_HS_MODE_W<3> {
604        TSTI_TX_HS_MODE_W::new(self)
605    }
606    #[doc = "Bit 4 - Select HS or FS mode for USB loopback testing."]
607    #[inline(always)]
608    #[must_use]
609    pub fn tsti_tx_ls_mode(&mut self) -> TSTI_TX_LS_MODE_W<4> {
610        TSTI_TX_LS_MODE_W::new(self)
611    }
612    #[doc = "Bit 5 - Enable TX for USB loopback test."]
613    #[inline(always)]
614    #[must_use]
615    pub fn tsti_tx_en(&mut self) -> TSTI_TX_EN_W<5> {
616        TSTI_TX_EN_W::new(self)
617    }
618    #[doc = "Bit 6 - Sets TX Hi-Z for USB loopback test."]
619    #[inline(always)]
620    #[must_use]
621    pub fn tsti_tx_hiz(&mut self) -> TSTI_TX_HIZ_W<6> {
622        TSTI_TX_HIZ_W::new(self)
623    }
624    #[doc = "Bit 15 - TSTI_HSFS_MODE_EN"]
625    #[inline(always)]
626    #[must_use]
627    pub fn tsti_hsfs_mode_en(&mut self) -> TSTI_HSFS_MODE_EN_W<15> {
628        TSTI_HSFS_MODE_EN_W::new(self)
629    }
630    #[doc = "Bits 16:23 - Test packet"]
631    #[inline(always)]
632    #[must_use]
633    pub fn tstpkt(&mut self) -> TSTPKT_W<16> {
634        TSTPKT_W::new(self)
635    }
636    #[doc = "Writes raw bits to the register."]
637    #[inline(always)]
638    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
639        self.0.bits(bits);
640        self
641    }
642}
643#[doc = "USB PHY Loopback Control/Status Set\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 [usb1_loopback_set](index.html) module"]
644pub struct USB1_LOOPBACK_SET_SPEC;
645impl crate::RegisterSpec for USB1_LOOPBACK_SET_SPEC {
646    type Ux = u32;
647}
648#[doc = "`read()` method returns [usb1_loopback_set::R](R) reader structure"]
649impl crate::Readable for USB1_LOOPBACK_SET_SPEC {
650    type Reader = R;
651}
652#[doc = "`write(|w| ..)` method takes [usb1_loopback_set::W](W) writer structure"]
653impl crate::Writable for USB1_LOOPBACK_SET_SPEC {
654    type Writer = W;
655    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
656    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
657}
658#[doc = "`reset()` method sets USB1_LOOPBACK_SET to value 0x0055_0000"]
659impl crate::Resettable for USB1_LOOPBACK_SET_SPEC {
660    const RESET_VALUE: Self::Ux = 0x0055_0000;
661}