xmc4400/scu_power/
pwrclr.rs

1#[doc = "Register `PWRCLR` writer"]
2pub type W = crate::W<PWRCLR_SPEC>;
3#[doc = "Clear Disable Hibernate Domain\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum HIB_A {
6    #[doc = "0: No effect"]
7    VALUE1 = 0,
8    #[doc = "1: Disable Hibernate domain"]
9    VALUE2 = 1,
10}
11impl From<HIB_A> for bool {
12    #[inline(always)]
13    fn from(variant: HIB_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `HIB` writer - Clear Disable Hibernate Domain"]
18pub type HIB_W<'a, REG> = crate::BitWriter<'a, REG, HIB_A>;
19impl<'a, REG> HIB_W<'a, REG>
20where
21    REG: crate::Writable + crate::RegisterSpec,
22{
23    #[doc = "No effect"]
24    #[inline(always)]
25    pub fn value1(self) -> &'a mut crate::W<REG> {
26        self.variant(HIB_A::VALUE1)
27    }
28    #[doc = "Disable Hibernate domain"]
29    #[inline(always)]
30    pub fn value2(self) -> &'a mut crate::W<REG> {
31        self.variant(HIB_A::VALUE2)
32    }
33}
34#[doc = "Clear USB PHY Transceiver Disable\n\nValue on reset: 0"]
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum USBPHYPDQ_A {
37    #[doc = "0: No effect"]
38    VALUE1 = 0,
39    #[doc = "1: Power-down"]
40    VALUE2 = 1,
41}
42impl From<USBPHYPDQ_A> for bool {
43    #[inline(always)]
44    fn from(variant: USBPHYPDQ_A) -> Self {
45        variant as u8 != 0
46    }
47}
48#[doc = "Field `USBPHYPDQ` writer - Clear USB PHY Transceiver Disable"]
49pub type USBPHYPDQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPHYPDQ_A>;
50impl<'a, REG> USBPHYPDQ_W<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53{
54    #[doc = "No effect"]
55    #[inline(always)]
56    pub fn value1(self) -> &'a mut crate::W<REG> {
57        self.variant(USBPHYPDQ_A::VALUE1)
58    }
59    #[doc = "Power-down"]
60    #[inline(always)]
61    pub fn value2(self) -> &'a mut crate::W<REG> {
62        self.variant(USBPHYPDQ_A::VALUE2)
63    }
64}
65#[doc = "Clear USB On-The-Go Comparators Enable\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq, Eq)]
67pub enum USBOTGEN_A {
68    #[doc = "0: No effect"]
69    VALUE1 = 0,
70    #[doc = "1: Power-down"]
71    VALUE2 = 1,
72}
73impl From<USBOTGEN_A> for bool {
74    #[inline(always)]
75    fn from(variant: USBOTGEN_A) -> Self {
76        variant as u8 != 0
77    }
78}
79#[doc = "Field `USBOTGEN` writer - Clear USB On-The-Go Comparators Enable"]
80pub type USBOTGEN_W<'a, REG> = crate::BitWriter<'a, REG, USBOTGEN_A>;
81impl<'a, REG> USBOTGEN_W<'a, REG>
82where
83    REG: crate::Writable + crate::RegisterSpec,
84{
85    #[doc = "No effect"]
86    #[inline(always)]
87    pub fn value1(self) -> &'a mut crate::W<REG> {
88        self.variant(USBOTGEN_A::VALUE1)
89    }
90    #[doc = "Power-down"]
91    #[inline(always)]
92    pub fn value2(self) -> &'a mut crate::W<REG> {
93        self.variant(USBOTGEN_A::VALUE2)
94    }
95}
96#[doc = "Clear USB Weak Pull-Up at PADN Enable\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum USBPUWQ_A {
99    #[doc = "0: No effect"]
100    VALUE1 = 0,
101    #[doc = "1: Pull-up active"]
102    VALUE2 = 1,
103}
104impl From<USBPUWQ_A> for bool {
105    #[inline(always)]
106    fn from(variant: USBPUWQ_A) -> Self {
107        variant as u8 != 0
108    }
109}
110#[doc = "Field `USBPUWQ` writer - Clear USB Weak Pull-Up at PADN Enable"]
111pub type USBPUWQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPUWQ_A>;
112impl<'a, REG> USBPUWQ_W<'a, REG>
113where
114    REG: crate::Writable + crate::RegisterSpec,
115{
116    #[doc = "No effect"]
117    #[inline(always)]
118    pub fn value1(self) -> &'a mut crate::W<REG> {
119        self.variant(USBPUWQ_A::VALUE1)
120    }
121    #[doc = "Pull-up active"]
122    #[inline(always)]
123    pub fn value2(self) -> &'a mut crate::W<REG> {
124        self.variant(USBPUWQ_A::VALUE2)
125    }
126}
127impl W {
128    #[doc = "Bit 0 - Clear Disable Hibernate Domain"]
129    #[inline(always)]
130    pub fn hib(&mut self) -> HIB_W<PWRCLR_SPEC> {
131        HIB_W::new(self, 0)
132    }
133    #[doc = "Bit 16 - Clear USB PHY Transceiver Disable"]
134    #[inline(always)]
135    pub fn usbphypdq(&mut self) -> USBPHYPDQ_W<PWRCLR_SPEC> {
136        USBPHYPDQ_W::new(self, 16)
137    }
138    #[doc = "Bit 17 - Clear USB On-The-Go Comparators Enable"]
139    #[inline(always)]
140    pub fn usbotgen(&mut self) -> USBOTGEN_W<PWRCLR_SPEC> {
141        USBOTGEN_W::new(self, 17)
142    }
143    #[doc = "Bit 18 - Clear USB Weak Pull-Up at PADN Enable"]
144    #[inline(always)]
145    pub fn usbpuwq(&mut self) -> USBPUWQ_W<PWRCLR_SPEC> {
146        USBPUWQ_W::new(self, 18)
147    }
148}
149#[doc = "PCU Clear Control Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pwrclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
150pub struct PWRCLR_SPEC;
151impl crate::RegisterSpec for PWRCLR_SPEC {
152    type Ux = u32;
153}
154#[doc = "`write(|w| ..)` method takes [`pwrclr::W`](W) writer structure"]
155impl crate::Writable for PWRCLR_SPEC {
156    type Safety = crate::Unsafe;
157    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
158    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
159}
160#[doc = "`reset()` method sets PWRCLR to value 0"]
161impl crate::Resettable for PWRCLR_SPEC {
162    const RESET_VALUE: u32 = 0;
163}