eos_s3/intr_ctrl/
fb_intr.rs

1#[doc = "Register `FB_INTR` reader"]
2pub struct R(crate::R<FB_INTR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FB_INTR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FB_INTR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FB_INTR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FB_INTR` writer"]
17pub struct W(crate::W<FB_INTR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FB_INTR_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_INTR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FB_INTR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `FB_0_INTR` reader - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
38pub struct FB_0_INTR_R(crate::FieldReader<bool, bool>);
39impl FB_0_INTR_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        FB_0_INTR_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for FB_0_INTR_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `FB_0_INTR` writer - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
53pub struct FB_0_INTR_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> FB_0_INTR_W<'a> {
57    #[doc = r"Sets the field bit"]
58    #[inline(always)]
59    pub fn set_bit(self) -> &'a mut W {
60        self.bit(true)
61    }
62    #[doc = r"Clears the field bit"]
63    #[inline(always)]
64    pub fn clear_bit(self) -> &'a mut W {
65        self.bit(false)
66    }
67    #[doc = r"Writes raw bits to the field"]
68    #[inline(always)]
69    pub fn bit(self, value: bool) -> &'a mut W {
70        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
71        self.w
72    }
73}
74#[doc = "Field `FB_1_INTR` reader - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
75pub struct FB_1_INTR_R(crate::FieldReader<bool, bool>);
76impl FB_1_INTR_R {
77    #[inline(always)]
78    pub(crate) fn new(bits: bool) -> Self {
79        FB_1_INTR_R(crate::FieldReader::new(bits))
80    }
81}
82impl core::ops::Deref for FB_1_INTR_R {
83    type Target = crate::FieldReader<bool, bool>;
84    #[inline(always)]
85    fn deref(&self) -> &Self::Target {
86        &self.0
87    }
88}
89#[doc = "Field `FB_1_INTR` writer - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
90pub struct FB_1_INTR_W<'a> {
91    w: &'a mut W,
92}
93impl<'a> FB_1_INTR_W<'a> {
94    #[doc = r"Sets the field bit"]
95    #[inline(always)]
96    pub fn set_bit(self) -> &'a mut W {
97        self.bit(true)
98    }
99    #[doc = r"Clears the field bit"]
100    #[inline(always)]
101    pub fn clear_bit(self) -> &'a mut W {
102        self.bit(false)
103    }
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub fn bit(self, value: bool) -> &'a mut W {
107        self.w.bits =
108            (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
109        self.w
110    }
111}
112#[doc = "Field `FB_2_INTR` reader - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
113pub struct FB_2_INTR_R(crate::FieldReader<bool, bool>);
114impl FB_2_INTR_R {
115    #[inline(always)]
116    pub(crate) fn new(bits: bool) -> Self {
117        FB_2_INTR_R(crate::FieldReader::new(bits))
118    }
119}
120impl core::ops::Deref for FB_2_INTR_R {
121    type Target = crate::FieldReader<bool, bool>;
122    #[inline(always)]
123    fn deref(&self) -> &Self::Target {
124        &self.0
125    }
126}
127#[doc = "Field `FB_2_INTR` writer - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
128pub struct FB_2_INTR_W<'a> {
129    w: &'a mut W,
130}
131impl<'a> FB_2_INTR_W<'a> {
132    #[doc = r"Sets the field bit"]
133    #[inline(always)]
134    pub fn set_bit(self) -> &'a mut W {
135        self.bit(true)
136    }
137    #[doc = r"Clears the field bit"]
138    #[inline(always)]
139    pub fn clear_bit(self) -> &'a mut W {
140        self.bit(false)
141    }
142    #[doc = r"Writes raw bits to the field"]
143    #[inline(always)]
144    pub fn bit(self, value: bool) -> &'a mut W {
145        self.w.bits =
146            (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
147        self.w
148    }
149}
150#[doc = "Field `FB_3_INTR` reader - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
151pub struct FB_3_INTR_R(crate::FieldReader<bool, bool>);
152impl FB_3_INTR_R {
153    #[inline(always)]
154    pub(crate) fn new(bits: bool) -> Self {
155        FB_3_INTR_R(crate::FieldReader::new(bits))
156    }
157}
158impl core::ops::Deref for FB_3_INTR_R {
159    type Target = crate::FieldReader<bool, bool>;
160    #[inline(always)]
161    fn deref(&self) -> &Self::Target {
162        &self.0
163    }
164}
165#[doc = "Field `FB_3_INTR` writer - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
166pub struct FB_3_INTR_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> FB_3_INTR_W<'a> {
170    #[doc = r"Sets the field bit"]
171    #[inline(always)]
172    pub fn set_bit(self) -> &'a mut W {
173        self.bit(true)
174    }
175    #[doc = r"Clears the field bit"]
176    #[inline(always)]
177    pub fn clear_bit(self) -> &'a mut W {
178        self.bit(false)
179    }
180    #[doc = r"Writes raw bits to the field"]
181    #[inline(always)]
182    pub fn bit(self, value: bool) -> &'a mut W {
183        self.w.bits =
184            (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
185        self.w
186    }
187}
188impl R {
189    #[doc = "Bit 0 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
190    #[inline(always)]
191    pub fn fb_0_intr(&self) -> FB_0_INTR_R {
192        FB_0_INTR_R::new((self.bits & 0x01) != 0)
193    }
194    #[doc = "Bit 1 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
195    #[inline(always)]
196    pub fn fb_1_intr(&self) -> FB_1_INTR_R {
197        FB_1_INTR_R::new(((self.bits >> 1) & 0x01) != 0)
198    }
199    #[doc = "Bit 2 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
200    #[inline(always)]
201    pub fn fb_2_intr(&self) -> FB_2_INTR_R {
202        FB_2_INTR_R::new(((self.bits >> 2) & 0x01) != 0)
203    }
204    #[doc = "Bit 3 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
205    #[inline(always)]
206    pub fn fb_3_intr(&self) -> FB_3_INTR_R {
207        FB_3_INTR_R::new(((self.bits >> 3) & 0x01) != 0)
208    }
209}
210impl W {
211    #[doc = "Bit 0 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
212    #[inline(always)]
213    pub fn fb_0_intr(&mut self) -> FB_0_INTR_W {
214        FB_0_INTR_W { w: self }
215    }
216    #[doc = "Bit 1 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
217    #[inline(always)]
218    pub fn fb_1_intr(&mut self) -> FB_1_INTR_W {
219        FB_1_INTR_W { w: self }
220    }
221    #[doc = "Bit 2 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
222    #[inline(always)]
223    pub fn fb_2_intr(&mut self) -> FB_2_INTR_W {
224        FB_2_INTR_W { w: self }
225    }
226    #[doc = "Bit 3 - Active high edge interrupt detected for Fabric. When interrupt type is selected as edge detect, this register will return high when triggered, write 1 to clear."]
227    #[inline(always)]
228    pub fn fb_3_intr(&mut self) -> FB_3_INTR_W {
229        FB_3_INTR_W { w: self }
230    }
231    #[doc = "Writes raw bits to the register."]
232    #[inline(always)]
233    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
234        self.0.bits(bits);
235        self
236    }
237}
238#[doc = "Indicators of interrupt triggers detected\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_intr](index.html) module"]
239pub struct FB_INTR_SPEC;
240impl crate::RegisterSpec for FB_INTR_SPEC {
241    type Ux = u32;
242}
243#[doc = "`read()` method returns [fb_intr::R](R) reader structure"]
244impl crate::Readable for FB_INTR_SPEC {
245    type Reader = R;
246}
247#[doc = "`write(|w| ..)` method takes [fb_intr::W](W) writer structure"]
248impl crate::Writable for FB_INTR_SPEC {
249    type Writer = W;
250}
251#[doc = "`reset()` method sets FB_INTR to value 0"]
252impl crate::Resettable for FB_INTR_SPEC {
253    #[inline(always)]
254    fn reset_value() -> Self::Ux {
255        0
256    }
257}