Skip to main content

lpc54606_pac/enet/
mac_config.rs

1#[doc = "Reader of register MAC_CONFIG"]
2pub type R = crate::R<u32, super::MAC_CONFIG>;
3#[doc = "Writer for register MAC_CONFIG"]
4pub type W = crate::W<u32, super::MAC_CONFIG>;
5#[doc = "Register MAC_CONFIG `reset()`'s with value 0x8000"]
6impl crate::ResetValue for super::MAC_CONFIG {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x8000
11    }
12}
13#[doc = "Reader of field `RE`"]
14pub type RE_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `RE`"]
16pub struct RE_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RE_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) | ((value as u32) & 0x01);
34        self.w
35    }
36}
37#[doc = "Reader of field `TE`"]
38pub type TE_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `TE`"]
40pub struct TE_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> TE_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 << 1)) | (((value as u32) & 0x01) << 1);
58        self.w
59    }
60}
61#[doc = "Reader of field `PRELEN`"]
62pub type PRELEN_R = crate::R<u8, u8>;
63#[doc = "Write proxy for field `PRELEN`"]
64pub struct PRELEN_W<'a> {
65    w: &'a mut W,
66}
67impl<'a> PRELEN_W<'a> {
68    #[doc = r"Writes raw bits to the field"]
69    #[inline(always)]
70    pub unsafe fn bits(self, value: u8) -> &'a mut W {
71        self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
72        self.w
73    }
74}
75#[doc = "Reader of field `DC`"]
76pub type DC_R = crate::R<bool, bool>;
77#[doc = "Write proxy for field `DC`"]
78pub struct DC_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> DC_W<'a> {
82    #[doc = r"Sets the field bit"]
83    #[inline(always)]
84    pub fn set_bit(self) -> &'a mut W {
85        self.bit(true)
86    }
87    #[doc = r"Clears the field bit"]
88    #[inline(always)]
89    pub fn clear_bit(self) -> &'a mut W {
90        self.bit(false)
91    }
92    #[doc = r"Writes raw bits to the field"]
93    #[inline(always)]
94    pub fn bit(self, value: bool) -> &'a mut W {
95        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
96        self.w
97    }
98}
99#[doc = "Reader of field `BL`"]
100pub type BL_R = crate::R<u8, u8>;
101#[doc = "Write proxy for field `BL`"]
102pub struct BL_W<'a> {
103    w: &'a mut W,
104}
105impl<'a> BL_W<'a> {
106    #[doc = r"Writes raw bits to the field"]
107    #[inline(always)]
108    pub unsafe fn bits(self, value: u8) -> &'a mut W {
109        self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5);
110        self.w
111    }
112}
113#[doc = "Reader of field `DR`"]
114pub type DR_R = crate::R<bool, bool>;
115#[doc = "Write proxy for field `DR`"]
116pub struct DR_W<'a> {
117    w: &'a mut W,
118}
119impl<'a> DR_W<'a> {
120    #[doc = r"Sets the field bit"]
121    #[inline(always)]
122    pub fn set_bit(self) -> &'a mut W {
123        self.bit(true)
124    }
125    #[doc = r"Clears the field bit"]
126    #[inline(always)]
127    pub fn clear_bit(self) -> &'a mut W {
128        self.bit(false)
129    }
130    #[doc = r"Writes raw bits to the field"]
131    #[inline(always)]
132    pub fn bit(self, value: bool) -> &'a mut W {
133        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
134        self.w
135    }
136}
137#[doc = "Reader of field `DCRS`"]
138pub type DCRS_R = crate::R<bool, bool>;
139#[doc = "Write proxy for field `DCRS`"]
140pub struct DCRS_W<'a> {
141    w: &'a mut W,
142}
143impl<'a> DCRS_W<'a> {
144    #[doc = r"Sets the field bit"]
145    #[inline(always)]
146    pub fn set_bit(self) -> &'a mut W {
147        self.bit(true)
148    }
149    #[doc = r"Clears the field bit"]
150    #[inline(always)]
151    pub fn clear_bit(self) -> &'a mut W {
152        self.bit(false)
153    }
154    #[doc = r"Writes raw bits to the field"]
155    #[inline(always)]
156    pub fn bit(self, value: bool) -> &'a mut W {
157        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
158        self.w
159    }
160}
161#[doc = "Reader of field `DO`"]
162pub type DO_R = crate::R<bool, bool>;
163#[doc = "Write proxy for field `DO`"]
164pub struct DO_W<'a> {
165    w: &'a mut W,
166}
167impl<'a> DO_W<'a> {
168    #[doc = r"Sets the field bit"]
169    #[inline(always)]
170    pub fn set_bit(self) -> &'a mut W {
171        self.bit(true)
172    }
173    #[doc = r"Clears the field bit"]
174    #[inline(always)]
175    pub fn clear_bit(self) -> &'a mut W {
176        self.bit(false)
177    }
178    #[doc = r"Writes raw bits to the field"]
179    #[inline(always)]
180    pub fn bit(self, value: bool) -> &'a mut W {
181        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
182        self.w
183    }
184}
185#[doc = "Reader of field `ECRSFD`"]
186pub type ECRSFD_R = crate::R<bool, bool>;
187#[doc = "Write proxy for field `ECRSFD`"]
188pub struct ECRSFD_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> ECRSFD_W<'a> {
192    #[doc = r"Sets the field bit"]
193    #[inline(always)]
194    pub fn set_bit(self) -> &'a mut W {
195        self.bit(true)
196    }
197    #[doc = r"Clears the field bit"]
198    #[inline(always)]
199    pub fn clear_bit(self) -> &'a mut W {
200        self.bit(false)
201    }
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub fn bit(self, value: bool) -> &'a mut W {
205        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
206        self.w
207    }
208}
209#[doc = "Reader of field `LM`"]
210pub type LM_R = crate::R<bool, bool>;
211#[doc = "Write proxy for field `LM`"]
212pub struct LM_W<'a> {
213    w: &'a mut W,
214}
215impl<'a> LM_W<'a> {
216    #[doc = r"Sets the field bit"]
217    #[inline(always)]
218    pub fn set_bit(self) -> &'a mut W {
219        self.bit(true)
220    }
221    #[doc = r"Clears the field bit"]
222    #[inline(always)]
223    pub fn clear_bit(self) -> &'a mut W {
224        self.bit(false)
225    }
226    #[doc = r"Writes raw bits to the field"]
227    #[inline(always)]
228    pub fn bit(self, value: bool) -> &'a mut W {
229        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
230        self.w
231    }
232}
233#[doc = "Reader of field `DM`"]
234pub type DM_R = crate::R<bool, bool>;
235#[doc = "Write proxy for field `DM`"]
236pub struct DM_W<'a> {
237    w: &'a mut W,
238}
239impl<'a> DM_W<'a> {
240    #[doc = r"Sets the field bit"]
241    #[inline(always)]
242    pub fn set_bit(self) -> &'a mut W {
243        self.bit(true)
244    }
245    #[doc = r"Clears the field bit"]
246    #[inline(always)]
247    pub fn clear_bit(self) -> &'a mut W {
248        self.bit(false)
249    }
250    #[doc = r"Writes raw bits to the field"]
251    #[inline(always)]
252    pub fn bit(self, value: bool) -> &'a mut W {
253        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
254        self.w
255    }
256}
257#[doc = "Reader of field `FES`"]
258pub type FES_R = crate::R<bool, bool>;
259#[doc = "Write proxy for field `FES`"]
260pub struct FES_W<'a> {
261    w: &'a mut W,
262}
263impl<'a> FES_W<'a> {
264    #[doc = r"Sets the field bit"]
265    #[inline(always)]
266    pub fn set_bit(self) -> &'a mut W {
267        self.bit(true)
268    }
269    #[doc = r"Clears the field bit"]
270    #[inline(always)]
271    pub fn clear_bit(self) -> &'a mut W {
272        self.bit(false)
273    }
274    #[doc = r"Writes raw bits to the field"]
275    #[inline(always)]
276    pub fn bit(self, value: bool) -> &'a mut W {
277        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
278        self.w
279    }
280}
281#[doc = "Reader of field `PS`"]
282pub type PS_R = crate::R<bool, bool>;
283#[doc = "Reader of field `JE`"]
284pub type JE_R = crate::R<bool, bool>;
285#[doc = "Write proxy for field `JE`"]
286pub struct JE_W<'a> {
287    w: &'a mut W,
288}
289impl<'a> JE_W<'a> {
290    #[doc = r"Sets the field bit"]
291    #[inline(always)]
292    pub fn set_bit(self) -> &'a mut W {
293        self.bit(true)
294    }
295    #[doc = r"Clears the field bit"]
296    #[inline(always)]
297    pub fn clear_bit(self) -> &'a mut W {
298        self.bit(false)
299    }
300    #[doc = r"Writes raw bits to the field"]
301    #[inline(always)]
302    pub fn bit(self, value: bool) -> &'a mut W {
303        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
304        self.w
305    }
306}
307#[doc = "Reader of field `JD`"]
308pub type JD_R = crate::R<bool, bool>;
309#[doc = "Write proxy for field `JD`"]
310pub struct JD_W<'a> {
311    w: &'a mut W,
312}
313impl<'a> JD_W<'a> {
314    #[doc = r"Sets the field bit"]
315    #[inline(always)]
316    pub fn set_bit(self) -> &'a mut W {
317        self.bit(true)
318    }
319    #[doc = r"Clears the field bit"]
320    #[inline(always)]
321    pub fn clear_bit(self) -> &'a mut W {
322        self.bit(false)
323    }
324    #[doc = r"Writes raw bits to the field"]
325    #[inline(always)]
326    pub fn bit(self, value: bool) -> &'a mut W {
327        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
328        self.w
329    }
330}
331#[doc = "Reader of field `BE`"]
332pub type BE_R = crate::R<bool, bool>;
333#[doc = "Write proxy for field `BE`"]
334pub struct BE_W<'a> {
335    w: &'a mut W,
336}
337impl<'a> BE_W<'a> {
338    #[doc = r"Sets the field bit"]
339    #[inline(always)]
340    pub fn set_bit(self) -> &'a mut W {
341        self.bit(true)
342    }
343    #[doc = r"Clears the field bit"]
344    #[inline(always)]
345    pub fn clear_bit(self) -> &'a mut W {
346        self.bit(false)
347    }
348    #[doc = r"Writes raw bits to the field"]
349    #[inline(always)]
350    pub fn bit(self, value: bool) -> &'a mut W {
351        self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
352        self.w
353    }
354}
355#[doc = "Reader of field `WD`"]
356pub type WD_R = crate::R<bool, bool>;
357#[doc = "Write proxy for field `WD`"]
358pub struct WD_W<'a> {
359    w: &'a mut W,
360}
361impl<'a> WD_W<'a> {
362    #[doc = r"Sets the field bit"]
363    #[inline(always)]
364    pub fn set_bit(self) -> &'a mut W {
365        self.bit(true)
366    }
367    #[doc = r"Clears the field bit"]
368    #[inline(always)]
369    pub fn clear_bit(self) -> &'a mut W {
370        self.bit(false)
371    }
372    #[doc = r"Writes raw bits to the field"]
373    #[inline(always)]
374    pub fn bit(self, value: bool) -> &'a mut W {
375        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
376        self.w
377    }
378}
379#[doc = "Reader of field `ACS`"]
380pub type ACS_R = crate::R<bool, bool>;
381#[doc = "Write proxy for field `ACS`"]
382pub struct ACS_W<'a> {
383    w: &'a mut W,
384}
385impl<'a> ACS_W<'a> {
386    #[doc = r"Sets the field bit"]
387    #[inline(always)]
388    pub fn set_bit(self) -> &'a mut W {
389        self.bit(true)
390    }
391    #[doc = r"Clears the field bit"]
392    #[inline(always)]
393    pub fn clear_bit(self) -> &'a mut W {
394        self.bit(false)
395    }
396    #[doc = r"Writes raw bits to the field"]
397    #[inline(always)]
398    pub fn bit(self, value: bool) -> &'a mut W {
399        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
400        self.w
401    }
402}
403#[doc = "Reader of field `CST`"]
404pub type CST_R = crate::R<bool, bool>;
405#[doc = "Write proxy for field `CST`"]
406pub struct CST_W<'a> {
407    w: &'a mut W,
408}
409impl<'a> CST_W<'a> {
410    #[doc = r"Sets the field bit"]
411    #[inline(always)]
412    pub fn set_bit(self) -> &'a mut W {
413        self.bit(true)
414    }
415    #[doc = r"Clears the field bit"]
416    #[inline(always)]
417    pub fn clear_bit(self) -> &'a mut W {
418        self.bit(false)
419    }
420    #[doc = r"Writes raw bits to the field"]
421    #[inline(always)]
422    pub fn bit(self, value: bool) -> &'a mut W {
423        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
424        self.w
425    }
426}
427#[doc = "Reader of field `S2KP`"]
428pub type S2KP_R = crate::R<bool, bool>;
429#[doc = "Write proxy for field `S2KP`"]
430pub struct S2KP_W<'a> {
431    w: &'a mut W,
432}
433impl<'a> S2KP_W<'a> {
434    #[doc = r"Sets the field bit"]
435    #[inline(always)]
436    pub fn set_bit(self) -> &'a mut W {
437        self.bit(true)
438    }
439    #[doc = r"Clears the field bit"]
440    #[inline(always)]
441    pub fn clear_bit(self) -> &'a mut W {
442        self.bit(false)
443    }
444    #[doc = r"Writes raw bits to the field"]
445    #[inline(always)]
446    pub fn bit(self, value: bool) -> &'a mut W {
447        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
448        self.w
449    }
450}
451#[doc = "Reader of field `GPSLCE`"]
452pub type GPSLCE_R = crate::R<bool, bool>;
453#[doc = "Write proxy for field `GPSLCE`"]
454pub struct GPSLCE_W<'a> {
455    w: &'a mut W,
456}
457impl<'a> GPSLCE_W<'a> {
458    #[doc = r"Sets the field bit"]
459    #[inline(always)]
460    pub fn set_bit(self) -> &'a mut W {
461        self.bit(true)
462    }
463    #[doc = r"Clears the field bit"]
464    #[inline(always)]
465    pub fn clear_bit(self) -> &'a mut W {
466        self.bit(false)
467    }
468    #[doc = r"Writes raw bits to the field"]
469    #[inline(always)]
470    pub fn bit(self, value: bool) -> &'a mut W {
471        self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
472        self.w
473    }
474}
475#[doc = "Reader of field `IPG`"]
476pub type IPG_R = crate::R<u8, u8>;
477#[doc = "Write proxy for field `IPG`"]
478pub struct IPG_W<'a> {
479    w: &'a mut W,
480}
481impl<'a> IPG_W<'a> {
482    #[doc = r"Writes raw bits to the field"]
483    #[inline(always)]
484    pub unsafe fn bits(self, value: u8) -> &'a mut W {
485        self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24);
486        self.w
487    }
488}
489#[doc = "Reader of field `IPC`"]
490pub type IPC_R = crate::R<bool, bool>;
491#[doc = "Write proxy for field `IPC`"]
492pub struct IPC_W<'a> {
493    w: &'a mut W,
494}
495impl<'a> IPC_W<'a> {
496    #[doc = r"Sets the field bit"]
497    #[inline(always)]
498    pub fn set_bit(self) -> &'a mut W {
499        self.bit(true)
500    }
501    #[doc = r"Clears the field bit"]
502    #[inline(always)]
503    pub fn clear_bit(self) -> &'a mut W {
504        self.bit(false)
505    }
506    #[doc = r"Writes raw bits to the field"]
507    #[inline(always)]
508    pub fn bit(self, value: bool) -> &'a mut W {
509        self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
510        self.w
511    }
512}
513impl R {
514    #[doc = "Bit 0 - Receiver Enable When this bit is set, the receiver state machine of the MAC is enabled for receiving frames from the MII."]
515    #[inline(always)]
516    pub fn re(&self) -> RE_R {
517        RE_R::new((self.bits & 0x01) != 0)
518    }
519    #[doc = "Bit 1 - Transmitter Enable When this bit is set, the transmit state machine of the MAC is enabled for transmission on the MII."]
520    #[inline(always)]
521    pub fn te(&self) -> TE_R {
522        TE_R::new(((self.bits >> 1) & 0x01) != 0)
523    }
524    #[doc = "Bits 2:3 - Preamble Length for Transmit packets These bits control the number of preamble bytes that are added to the beginning of every Tx packet."]
525    #[inline(always)]
526    pub fn prelen(&self) -> PRELEN_R {
527        PRELEN_R::new(((self.bits >> 2) & 0x03) as u8)
528    }
529    #[doc = "Bit 4 - Deferral Check When this bit is set, the deferral check function is enabled in the MAC."]
530    #[inline(always)]
531    pub fn dc(&self) -> DC_R {
532        DC_R::new(((self.bits >> 4) & 0x01) != 0)
533    }
534    #[doc = "Bits 5:6 - Back-Off Limit The Back-Off limit determines the random integer number (r) of slot time delays (4,096 bit times for 1000 Mbps and 512 bit times for 10/100 Mbps) the MAC waits before rescheduling a transmission attempt during retries after a collision."]
535    #[inline(always)]
536    pub fn bl(&self) -> BL_R {
537        BL_R::new(((self.bits >> 5) & 0x03) as u8)
538    }
539    #[doc = "Bit 8 - Disable Retry When this bit is set, the MAC will attempt only one transmission."]
540    #[inline(always)]
541    pub fn dr(&self) -> DR_R {
542        DR_R::new(((self.bits >> 8) & 0x01) != 0)
543    }
544    #[doc = "Bit 9 - Disable Carrier Sense During Transmission When this bit is set, the MAC transmitter ignores the MII CRS signal during packet transmission in the half-duplex mode."]
545    #[inline(always)]
546    pub fn dcrs(&self) -> DCRS_R {
547        DCRS_R::new(((self.bits >> 9) & 0x01) != 0)
548    }
549    #[doc = "Bit 10 - Disable Receive Own When this bit is set, the MAC disables the reception of frames when the gmii_txen_o is asserted in Half-Duplex mode."]
550    #[inline(always)]
551    pub fn do_(&self) -> DO_R {
552        DO_R::new(((self.bits >> 10) & 0x01) != 0)
553    }
554    #[doc = "Bit 11 - Enable Carrier Sense Before Transmission in Full-Duplex Mode When this bit is set, the MAC transmitter checks the CRS signal before packet transmission in the full-duplex mode."]
555    #[inline(always)]
556    pub fn ecrsfd(&self) -> ECRSFD_R {
557        ECRSFD_R::new(((self.bits >> 11) & 0x01) != 0)
558    }
559    #[doc = "Bit 12 - Loopback Mode When this bit is set, the MAC operates in loopback mode at MII."]
560    #[inline(always)]
561    pub fn lm(&self) -> LM_R {
562        LM_R::new(((self.bits >> 12) & 0x01) != 0)
563    }
564    #[doc = "Bit 13 - Duplex Mode When this bit is set, the MAC operates in a Full-Duplex mode where it can transmit and receive simultaneously."]
565    #[inline(always)]
566    pub fn dm(&self) -> DM_R {
567        DM_R::new(((self.bits >> 13) & 0x01) != 0)
568    }
569    #[doc = "Bit 14 - Speed Indicates the speed in Fast Ethernet (MII) mode: This bit is reserved (RO) by default and is enabled only when RMII/SMII is enabled during configuration."]
570    #[inline(always)]
571    pub fn fes(&self) -> FES_R {
572        FES_R::new(((self.bits >> 14) & 0x01) != 0)
573    }
574    #[doc = "Bit 15 - Portselect."]
575    #[inline(always)]
576    pub fn ps(&self) -> PS_R {
577        PS_R::new(((self.bits >> 15) & 0x01) != 0)
578    }
579    #[doc = "Bit 16 - Jumbo Frame Enable When this bit is set, MAC allows Jumbo frames of 9,018 bytes (9,022 bytes for tagged frames) without reporting a giant frame error in the receive frame status."]
580    #[inline(always)]
581    pub fn je(&self) -> JE_R {
582        JE_R::new(((self.bits >> 16) & 0x01) != 0)
583    }
584    #[doc = "Bit 17 - Jabber Disable When this bit is set, the MAC disables the jabber timer on the transmitter, and can transfer frames of up to 16,384 bytes."]
585    #[inline(always)]
586    pub fn jd(&self) -> JD_R {
587        JD_R::new(((self.bits >> 17) & 0x01) != 0)
588    }
589    #[doc = "Bit 18 - Packet Burst Enable When this bit is set, the MAC allows packet bursting during transmission in the MII half-duplex mode."]
590    #[inline(always)]
591    pub fn be(&self) -> BE_R {
592        BE_R::new(((self.bits >> 18) & 0x01) != 0)
593    }
594    #[doc = "Bit 19 - Watchdog Disable When this bit is set, the MAC disables the watchdog timer on the receiver, and can receive frames of up to 16,384 bytes."]
595    #[inline(always)]
596    pub fn wd(&self) -> WD_R {
597        WD_R::new(((self.bits >> 19) & 0x01) != 0)
598    }
599    #[doc = "Bit 20 - Automatic Pad or CRC Stripping When this bit is set, the MAC strips the Pad or FCS field on the incoming packets only if the value of the length field is less than 1,536 bytes."]
600    #[inline(always)]
601    pub fn acs(&self) -> ACS_R {
602        ACS_R::new(((self.bits >> 20) & 0x01) != 0)
603    }
604    #[doc = "Bit 21 - CRC stripping for Type packets When this bit is set, the last four bytes (FCS) of all packets of Ether type (type field greater than 1,536) are stripped and dropped before forwarding the packet to the application."]
605    #[inline(always)]
606    pub fn cst(&self) -> CST_R {
607        CST_R::new(((self.bits >> 21) & 0x01) != 0)
608    }
609    #[doc = "Bit 22 - IEEE 802."]
610    #[inline(always)]
611    pub fn s2kp(&self) -> S2KP_R {
612        S2KP_R::new(((self.bits >> 22) & 0x01) != 0)
613    }
614    #[doc = "Bit 23 - Giant Packet Size Limit Control Enable When this bit is set, the MAC considers the value in GPSL field in MAC Ext Configuration register to declare a received packet as Giant packet."]
615    #[inline(always)]
616    pub fn gpslce(&self) -> GPSLCE_R {
617        GPSLCE_R::new(((self.bits >> 23) & 0x01) != 0)
618    }
619    #[doc = "Bits 24:26 - Inter-Packet Gap These bits control the minimum IPG between packets during transmission."]
620    #[inline(always)]
621    pub fn ipg(&self) -> IPG_R {
622        IPG_R::new(((self.bits >> 24) & 0x07) as u8)
623    }
624    #[doc = "Bit 27 - Checksum Offload When set, this bit enables the IPv4 header checksum checking and IPv4 or IPv6 TCP, UDP, or ICMP payload checksum checking."]
625    #[inline(always)]
626    pub fn ipc(&self) -> IPC_R {
627        IPC_R::new(((self.bits >> 27) & 0x01) != 0)
628    }
629}
630impl W {
631    #[doc = "Bit 0 - Receiver Enable When this bit is set, the receiver state machine of the MAC is enabled for receiving frames from the MII."]
632    #[inline(always)]
633    pub fn re(&mut self) -> RE_W {
634        RE_W { w: self }
635    }
636    #[doc = "Bit 1 - Transmitter Enable When this bit is set, the transmit state machine of the MAC is enabled for transmission on the MII."]
637    #[inline(always)]
638    pub fn te(&mut self) -> TE_W {
639        TE_W { w: self }
640    }
641    #[doc = "Bits 2:3 - Preamble Length for Transmit packets These bits control the number of preamble bytes that are added to the beginning of every Tx packet."]
642    #[inline(always)]
643    pub fn prelen(&mut self) -> PRELEN_W {
644        PRELEN_W { w: self }
645    }
646    #[doc = "Bit 4 - Deferral Check When this bit is set, the deferral check function is enabled in the MAC."]
647    #[inline(always)]
648    pub fn dc(&mut self) -> DC_W {
649        DC_W { w: self }
650    }
651    #[doc = "Bits 5:6 - Back-Off Limit The Back-Off limit determines the random integer number (r) of slot time delays (4,096 bit times for 1000 Mbps and 512 bit times for 10/100 Mbps) the MAC waits before rescheduling a transmission attempt during retries after a collision."]
652    #[inline(always)]
653    pub fn bl(&mut self) -> BL_W {
654        BL_W { w: self }
655    }
656    #[doc = "Bit 8 - Disable Retry When this bit is set, the MAC will attempt only one transmission."]
657    #[inline(always)]
658    pub fn dr(&mut self) -> DR_W {
659        DR_W { w: self }
660    }
661    #[doc = "Bit 9 - Disable Carrier Sense During Transmission When this bit is set, the MAC transmitter ignores the MII CRS signal during packet transmission in the half-duplex mode."]
662    #[inline(always)]
663    pub fn dcrs(&mut self) -> DCRS_W {
664        DCRS_W { w: self }
665    }
666    #[doc = "Bit 10 - Disable Receive Own When this bit is set, the MAC disables the reception of frames when the gmii_txen_o is asserted in Half-Duplex mode."]
667    #[inline(always)]
668    pub fn do_(&mut self) -> DO_W {
669        DO_W { w: self }
670    }
671    #[doc = "Bit 11 - Enable Carrier Sense Before Transmission in Full-Duplex Mode When this bit is set, the MAC transmitter checks the CRS signal before packet transmission in the full-duplex mode."]
672    #[inline(always)]
673    pub fn ecrsfd(&mut self) -> ECRSFD_W {
674        ECRSFD_W { w: self }
675    }
676    #[doc = "Bit 12 - Loopback Mode When this bit is set, the MAC operates in loopback mode at MII."]
677    #[inline(always)]
678    pub fn lm(&mut self) -> LM_W {
679        LM_W { w: self }
680    }
681    #[doc = "Bit 13 - Duplex Mode When this bit is set, the MAC operates in a Full-Duplex mode where it can transmit and receive simultaneously."]
682    #[inline(always)]
683    pub fn dm(&mut self) -> DM_W {
684        DM_W { w: self }
685    }
686    #[doc = "Bit 14 - Speed Indicates the speed in Fast Ethernet (MII) mode: This bit is reserved (RO) by default and is enabled only when RMII/SMII is enabled during configuration."]
687    #[inline(always)]
688    pub fn fes(&mut self) -> FES_W {
689        FES_W { w: self }
690    }
691    #[doc = "Bit 16 - Jumbo Frame Enable When this bit is set, MAC allows Jumbo frames of 9,018 bytes (9,022 bytes for tagged frames) without reporting a giant frame error in the receive frame status."]
692    #[inline(always)]
693    pub fn je(&mut self) -> JE_W {
694        JE_W { w: self }
695    }
696    #[doc = "Bit 17 - Jabber Disable When this bit is set, the MAC disables the jabber timer on the transmitter, and can transfer frames of up to 16,384 bytes."]
697    #[inline(always)]
698    pub fn jd(&mut self) -> JD_W {
699        JD_W { w: self }
700    }
701    #[doc = "Bit 18 - Packet Burst Enable When this bit is set, the MAC allows packet bursting during transmission in the MII half-duplex mode."]
702    #[inline(always)]
703    pub fn be(&mut self) -> BE_W {
704        BE_W { w: self }
705    }
706    #[doc = "Bit 19 - Watchdog Disable When this bit is set, the MAC disables the watchdog timer on the receiver, and can receive frames of up to 16,384 bytes."]
707    #[inline(always)]
708    pub fn wd(&mut self) -> WD_W {
709        WD_W { w: self }
710    }
711    #[doc = "Bit 20 - Automatic Pad or CRC Stripping When this bit is set, the MAC strips the Pad or FCS field on the incoming packets only if the value of the length field is less than 1,536 bytes."]
712    #[inline(always)]
713    pub fn acs(&mut self) -> ACS_W {
714        ACS_W { w: self }
715    }
716    #[doc = "Bit 21 - CRC stripping for Type packets When this bit is set, the last four bytes (FCS) of all packets of Ether type (type field greater than 1,536) are stripped and dropped before forwarding the packet to the application."]
717    #[inline(always)]
718    pub fn cst(&mut self) -> CST_W {
719        CST_W { w: self }
720    }
721    #[doc = "Bit 22 - IEEE 802."]
722    #[inline(always)]
723    pub fn s2kp(&mut self) -> S2KP_W {
724        S2KP_W { w: self }
725    }
726    #[doc = "Bit 23 - Giant Packet Size Limit Control Enable When this bit is set, the MAC considers the value in GPSL field in MAC Ext Configuration register to declare a received packet as Giant packet."]
727    #[inline(always)]
728    pub fn gpslce(&mut self) -> GPSLCE_W {
729        GPSLCE_W { w: self }
730    }
731    #[doc = "Bits 24:26 - Inter-Packet Gap These bits control the minimum IPG between packets during transmission."]
732    #[inline(always)]
733    pub fn ipg(&mut self) -> IPG_W {
734        IPG_W { w: self }
735    }
736    #[doc = "Bit 27 - Checksum Offload When set, this bit enables the IPv4 header checksum checking and IPv4 or IPv6 TCP, UDP, or ICMP payload checksum checking."]
737    #[inline(always)]
738    pub fn ipc(&mut self) -> IPC_W {
739        IPC_W { w: self }
740    }
741}