eos_s3/pmu/
fb_pd_src_mask_n.rs1#[doc = "Register `FB_PD_SRC_MASK_N` reader"]
2pub struct R(crate::R<FB_PD_SRC_MASK_N_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<FB_PD_SRC_MASK_N_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<FB_PD_SRC_MASK_N_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<FB_PD_SRC_MASK_N_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `FB_PD_SRC_MASK_N` writer"]
17pub struct W(crate::W<FB_PD_SRC_MASK_N_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<FB_PD_SRC_MASK_N_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<FB_PD_SRC_MASK_N_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<FB_PD_SRC_MASK_N_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Control the mask for the Interface Signal 0\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum INTERFACE_SIGNAL_0_A {
40 #[doc = "0: Mask the signal as a power-down event source"]
41 MASK = 0,
42 #[doc = "1: Unmask the signal as a power-down event source"]
43 UNMASK = 1,
44}
45impl From<INTERFACE_SIGNAL_0_A> for bool {
46 #[inline(always)]
47 fn from(variant: INTERFACE_SIGNAL_0_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `Interface_Signal_0` reader - Control the mask for the Interface Signal 0"]
52pub struct INTERFACE_SIGNAL_0_R(crate::FieldReader<bool, INTERFACE_SIGNAL_0_A>);
53impl INTERFACE_SIGNAL_0_R {
54 #[inline(always)]
55 pub(crate) fn new(bits: bool) -> Self {
56 INTERFACE_SIGNAL_0_R(crate::FieldReader::new(bits))
57 }
58 #[doc = r"Get enumerated values variant"]
59 #[inline(always)]
60 pub fn variant(&self) -> INTERFACE_SIGNAL_0_A {
61 match self.bits {
62 false => INTERFACE_SIGNAL_0_A::MASK,
63 true => INTERFACE_SIGNAL_0_A::UNMASK,
64 }
65 }
66 #[doc = "Checks if the value of the field is `MASK`"]
67 #[inline(always)]
68 pub fn is_mask(&self) -> bool {
69 **self == INTERFACE_SIGNAL_0_A::MASK
70 }
71 #[doc = "Checks if the value of the field is `UNMASK`"]
72 #[inline(always)]
73 pub fn is_unmask(&self) -> bool {
74 **self == INTERFACE_SIGNAL_0_A::UNMASK
75 }
76}
77impl core::ops::Deref for INTERFACE_SIGNAL_0_R {
78 type Target = crate::FieldReader<bool, INTERFACE_SIGNAL_0_A>;
79 #[inline(always)]
80 fn deref(&self) -> &Self::Target {
81 &self.0
82 }
83}
84#[doc = "Field `Interface_Signal_0` writer - Control the mask for the Interface Signal 0"]
85pub struct INTERFACE_SIGNAL_0_W<'a> {
86 w: &'a mut W,
87}
88impl<'a> INTERFACE_SIGNAL_0_W<'a> {
89 #[doc = r"Writes `variant` to the field"]
90 #[inline(always)]
91 pub fn variant(self, variant: INTERFACE_SIGNAL_0_A) -> &'a mut W {
92 self.bit(variant.into())
93 }
94 #[doc = "Mask the signal as a power-down event source"]
95 #[inline(always)]
96 pub fn mask(self) -> &'a mut W {
97 self.variant(INTERFACE_SIGNAL_0_A::MASK)
98 }
99 #[doc = "Unmask the signal as a power-down event source"]
100 #[inline(always)]
101 pub fn unmask(self) -> &'a mut W {
102 self.variant(INTERFACE_SIGNAL_0_A::UNMASK)
103 }
104 #[doc = r"Sets the field bit"]
105 #[inline(always)]
106 pub fn set_bit(self) -> &'a mut W {
107 self.bit(true)
108 }
109 #[doc = r"Clears the field bit"]
110 #[inline(always)]
111 pub fn clear_bit(self) -> &'a mut W {
112 self.bit(false)
113 }
114 #[doc = r"Writes raw bits to the field"]
115 #[inline(always)]
116 pub fn bit(self, value: bool) -> &'a mut W {
117 self.w.bits =
118 (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
119 self.w
120 }
121}
122#[doc = "Control the mask for the Interface Signal 1"]
123pub type INTERFACE_SIGNAL_1_A = INTERFACE_SIGNAL_0_A;
124#[doc = "Field `Interface_Signal_1` reader - Control the mask for the Interface Signal 1"]
125pub type INTERFACE_SIGNAL_1_R = INTERFACE_SIGNAL_0_R;
126#[doc = "Field `Interface_Signal_1` writer - Control the mask for the Interface Signal 1"]
127pub struct INTERFACE_SIGNAL_1_W<'a> {
128 w: &'a mut W,
129}
130impl<'a> INTERFACE_SIGNAL_1_W<'a> {
131 #[doc = r"Writes `variant` to the field"]
132 #[inline(always)]
133 pub fn variant(self, variant: INTERFACE_SIGNAL_1_A) -> &'a mut W {
134 self.bit(variant.into())
135 }
136 #[doc = "Mask the signal as a power-down event source"]
137 #[inline(always)]
138 pub fn mask(self) -> &'a mut W {
139 self.variant(INTERFACE_SIGNAL_1_A::MASK)
140 }
141 #[doc = "Unmask the signal as a power-down event source"]
142 #[inline(always)]
143 pub fn unmask(self) -> &'a mut W {
144 self.variant(INTERFACE_SIGNAL_1_A::UNMASK)
145 }
146 #[doc = r"Sets the field bit"]
147 #[inline(always)]
148 pub fn set_bit(self) -> &'a mut W {
149 self.bit(true)
150 }
151 #[doc = r"Clears the field bit"]
152 #[inline(always)]
153 pub fn clear_bit(self) -> &'a mut W {
154 self.bit(false)
155 }
156 #[doc = r"Writes raw bits to the field"]
157 #[inline(always)]
158 pub fn bit(self, value: bool) -> &'a mut W {
159 self.w.bits =
160 (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
161 self.w
162 }
163}
164#[doc = "Control the mask for the Interface Signal 2"]
165pub type INTERFACE_SIGNAL_2_A = INTERFACE_SIGNAL_0_A;
166#[doc = "Field `Interface_Signal_2` reader - Control the mask for the Interface Signal 2"]
167pub type INTERFACE_SIGNAL_2_R = INTERFACE_SIGNAL_0_R;
168#[doc = "Field `Interface_Signal_2` writer - Control the mask for the Interface Signal 2"]
169pub struct INTERFACE_SIGNAL_2_W<'a> {
170 w: &'a mut W,
171}
172impl<'a> INTERFACE_SIGNAL_2_W<'a> {
173 #[doc = r"Writes `variant` to the field"]
174 #[inline(always)]
175 pub fn variant(self, variant: INTERFACE_SIGNAL_2_A) -> &'a mut W {
176 self.bit(variant.into())
177 }
178 #[doc = "Mask the signal as a power-down event source"]
179 #[inline(always)]
180 pub fn mask(self) -> &'a mut W {
181 self.variant(INTERFACE_SIGNAL_2_A::MASK)
182 }
183 #[doc = "Unmask the signal as a power-down event source"]
184 #[inline(always)]
185 pub fn unmask(self) -> &'a mut W {
186 self.variant(INTERFACE_SIGNAL_2_A::UNMASK)
187 }
188 #[doc = r"Sets the field bit"]
189 #[inline(always)]
190 pub fn set_bit(self) -> &'a mut W {
191 self.bit(true)
192 }
193 #[doc = r"Clears the field bit"]
194 #[inline(always)]
195 pub fn clear_bit(self) -> &'a mut W {
196 self.bit(false)
197 }
198 #[doc = r"Writes raw bits to the field"]
199 #[inline(always)]
200 pub fn bit(self, value: bool) -> &'a mut W {
201 self.w.bits =
202 (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
203 self.w
204 }
205}
206#[doc = "Control the mask for the Interface Signal 3"]
207pub type INTERFACE_SIGNAL_3_A = INTERFACE_SIGNAL_0_A;
208#[doc = "Field `Interface_Signal_3` reader - Control the mask for the Interface Signal 3"]
209pub type INTERFACE_SIGNAL_3_R = INTERFACE_SIGNAL_0_R;
210#[doc = "Field `Interface_Signal_3` writer - Control the mask for the Interface Signal 3"]
211pub struct INTERFACE_SIGNAL_3_W<'a> {
212 w: &'a mut W,
213}
214impl<'a> INTERFACE_SIGNAL_3_W<'a> {
215 #[doc = r"Writes `variant` to the field"]
216 #[inline(always)]
217 pub fn variant(self, variant: INTERFACE_SIGNAL_3_A) -> &'a mut W {
218 self.bit(variant.into())
219 }
220 #[doc = "Mask the signal as a power-down event source"]
221 #[inline(always)]
222 pub fn mask(self) -> &'a mut W {
223 self.variant(INTERFACE_SIGNAL_3_A::MASK)
224 }
225 #[doc = "Unmask the signal as a power-down event source"]
226 #[inline(always)]
227 pub fn unmask(self) -> &'a mut W {
228 self.variant(INTERFACE_SIGNAL_3_A::UNMASK)
229 }
230 #[doc = r"Sets the field bit"]
231 #[inline(always)]
232 pub fn set_bit(self) -> &'a mut W {
233 self.bit(true)
234 }
235 #[doc = r"Clears the field bit"]
236 #[inline(always)]
237 pub fn clear_bit(self) -> &'a mut W {
238 self.bit(false)
239 }
240 #[doc = r"Writes raw bits to the field"]
241 #[inline(always)]
242 pub fn bit(self, value: bool) -> &'a mut W {
243 self.w.bits =
244 (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
245 self.w
246 }
247}
248impl R {
249 #[doc = "Bit 1 - Control the mask for the Interface Signal 0"]
250 #[inline(always)]
251 pub fn interface_signal_0(&self) -> INTERFACE_SIGNAL_0_R {
252 INTERFACE_SIGNAL_0_R::new(((self.bits >> 1) & 0x01) != 0)
253 }
254 #[doc = "Bit 2 - Control the mask for the Interface Signal 1"]
255 #[inline(always)]
256 pub fn interface_signal_1(&self) -> INTERFACE_SIGNAL_1_R {
257 INTERFACE_SIGNAL_1_R::new(((self.bits >> 2) & 0x01) != 0)
258 }
259 #[doc = "Bit 3 - Control the mask for the Interface Signal 2"]
260 #[inline(always)]
261 pub fn interface_signal_2(&self) -> INTERFACE_SIGNAL_2_R {
262 INTERFACE_SIGNAL_2_R::new(((self.bits >> 3) & 0x01) != 0)
263 }
264 #[doc = "Bit 4 - Control the mask for the Interface Signal 3"]
265 #[inline(always)]
266 pub fn interface_signal_3(&self) -> INTERFACE_SIGNAL_3_R {
267 INTERFACE_SIGNAL_3_R::new(((self.bits >> 4) & 0x01) != 0)
268 }
269}
270impl W {
271 #[doc = "Bit 1 - Control the mask for the Interface Signal 0"]
272 #[inline(always)]
273 pub fn interface_signal_0(&mut self) -> INTERFACE_SIGNAL_0_W {
274 INTERFACE_SIGNAL_0_W { w: self }
275 }
276 #[doc = "Bit 2 - Control the mask for the Interface Signal 1"]
277 #[inline(always)]
278 pub fn interface_signal_1(&mut self) -> INTERFACE_SIGNAL_1_W {
279 INTERFACE_SIGNAL_1_W { w: self }
280 }
281 #[doc = "Bit 3 - Control the mask for the Interface Signal 2"]
282 #[inline(always)]
283 pub fn interface_signal_2(&mut self) -> INTERFACE_SIGNAL_2_W {
284 INTERFACE_SIGNAL_2_W { w: self }
285 }
286 #[doc = "Bit 4 - Control the mask for the Interface Signal 3"]
287 #[inline(always)]
288 pub fn interface_signal_3(&mut self) -> INTERFACE_SIGNAL_3_W {
289 INTERFACE_SIGNAL_3_W { w: self }
290 }
291 #[doc = "Writes raw bits to the register."]
292 #[inline(always)]
293 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
294 self.0.bits(bits);
295 self
296 }
297}
298#[doc = "Control masking of power down event signals for the FPGA Fabric power domain. The falling edge of any of the listed signals (non-mask) will put the FB into Power saving mode base on the Power Mode Cfg. Note: These signals used to indicate the BUSY status, so they must be level signals.\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 [fb_pd_src_mask_n](index.html) module"]
299pub struct FB_PD_SRC_MASK_N_SPEC;
300impl crate::RegisterSpec for FB_PD_SRC_MASK_N_SPEC {
301 type Ux = u32;
302}
303#[doc = "`read()` method returns [fb_pd_src_mask_n::R](R) reader structure"]
304impl crate::Readable for FB_PD_SRC_MASK_N_SPEC {
305 type Reader = R;
306}
307#[doc = "`write(|w| ..)` method takes [fb_pd_src_mask_n::W](W) writer structure"]
308impl crate::Writable for FB_PD_SRC_MASK_N_SPEC {
309 type Writer = W;
310}
311#[doc = "`reset()` method sets FB_PD_SRC_MASK_N to value 0"]
312impl crate::Resettable for FB_PD_SRC_MASK_N_SPEC {
313 #[inline(always)]
314 fn reset_value() -> Self::Ux {
315 0
316 }
317}