eos_s3/pmu/
ffe_fb_pf_sw_pd.rs1#[doc = "Register `FFE_FB_PF_SW_PD` reader"]
2pub struct R(crate::R<FFE_FB_PF_SW_PD_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<FFE_FB_PF_SW_PD_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<FFE_FB_PF_SW_PD_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<FFE_FB_PF_SW_PD_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `FFE_FB_PF_SW_PD` writer"]
17pub struct W(crate::W<FFE_FB_PF_SW_PD_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<FFE_FB_PF_SW_PD_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<FFE_FB_PF_SW_PD_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<FFE_FB_PF_SW_PD_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Set to trigger a power down event. Bit is cleared after power down sequence finishes\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum FFE_SOFTWARE_PD_A {
40 #[doc = "1: Put the power domain to power saving mode according to configuration setting, HW will clear it once power down sequence is finished."]
41 POWER_DOWN = 1,
42}
43impl From<FFE_SOFTWARE_PD_A> for bool {
44 #[inline(always)]
45 fn from(variant: FFE_SOFTWARE_PD_A) -> Self {
46 variant as u8 != 0
47 }
48}
49#[doc = "Field `FFE_Software_PD` reader - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
50pub struct FFE_SOFTWARE_PD_R(crate::FieldReader<bool, FFE_SOFTWARE_PD_A>);
51impl FFE_SOFTWARE_PD_R {
52 #[inline(always)]
53 pub(crate) fn new(bits: bool) -> Self {
54 FFE_SOFTWARE_PD_R(crate::FieldReader::new(bits))
55 }
56 #[doc = r"Get enumerated values variant"]
57 #[inline(always)]
58 pub fn variant(&self) -> Option<FFE_SOFTWARE_PD_A> {
59 match self.bits {
60 true => Some(FFE_SOFTWARE_PD_A::POWER_DOWN),
61 _ => None,
62 }
63 }
64 #[doc = "Checks if the value of the field is `POWER_DOWN`"]
65 #[inline(always)]
66 pub fn is_power_down(&self) -> bool {
67 **self == FFE_SOFTWARE_PD_A::POWER_DOWN
68 }
69}
70impl core::ops::Deref for FFE_SOFTWARE_PD_R {
71 type Target = crate::FieldReader<bool, FFE_SOFTWARE_PD_A>;
72 #[inline(always)]
73 fn deref(&self) -> &Self::Target {
74 &self.0
75 }
76}
77#[doc = "Field `FFE_Software_PD` writer - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
78pub struct FFE_SOFTWARE_PD_W<'a> {
79 w: &'a mut W,
80}
81impl<'a> FFE_SOFTWARE_PD_W<'a> {
82 #[doc = r"Writes `variant` to the field"]
83 #[inline(always)]
84 pub fn variant(self, variant: FFE_SOFTWARE_PD_A) -> &'a mut W {
85 self.bit(variant.into())
86 }
87 #[doc = "Put the power domain to power saving mode according to configuration setting, HW will clear it once power down sequence is finished."]
88 #[inline(always)]
89 pub fn power_down(self) -> &'a mut W {
90 self.variant(FFE_SOFTWARE_PD_A::POWER_DOWN)
91 }
92 #[doc = r"Sets the field bit"]
93 #[inline(always)]
94 pub fn set_bit(self) -> &'a mut W {
95 self.bit(true)
96 }
97 #[doc = r"Clears the field bit"]
98 #[inline(always)]
99 pub fn clear_bit(self) -> &'a mut W {
100 self.bit(false)
101 }
102 #[doc = r"Writes raw bits to the field"]
103 #[inline(always)]
104 pub fn bit(self, value: bool) -> &'a mut W {
105 self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
106 self.w
107 }
108}
109#[doc = "Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
110pub type FB_SOFTWARE_PD_A = FFE_SOFTWARE_PD_A;
111#[doc = "Field `FB_Software_PD` reader - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
112pub type FB_SOFTWARE_PD_R = FFE_SOFTWARE_PD_R;
113#[doc = "Field `FB_Software_PD` writer - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
114pub struct FB_SOFTWARE_PD_W<'a> {
115 w: &'a mut W,
116}
117impl<'a> FB_SOFTWARE_PD_W<'a> {
118 #[doc = r"Writes `variant` to the field"]
119 #[inline(always)]
120 pub fn variant(self, variant: FB_SOFTWARE_PD_A) -> &'a mut W {
121 self.bit(variant.into())
122 }
123 #[doc = "Put the power domain to power saving mode according to configuration setting, HW will clear it once power down sequence is finished."]
124 #[inline(always)]
125 pub fn power_down(self) -> &'a mut W {
126 self.variant(FB_SOFTWARE_PD_A::POWER_DOWN)
127 }
128 #[doc = r"Sets the field bit"]
129 #[inline(always)]
130 pub fn set_bit(self) -> &'a mut W {
131 self.bit(true)
132 }
133 #[doc = r"Clears the field bit"]
134 #[inline(always)]
135 pub fn clear_bit(self) -> &'a mut W {
136 self.bit(false)
137 }
138 #[doc = r"Writes raw bits to the field"]
139 #[inline(always)]
140 pub fn bit(self, value: bool) -> &'a mut W {
141 self.w.bits =
142 (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
143 self.w
144 }
145}
146#[doc = "Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
147pub type PF_SOFTWARE_PD_A = FFE_SOFTWARE_PD_A;
148#[doc = "Field `PF_Software_PD` reader - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
149pub type PF_SOFTWARE_PD_R = FFE_SOFTWARE_PD_R;
150#[doc = "Field `PF_Software_PD` writer - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
151pub struct PF_SOFTWARE_PD_W<'a> {
152 w: &'a mut W,
153}
154impl<'a> PF_SOFTWARE_PD_W<'a> {
155 #[doc = r"Writes `variant` to the field"]
156 #[inline(always)]
157 pub fn variant(self, variant: PF_SOFTWARE_PD_A) -> &'a mut W {
158 self.bit(variant.into())
159 }
160 #[doc = "Put the power domain to power saving mode according to configuration setting, HW will clear it once power down sequence is finished."]
161 #[inline(always)]
162 pub fn power_down(self) -> &'a mut W {
163 self.variant(PF_SOFTWARE_PD_A::POWER_DOWN)
164 }
165 #[doc = r"Sets the field bit"]
166 #[inline(always)]
167 pub fn set_bit(self) -> &'a mut W {
168 self.bit(true)
169 }
170 #[doc = r"Clears the field bit"]
171 #[inline(always)]
172 pub fn clear_bit(self) -> &'a mut W {
173 self.bit(false)
174 }
175 #[doc = r"Writes raw bits to the field"]
176 #[inline(always)]
177 pub fn bit(self, value: bool) -> &'a mut W {
178 self.w.bits =
179 (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
180 self.w
181 }
182}
183impl R {
184 #[doc = "Bit 0 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
185 #[inline(always)]
186 pub fn ffe_software_pd(&self) -> FFE_SOFTWARE_PD_R {
187 FFE_SOFTWARE_PD_R::new((self.bits & 0x01) != 0)
188 }
189 #[doc = "Bit 1 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
190 #[inline(always)]
191 pub fn fb_software_pd(&self) -> FB_SOFTWARE_PD_R {
192 FB_SOFTWARE_PD_R::new(((self.bits >> 1) & 0x01) != 0)
193 }
194 #[doc = "Bit 2 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
195 #[inline(always)]
196 pub fn pf_software_pd(&self) -> PF_SOFTWARE_PD_R {
197 PF_SOFTWARE_PD_R::new(((self.bits >> 2) & 0x01) != 0)
198 }
199}
200impl W {
201 #[doc = "Bit 0 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
202 #[inline(always)]
203 pub fn ffe_software_pd(&mut self) -> FFE_SOFTWARE_PD_W {
204 FFE_SOFTWARE_PD_W { w: self }
205 }
206 #[doc = "Bit 1 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
207 #[inline(always)]
208 pub fn fb_software_pd(&mut self) -> FB_SOFTWARE_PD_W {
209 FB_SOFTWARE_PD_W { w: self }
210 }
211 #[doc = "Bit 2 - Set to trigger a power down event. Bit is cleared after power down sequence finishes"]
212 #[inline(always)]
213 pub fn pf_software_pd(&mut self) -> PF_SOFTWARE_PD_W {
214 PF_SOFTWARE_PD_W { w: self }
215 }
216 #[doc = "Writes raw bits to the register."]
217 #[inline(always)]
218 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
219 self.0.bits(bits);
220 self
221 }
222}
223#[doc = "Registers for triggering power-down events in the FFE, FB and PF power domains.\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 [ffe_fb_pf_sw_pd](index.html) module"]
224pub struct FFE_FB_PF_SW_PD_SPEC;
225impl crate::RegisterSpec for FFE_FB_PF_SW_PD_SPEC {
226 type Ux = u32;
227}
228#[doc = "`read()` method returns [ffe_fb_pf_sw_pd::R](R) reader structure"]
229impl crate::Readable for FFE_FB_PF_SW_PD_SPEC {
230 type Reader = R;
231}
232#[doc = "`write(|w| ..)` method takes [ffe_fb_pf_sw_pd::W](W) writer structure"]
233impl crate::Writable for FFE_FB_PF_SW_PD_SPEC {
234 type Writer = W;
235}
236#[doc = "`reset()` method sets FFE_FB_PF_SW_PD to value 0"]
237impl crate::Resettable for FFE_FB_PF_SW_PD_SPEC {
238 #[inline(always)]
239 fn reset_value() -> Self::Ux {
240 0
241 }
242}