mimxrt685s_pac/usbphy/
anactrl_tog.rs1#[doc = "Register `ANACTRL_TOG` reader"]
2pub type R = crate::R<AnactrlTogSpec>;
3#[doc = "Register `ANACTRL_TOG` writer"]
4pub type W = crate::W<AnactrlTogSpec>;
5#[doc = "Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins\n\nValue on reset: 1"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum DevPulldown {
9 #[doc = "0: The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare disabled in device mode."]
10 DevPulldown0 = 0,
11 #[doc = "1: The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare enabled in device mode."]
12 DevPulldown1 = 1,
13}
14impl From<DevPulldown> for bool {
15 #[inline(always)]
16 fn from(variant: DevPulldown) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `DEV_PULLDOWN` reader - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
21pub type DevPulldownR = crate::BitReader<DevPulldown>;
22impl DevPulldownR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> DevPulldown {
26 match self.bits {
27 false => DevPulldown::DevPulldown0,
28 true => DevPulldown::DevPulldown1,
29 }
30 }
31 #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare disabled in device mode."]
32 #[inline(always)]
33 pub fn is_dev_pulldown_0(&self) -> bool {
34 *self == DevPulldown::DevPulldown0
35 }
36 #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare enabled in device mode."]
37 #[inline(always)]
38 pub fn is_dev_pulldown_1(&self) -> bool {
39 *self == DevPulldown::DevPulldown1
40 }
41}
42#[doc = "Field `DEV_PULLDOWN` writer - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
43pub type DevPulldownW<'a, REG> = crate::BitWriter<'a, REG, DevPulldown>;
44impl<'a, REG> DevPulldownW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare disabled in device mode."]
49 #[inline(always)]
50 pub fn dev_pulldown_0(self) -> &'a mut crate::W<REG> {
51 self.variant(DevPulldown::DevPulldown0)
52 }
53 #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare enabled in device mode."]
54 #[inline(always)]
55 pub fn dev_pulldown_1(self) -> &'a mut crate::W<REG> {
56 self.variant(DevPulldown::DevPulldown1)
57 }
58}
59impl R {
60 #[doc = "Bit 10 - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
61 #[inline(always)]
62 pub fn dev_pulldown(&self) -> DevPulldownR {
63 DevPulldownR::new(((self.bits >> 10) & 1) != 0)
64 }
65}
66#[cfg(feature = "debug")]
67impl core::fmt::Debug for R {
68 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
69 f.debug_struct("ANACTRL_TOG")
70 .field("dev_pulldown", &self.dev_pulldown())
71 .finish()
72 }
73}
74impl W {
75 #[doc = "Bit 10 - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
76 #[inline(always)]
77 pub fn dev_pulldown(&mut self) -> DevPulldownW<AnactrlTogSpec> {
78 DevPulldownW::new(self, 10)
79 }
80}
81#[doc = "USB PHY Analog Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`anactrl_tog::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`anactrl_tog::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
82pub struct AnactrlTogSpec;
83impl crate::RegisterSpec for AnactrlTogSpec {
84 type Ux = u32;
85}
86#[doc = "`read()` method returns [`anactrl_tog::R`](R) reader structure"]
87impl crate::Readable for AnactrlTogSpec {}
88#[doc = "`write(|w| ..)` method takes [`anactrl_tog::W`](W) writer structure"]
89impl crate::Writable for AnactrlTogSpec {
90 type Safety = crate::Unsafe;
91 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
92 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
93}
94#[doc = "`reset()` method sets ANACTRL_TOG to value 0x0a00_0402"]
95impl crate::Resettable for AnactrlTogSpec {
96 const RESET_VALUE: u32 = 0x0a00_0402;
97}