tm4c129x/emac0/
pp.rs

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