mk66f18/enet/
eir.rs

1#[doc = "Reader of register EIR"]
2pub type R = crate::R<u32, super::EIR>;
3#[doc = "Writer for register EIR"]
4pub type W = crate::W<u32, super::EIR>;
5#[doc = "Register EIR `reset()`'s with value 0"]
6impl crate::ResetValue for super::EIR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `TS_TIMER`"]
14pub type TS_TIMER_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `TS_TIMER`"]
16pub struct TS_TIMER_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> TS_TIMER_W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
34        self.w
35    }
36}
37#[doc = "Reader of field `TS_AVAIL`"]
38pub type TS_AVAIL_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `TS_AVAIL`"]
40pub struct TS_AVAIL_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> TS_AVAIL_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
58        self.w
59    }
60}
61#[doc = "Reader of field `WAKEUP`"]
62pub type WAKEUP_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `WAKEUP`"]
64pub struct WAKEUP_W<'a> {
65    w: &'a mut W,
66}
67impl<'a> WAKEUP_W<'a> {
68    #[doc = r"Sets the field bit"]
69    #[inline(always)]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r"Clears the field bit"]
74    #[inline(always)]
75    pub fn clear_bit(self) -> &'a mut W {
76        self.bit(false)
77    }
78    #[doc = r"Writes raw bits to the field"]
79    #[inline(always)]
80    pub fn bit(self, value: bool) -> &'a mut W {
81        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
82        self.w
83    }
84}
85#[doc = "Reader of field `PLR`"]
86pub type PLR_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `PLR`"]
88pub struct PLR_W<'a> {
89    w: &'a mut W,
90}
91impl<'a> PLR_W<'a> {
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 << 18)) | (((value as u32) & 0x01) << 18);
106        self.w
107    }
108}
109#[doc = "Reader of field `UN`"]
110pub type UN_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `UN`"]
112pub struct UN_W<'a> {
113    w: &'a mut W,
114}
115impl<'a> UN_W<'a> {
116    #[doc = r"Sets the field bit"]
117    #[inline(always)]
118    pub fn set_bit(self) -> &'a mut W {
119        self.bit(true)
120    }
121    #[doc = r"Clears the field bit"]
122    #[inline(always)]
123    pub fn clear_bit(self) -> &'a mut W {
124        self.bit(false)
125    }
126    #[doc = r"Writes raw bits to the field"]
127    #[inline(always)]
128    pub fn bit(self, value: bool) -> &'a mut W {
129        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
130        self.w
131    }
132}
133#[doc = "Reader of field `RL`"]
134pub type RL_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `RL`"]
136pub struct RL_W<'a> {
137    w: &'a mut W,
138}
139impl<'a> RL_W<'a> {
140    #[doc = r"Sets the field bit"]
141    #[inline(always)]
142    pub fn set_bit(self) -> &'a mut W {
143        self.bit(true)
144    }
145    #[doc = r"Clears the field bit"]
146    #[inline(always)]
147    pub fn clear_bit(self) -> &'a mut W {
148        self.bit(false)
149    }
150    #[doc = r"Writes raw bits to the field"]
151    #[inline(always)]
152    pub fn bit(self, value: bool) -> &'a mut W {
153        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
154        self.w
155    }
156}
157#[doc = "Reader of field `LC`"]
158pub type LC_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `LC`"]
160pub struct LC_W<'a> {
161    w: &'a mut W,
162}
163impl<'a> LC_W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
178        self.w
179    }
180}
181#[doc = "Reader of field `EBERR`"]
182pub type EBERR_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `EBERR`"]
184pub struct EBERR_W<'a> {
185    w: &'a mut W,
186}
187impl<'a> EBERR_W<'a> {
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 = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
202        self.w
203    }
204}
205#[doc = "Reader of field `MII`"]
206pub type MII_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `MII`"]
208pub struct MII_W<'a> {
209    w: &'a mut W,
210}
211impl<'a> MII_W<'a> {
212    #[doc = r"Sets the field bit"]
213    #[inline(always)]
214    pub fn set_bit(self) -> &'a mut W {
215        self.bit(true)
216    }
217    #[doc = r"Clears the field bit"]
218    #[inline(always)]
219    pub fn clear_bit(self) -> &'a mut W {
220        self.bit(false)
221    }
222    #[doc = r"Writes raw bits to the field"]
223    #[inline(always)]
224    pub fn bit(self, value: bool) -> &'a mut W {
225        self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
226        self.w
227    }
228}
229#[doc = "Reader of field `RXB`"]
230pub type RXB_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `RXB`"]
232pub struct RXB_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> RXB_W<'a> {
236    #[doc = r"Sets the field bit"]
237    #[inline(always)]
238    pub fn set_bit(self) -> &'a mut W {
239        self.bit(true)
240    }
241    #[doc = r"Clears the field bit"]
242    #[inline(always)]
243    pub fn clear_bit(self) -> &'a mut W {
244        self.bit(false)
245    }
246    #[doc = r"Writes raw bits to the field"]
247    #[inline(always)]
248    pub fn bit(self, value: bool) -> &'a mut W {
249        self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
250        self.w
251    }
252}
253#[doc = "Reader of field `RXF`"]
254pub type RXF_R = crate::R<bool, bool>;
255#[doc = "Write proxy for field `RXF`"]
256pub struct RXF_W<'a> {
257    w: &'a mut W,
258}
259impl<'a> RXF_W<'a> {
260    #[doc = r"Sets the field bit"]
261    #[inline(always)]
262    pub fn set_bit(self) -> &'a mut W {
263        self.bit(true)
264    }
265    #[doc = r"Clears the field bit"]
266    #[inline(always)]
267    pub fn clear_bit(self) -> &'a mut W {
268        self.bit(false)
269    }
270    #[doc = r"Writes raw bits to the field"]
271    #[inline(always)]
272    pub fn bit(self, value: bool) -> &'a mut W {
273        self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25);
274        self.w
275    }
276}
277#[doc = "Reader of field `TXB`"]
278pub type TXB_R = crate::R<bool, bool>;
279#[doc = "Write proxy for field `TXB`"]
280pub struct TXB_W<'a> {
281    w: &'a mut W,
282}
283impl<'a> TXB_W<'a> {
284    #[doc = r"Sets the field bit"]
285    #[inline(always)]
286    pub fn set_bit(self) -> &'a mut W {
287        self.bit(true)
288    }
289    #[doc = r"Clears the field bit"]
290    #[inline(always)]
291    pub fn clear_bit(self) -> &'a mut W {
292        self.bit(false)
293    }
294    #[doc = r"Writes raw bits to the field"]
295    #[inline(always)]
296    pub fn bit(self, value: bool) -> &'a mut W {
297        self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
298        self.w
299    }
300}
301#[doc = "Reader of field `TXF`"]
302pub type TXF_R = crate::R<bool, bool>;
303#[doc = "Write proxy for field `TXF`"]
304pub struct TXF_W<'a> {
305    w: &'a mut W,
306}
307impl<'a> TXF_W<'a> {
308    #[doc = r"Sets the field bit"]
309    #[inline(always)]
310    pub fn set_bit(self) -> &'a mut W {
311        self.bit(true)
312    }
313    #[doc = r"Clears the field bit"]
314    #[inline(always)]
315    pub fn clear_bit(self) -> &'a mut W {
316        self.bit(false)
317    }
318    #[doc = r"Writes raw bits to the field"]
319    #[inline(always)]
320    pub fn bit(self, value: bool) -> &'a mut W {
321        self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
322        self.w
323    }
324}
325#[doc = "Reader of field `GRA`"]
326pub type GRA_R = crate::R<bool, bool>;
327#[doc = "Write proxy for field `GRA`"]
328pub struct GRA_W<'a> {
329    w: &'a mut W,
330}
331impl<'a> GRA_W<'a> {
332    #[doc = r"Sets the field bit"]
333    #[inline(always)]
334    pub fn set_bit(self) -> &'a mut W {
335        self.bit(true)
336    }
337    #[doc = r"Clears the field bit"]
338    #[inline(always)]
339    pub fn clear_bit(self) -> &'a mut W {
340        self.bit(false)
341    }
342    #[doc = r"Writes raw bits to the field"]
343    #[inline(always)]
344    pub fn bit(self, value: bool) -> &'a mut W {
345        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
346        self.w
347    }
348}
349#[doc = "Reader of field `BABT`"]
350pub type BABT_R = crate::R<bool, bool>;
351#[doc = "Write proxy for field `BABT`"]
352pub struct BABT_W<'a> {
353    w: &'a mut W,
354}
355impl<'a> BABT_W<'a> {
356    #[doc = r"Sets the field bit"]
357    #[inline(always)]
358    pub fn set_bit(self) -> &'a mut W {
359        self.bit(true)
360    }
361    #[doc = r"Clears the field bit"]
362    #[inline(always)]
363    pub fn clear_bit(self) -> &'a mut W {
364        self.bit(false)
365    }
366    #[doc = r"Writes raw bits to the field"]
367    #[inline(always)]
368    pub fn bit(self, value: bool) -> &'a mut W {
369        self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
370        self.w
371    }
372}
373#[doc = "Reader of field `BABR`"]
374pub type BABR_R = crate::R<bool, bool>;
375#[doc = "Write proxy for field `BABR`"]
376pub struct BABR_W<'a> {
377    w: &'a mut W,
378}
379impl<'a> BABR_W<'a> {
380    #[doc = r"Sets the field bit"]
381    #[inline(always)]
382    pub fn set_bit(self) -> &'a mut W {
383        self.bit(true)
384    }
385    #[doc = r"Clears the field bit"]
386    #[inline(always)]
387    pub fn clear_bit(self) -> &'a mut W {
388        self.bit(false)
389    }
390    #[doc = r"Writes raw bits to the field"]
391    #[inline(always)]
392    pub fn bit(self, value: bool) -> &'a mut W {
393        self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30);
394        self.w
395    }
396}
397impl R {
398    #[doc = "Bit 15 - Timestamp Timer"]
399    #[inline(always)]
400    pub fn ts_timer(&self) -> TS_TIMER_R {
401        TS_TIMER_R::new(((self.bits >> 15) & 0x01) != 0)
402    }
403    #[doc = "Bit 16 - Transmit Timestamp Available"]
404    #[inline(always)]
405    pub fn ts_avail(&self) -> TS_AVAIL_R {
406        TS_AVAIL_R::new(((self.bits >> 16) & 0x01) != 0)
407    }
408    #[doc = "Bit 17 - Node Wakeup Request Indication"]
409    #[inline(always)]
410    pub fn wakeup(&self) -> WAKEUP_R {
411        WAKEUP_R::new(((self.bits >> 17) & 0x01) != 0)
412    }
413    #[doc = "Bit 18 - Payload Receive Error"]
414    #[inline(always)]
415    pub fn plr(&self) -> PLR_R {
416        PLR_R::new(((self.bits >> 18) & 0x01) != 0)
417    }
418    #[doc = "Bit 19 - Transmit FIFO Underrun"]
419    #[inline(always)]
420    pub fn un(&self) -> UN_R {
421        UN_R::new(((self.bits >> 19) & 0x01) != 0)
422    }
423    #[doc = "Bit 20 - Collision Retry Limit"]
424    #[inline(always)]
425    pub fn rl(&self) -> RL_R {
426        RL_R::new(((self.bits >> 20) & 0x01) != 0)
427    }
428    #[doc = "Bit 21 - Late Collision"]
429    #[inline(always)]
430    pub fn lc(&self) -> LC_R {
431        LC_R::new(((self.bits >> 21) & 0x01) != 0)
432    }
433    #[doc = "Bit 22 - Ethernet Bus Error"]
434    #[inline(always)]
435    pub fn eberr(&self) -> EBERR_R {
436        EBERR_R::new(((self.bits >> 22) & 0x01) != 0)
437    }
438    #[doc = "Bit 23 - MII Interrupt."]
439    #[inline(always)]
440    pub fn mii(&self) -> MII_R {
441        MII_R::new(((self.bits >> 23) & 0x01) != 0)
442    }
443    #[doc = "Bit 24 - Receive Buffer Interrupt"]
444    #[inline(always)]
445    pub fn rxb(&self) -> RXB_R {
446        RXB_R::new(((self.bits >> 24) & 0x01) != 0)
447    }
448    #[doc = "Bit 25 - Receive Frame Interrupt"]
449    #[inline(always)]
450    pub fn rxf(&self) -> RXF_R {
451        RXF_R::new(((self.bits >> 25) & 0x01) != 0)
452    }
453    #[doc = "Bit 26 - Transmit Buffer Interrupt"]
454    #[inline(always)]
455    pub fn txb(&self) -> TXB_R {
456        TXB_R::new(((self.bits >> 26) & 0x01) != 0)
457    }
458    #[doc = "Bit 27 - Transmit Frame Interrupt"]
459    #[inline(always)]
460    pub fn txf(&self) -> TXF_R {
461        TXF_R::new(((self.bits >> 27) & 0x01) != 0)
462    }
463    #[doc = "Bit 28 - Graceful Stop Complete"]
464    #[inline(always)]
465    pub fn gra(&self) -> GRA_R {
466        GRA_R::new(((self.bits >> 28) & 0x01) != 0)
467    }
468    #[doc = "Bit 29 - Babbling Transmit Error"]
469    #[inline(always)]
470    pub fn babt(&self) -> BABT_R {
471        BABT_R::new(((self.bits >> 29) & 0x01) != 0)
472    }
473    #[doc = "Bit 30 - Babbling Receive Error"]
474    #[inline(always)]
475    pub fn babr(&self) -> BABR_R {
476        BABR_R::new(((self.bits >> 30) & 0x01) != 0)
477    }
478}
479impl W {
480    #[doc = "Bit 15 - Timestamp Timer"]
481    #[inline(always)]
482    pub fn ts_timer(&mut self) -> TS_TIMER_W {
483        TS_TIMER_W { w: self }
484    }
485    #[doc = "Bit 16 - Transmit Timestamp Available"]
486    #[inline(always)]
487    pub fn ts_avail(&mut self) -> TS_AVAIL_W {
488        TS_AVAIL_W { w: self }
489    }
490    #[doc = "Bit 17 - Node Wakeup Request Indication"]
491    #[inline(always)]
492    pub fn wakeup(&mut self) -> WAKEUP_W {
493        WAKEUP_W { w: self }
494    }
495    #[doc = "Bit 18 - Payload Receive Error"]
496    #[inline(always)]
497    pub fn plr(&mut self) -> PLR_W {
498        PLR_W { w: self }
499    }
500    #[doc = "Bit 19 - Transmit FIFO Underrun"]
501    #[inline(always)]
502    pub fn un(&mut self) -> UN_W {
503        UN_W { w: self }
504    }
505    #[doc = "Bit 20 - Collision Retry Limit"]
506    #[inline(always)]
507    pub fn rl(&mut self) -> RL_W {
508        RL_W { w: self }
509    }
510    #[doc = "Bit 21 - Late Collision"]
511    #[inline(always)]
512    pub fn lc(&mut self) -> LC_W {
513        LC_W { w: self }
514    }
515    #[doc = "Bit 22 - Ethernet Bus Error"]
516    #[inline(always)]
517    pub fn eberr(&mut self) -> EBERR_W {
518        EBERR_W { w: self }
519    }
520    #[doc = "Bit 23 - MII Interrupt."]
521    #[inline(always)]
522    pub fn mii(&mut self) -> MII_W {
523        MII_W { w: self }
524    }
525    #[doc = "Bit 24 - Receive Buffer Interrupt"]
526    #[inline(always)]
527    pub fn rxb(&mut self) -> RXB_W {
528        RXB_W { w: self }
529    }
530    #[doc = "Bit 25 - Receive Frame Interrupt"]
531    #[inline(always)]
532    pub fn rxf(&mut self) -> RXF_W {
533        RXF_W { w: self }
534    }
535    #[doc = "Bit 26 - Transmit Buffer Interrupt"]
536    #[inline(always)]
537    pub fn txb(&mut self) -> TXB_W {
538        TXB_W { w: self }
539    }
540    #[doc = "Bit 27 - Transmit Frame Interrupt"]
541    #[inline(always)]
542    pub fn txf(&mut self) -> TXF_W {
543        TXF_W { w: self }
544    }
545    #[doc = "Bit 28 - Graceful Stop Complete"]
546    #[inline(always)]
547    pub fn gra(&mut self) -> GRA_W {
548        GRA_W { w: self }
549    }
550    #[doc = "Bit 29 - Babbling Transmit Error"]
551    #[inline(always)]
552    pub fn babt(&mut self) -> BABT_W {
553        BABT_W { w: self }
554    }
555    #[doc = "Bit 30 - Babbling Receive Error"]
556    #[inline(always)]
557    pub fn babr(&mut self) -> BABR_W {
558        BABR_W { w: self }
559    }
560}