1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#[doc = "Reader of register PP"] pub type R = crate::R<u32, super::PP>; #[doc = "Ethernet PHY Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PHYTYPE_A { #[doc = "0: No PHY"] NONE, #[doc = "3: Snowflake class PHY"] _1, } impl From<PHYTYPE_A> for u8 { #[inline(always)] fn from(variant: PHYTYPE_A) -> Self { match variant { PHYTYPE_A::NONE => 0, PHYTYPE_A::_1 => 3, } } } #[doc = "Reader of field `PHYTYPE`"] pub type PHYTYPE_R = crate::R<u8, PHYTYPE_A>; impl PHYTYPE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, PHYTYPE_A> { use crate::Variant::*; match self.bits { 0 => Val(PHYTYPE_A::NONE), 3 => Val(PHYTYPE_A::_1), i => Res(i), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == PHYTYPE_A::NONE } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == PHYTYPE_A::_1 } } #[doc = "Reader of field `MACTYPE`"] pub type MACTYPE_R = crate::R<u8, u8>; impl R { #[doc = "Bits 0:2 - Ethernet PHY Type"] #[inline(always)] pub fn phytype(&self) -> PHYTYPE_R { PHYTYPE_R::new((self.bits & 0x07) as u8) } #[doc = "Bits 8:10 - Ethernet MAC Type"] #[inline(always)] pub fn mactype(&self) -> MACTYPE_R { MACTYPE_R::new(((self.bits >> 8) & 0x07) as u8) } }