eos_s3/pkfb/
pkfb_fifo_coll_intr_en.rs1#[doc = "Register `PKFB_FIFO_COLL_INTR_EN` reader"]
2pub struct R(crate::R<PKFB_FIFO_COLL_INTR_EN_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PKFB_FIFO_COLL_INTR_EN_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PKFB_FIFO_COLL_INTR_EN_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PKFB_FIFO_COLL_INTR_EN_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PKFB_FIFO_COLL_INTR_EN` writer"]
17pub struct W(crate::W<PKFB_FIFO_COLL_INTR_EN_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PKFB_FIFO_COLL_INTR_EN_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<PKFB_FIFO_COLL_INTR_EN_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PKFB_FIFO_COLL_INTR_EN_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Set bit to enable interrupt\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum PF0_COLL_INTR_EN_A {
40 #[doc = "0: Mask the interrupt event"]
41 MASK = 0,
42 #[doc = "1: Unmask the interrupt event"]
43 UNMASK = 1,
44}
45impl From<PF0_COLL_INTR_EN_A> for bool {
46 #[inline(always)]
47 fn from(variant: PF0_COLL_INTR_EN_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `pf0_coll_intr_en` reader - Set bit to enable interrupt"]
52pub struct PF0_COLL_INTR_EN_R(crate::FieldReader<bool, PF0_COLL_INTR_EN_A>);
53impl PF0_COLL_INTR_EN_R {
54 #[inline(always)]
55 pub(crate) fn new(bits: bool) -> Self {
56 PF0_COLL_INTR_EN_R(crate::FieldReader::new(bits))
57 }
58 #[doc = r"Get enumerated values variant"]
59 #[inline(always)]
60 pub fn variant(&self) -> PF0_COLL_INTR_EN_A {
61 match self.bits {
62 false => PF0_COLL_INTR_EN_A::MASK,
63 true => PF0_COLL_INTR_EN_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 == PF0_COLL_INTR_EN_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 == PF0_COLL_INTR_EN_A::UNMASK
75 }
76}
77impl core::ops::Deref for PF0_COLL_INTR_EN_R {
78 type Target = crate::FieldReader<bool, PF0_COLL_INTR_EN_A>;
79 #[inline(always)]
80 fn deref(&self) -> &Self::Target {
81 &self.0
82 }
83}
84#[doc = "Field `pf0_coll_intr_en` writer - Set bit to enable interrupt"]
85pub struct PF0_COLL_INTR_EN_W<'a> {
86 w: &'a mut W,
87}
88impl<'a> PF0_COLL_INTR_EN_W<'a> {
89 #[doc = r"Writes `variant` to the field"]
90 #[inline(always)]
91 pub fn variant(self, variant: PF0_COLL_INTR_EN_A) -> &'a mut W {
92 self.bit(variant.into())
93 }
94 #[doc = "Mask the interrupt event"]
95 #[inline(always)]
96 pub fn mask(self) -> &'a mut W {
97 self.variant(PF0_COLL_INTR_EN_A::MASK)
98 }
99 #[doc = "Unmask the interrupt event"]
100 #[inline(always)]
101 pub fn unmask(self) -> &'a mut W {
102 self.variant(PF0_COLL_INTR_EN_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 = (self.w.bits & !0x01) | (value as u32 & 0x01);
118 self.w
119 }
120}
121#[doc = "Set bit to enable interrupt"]
122pub type PF1_COLL_INTR_EN_A = PF0_COLL_INTR_EN_A;
123#[doc = "Field `pf1_coll_intr_en` reader - Set bit to enable interrupt"]
124pub type PF1_COLL_INTR_EN_R = PF0_COLL_INTR_EN_R;
125#[doc = "Field `pf1_coll_intr_en` writer - Set bit to enable interrupt"]
126pub struct PF1_COLL_INTR_EN_W<'a> {
127 w: &'a mut W,
128}
129impl<'a> PF1_COLL_INTR_EN_W<'a> {
130 #[doc = r"Writes `variant` to the field"]
131 #[inline(always)]
132 pub fn variant(self, variant: PF1_COLL_INTR_EN_A) -> &'a mut W {
133 self.bit(variant.into())
134 }
135 #[doc = "Mask the interrupt event"]
136 #[inline(always)]
137 pub fn mask(self) -> &'a mut W {
138 self.variant(PF1_COLL_INTR_EN_A::MASK)
139 }
140 #[doc = "Unmask the interrupt event"]
141 #[inline(always)]
142 pub fn unmask(self) -> &'a mut W {
143 self.variant(PF1_COLL_INTR_EN_A::UNMASK)
144 }
145 #[doc = r"Sets the field bit"]
146 #[inline(always)]
147 pub fn set_bit(self) -> &'a mut W {
148 self.bit(true)
149 }
150 #[doc = r"Clears the field bit"]
151 #[inline(always)]
152 pub fn clear_bit(self) -> &'a mut W {
153 self.bit(false)
154 }
155 #[doc = r"Writes raw bits to the field"]
156 #[inline(always)]
157 pub fn bit(self, value: bool) -> &'a mut W {
158 self.w.bits =
159 (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
160 self.w
161 }
162}
163#[doc = "Set bit to enable interrupt"]
164pub type PF2_COLL_INTR_EN_A = PF0_COLL_INTR_EN_A;
165#[doc = "Field `pf2_coll_intr_en` reader - Set bit to enable interrupt"]
166pub type PF2_COLL_INTR_EN_R = PF0_COLL_INTR_EN_R;
167#[doc = "Field `pf2_coll_intr_en` writer - Set bit to enable interrupt"]
168pub struct PF2_COLL_INTR_EN_W<'a> {
169 w: &'a mut W,
170}
171impl<'a> PF2_COLL_INTR_EN_W<'a> {
172 #[doc = r"Writes `variant` to the field"]
173 #[inline(always)]
174 pub fn variant(self, variant: PF2_COLL_INTR_EN_A) -> &'a mut W {
175 self.bit(variant.into())
176 }
177 #[doc = "Mask the interrupt event"]
178 #[inline(always)]
179 pub fn mask(self) -> &'a mut W {
180 self.variant(PF2_COLL_INTR_EN_A::MASK)
181 }
182 #[doc = "Unmask the interrupt event"]
183 #[inline(always)]
184 pub fn unmask(self) -> &'a mut W {
185 self.variant(PF2_COLL_INTR_EN_A::UNMASK)
186 }
187 #[doc = r"Sets the field bit"]
188 #[inline(always)]
189 pub fn set_bit(self) -> &'a mut W {
190 self.bit(true)
191 }
192 #[doc = r"Clears the field bit"]
193 #[inline(always)]
194 pub fn clear_bit(self) -> &'a mut W {
195 self.bit(false)
196 }
197 #[doc = r"Writes raw bits to the field"]
198 #[inline(always)]
199 pub fn bit(self, value: bool) -> &'a mut W {
200 self.w.bits =
201 (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
202 self.w
203 }
204}
205#[doc = "Set bit to enable interrupt"]
206pub type PF8K_COLL_INTR_EN_A = PF0_COLL_INTR_EN_A;
207#[doc = "Field `pf8k_coll_intr_en` reader - Set bit to enable interrupt"]
208pub type PF8K_COLL_INTR_EN_R = PF0_COLL_INTR_EN_R;
209#[doc = "Field `pf8k_coll_intr_en` writer - Set bit to enable interrupt"]
210pub struct PF8K_COLL_INTR_EN_W<'a> {
211 w: &'a mut W,
212}
213impl<'a> PF8K_COLL_INTR_EN_W<'a> {
214 #[doc = r"Writes `variant` to the field"]
215 #[inline(always)]
216 pub fn variant(self, variant: PF8K_COLL_INTR_EN_A) -> &'a mut W {
217 self.bit(variant.into())
218 }
219 #[doc = "Mask the interrupt event"]
220 #[inline(always)]
221 pub fn mask(self) -> &'a mut W {
222 self.variant(PF8K_COLL_INTR_EN_A::MASK)
223 }
224 #[doc = "Unmask the interrupt event"]
225 #[inline(always)]
226 pub fn unmask(self) -> &'a mut W {
227 self.variant(PF8K_COLL_INTR_EN_A::UNMASK)
228 }
229 #[doc = r"Sets the field bit"]
230 #[inline(always)]
231 pub fn set_bit(self) -> &'a mut W {
232 self.bit(true)
233 }
234 #[doc = r"Clears the field bit"]
235 #[inline(always)]
236 pub fn clear_bit(self) -> &'a mut W {
237 self.bit(false)
238 }
239 #[doc = r"Writes raw bits to the field"]
240 #[inline(always)]
241 pub fn bit(self, value: bool) -> &'a mut W {
242 self.w.bits =
243 (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
244 self.w
245 }
246}
247impl R {
248 #[doc = "Bit 0 - Set bit to enable interrupt"]
249 #[inline(always)]
250 pub fn pf0_coll_intr_en(&self) -> PF0_COLL_INTR_EN_R {
251 PF0_COLL_INTR_EN_R::new((self.bits & 0x01) != 0)
252 }
253 #[doc = "Bit 1 - Set bit to enable interrupt"]
254 #[inline(always)]
255 pub fn pf1_coll_intr_en(&self) -> PF1_COLL_INTR_EN_R {
256 PF1_COLL_INTR_EN_R::new(((self.bits >> 1) & 0x01) != 0)
257 }
258 #[doc = "Bit 2 - Set bit to enable interrupt"]
259 #[inline(always)]
260 pub fn pf2_coll_intr_en(&self) -> PF2_COLL_INTR_EN_R {
261 PF2_COLL_INTR_EN_R::new(((self.bits >> 2) & 0x01) != 0)
262 }
263 #[doc = "Bit 3 - Set bit to enable interrupt"]
264 #[inline(always)]
265 pub fn pf8k_coll_intr_en(&self) -> PF8K_COLL_INTR_EN_R {
266 PF8K_COLL_INTR_EN_R::new(((self.bits >> 3) & 0x01) != 0)
267 }
268}
269impl W {
270 #[doc = "Bit 0 - Set bit to enable interrupt"]
271 #[inline(always)]
272 pub fn pf0_coll_intr_en(&mut self) -> PF0_COLL_INTR_EN_W {
273 PF0_COLL_INTR_EN_W { w: self }
274 }
275 #[doc = "Bit 1 - Set bit to enable interrupt"]
276 #[inline(always)]
277 pub fn pf1_coll_intr_en(&mut self) -> PF1_COLL_INTR_EN_W {
278 PF1_COLL_INTR_EN_W { w: self }
279 }
280 #[doc = "Bit 2 - Set bit to enable interrupt"]
281 #[inline(always)]
282 pub fn pf2_coll_intr_en(&mut self) -> PF2_COLL_INTR_EN_W {
283 PF2_COLL_INTR_EN_W { w: self }
284 }
285 #[doc = "Bit 3 - Set bit to enable interrupt"]
286 #[inline(always)]
287 pub fn pf8k_coll_intr_en(&mut self) -> PF8K_COLL_INTR_EN_W {
288 PF8K_COLL_INTR_EN_W { w: self }
289 }
290 #[doc = "Writes raw bits to the register."]
291 #[inline(always)]
292 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
293 self.0.bits(bits);
294 self
295 }
296}
297#[doc = "Control register for enabling or masking the collisione interrupts\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 [pkfb_fifo_coll_intr_en](index.html) module"]
298pub struct PKFB_FIFO_COLL_INTR_EN_SPEC;
299impl crate::RegisterSpec for PKFB_FIFO_COLL_INTR_EN_SPEC {
300 type Ux = u32;
301}
302#[doc = "`read()` method returns [pkfb_fifo_coll_intr_en::R](R) reader structure"]
303impl crate::Readable for PKFB_FIFO_COLL_INTR_EN_SPEC {
304 type Reader = R;
305}
306#[doc = "`write(|w| ..)` method takes [pkfb_fifo_coll_intr_en::W](W) writer structure"]
307impl crate::Writable for PKFB_FIFO_COLL_INTR_EN_SPEC {
308 type Writer = W;
309}
310#[doc = "`reset()` method sets PKFB_FIFO_COLL_INTR_EN to value 0"]
311impl crate::Resettable for PKFB_FIFO_COLL_INTR_EN_SPEC {
312 #[inline(always)]
313 fn reset_value() -> Self::Ux {
314 0
315 }
316}