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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#[doc = "Register `emac_rx_dma_sta` reader"]
pub struct R(crate::R<EMAC_RX_DMA_STA_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<EMAC_RX_DMA_STA_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<EMAC_RX_DMA_STA_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<EMAC_RX_DMA_STA_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `rx_dma_sta` reader - The State of RX DMA FSM"]
pub type RX_DMA_STA_R = crate::FieldReader<u8, RX_DMA_STA_A>;
#[doc = "The State of RX DMA FSM\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RX_DMA_STA_A {
    #[doc = "0: `0`"]
    STOP = 0,
    #[doc = "1: `1`"]
    RUN_FETCH_DESC = 1,
    #[doc = "3: `11`"]
    RUN_WAIT_FRM = 3,
    #[doc = "4: `100`"]
    SUSPEND = 4,
    #[doc = "5: `101`"]
    RUN_CLOSE_DESC = 5,
    #[doc = "7: `111`"]
    RUN_TRANS_DATA = 7,
}
impl From<RX_DMA_STA_A> for u8 {
    #[inline(always)]
    fn from(variant: RX_DMA_STA_A) -> Self {
        variant as _
    }
}
impl RX_DMA_STA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<RX_DMA_STA_A> {
        match self.bits {
            0 => Some(RX_DMA_STA_A::STOP),
            1 => Some(RX_DMA_STA_A::RUN_FETCH_DESC),
            3 => Some(RX_DMA_STA_A::RUN_WAIT_FRM),
            4 => Some(RX_DMA_STA_A::SUSPEND),
            5 => Some(RX_DMA_STA_A::RUN_CLOSE_DESC),
            7 => Some(RX_DMA_STA_A::RUN_TRANS_DATA),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `STOP`"]
    #[inline(always)]
    pub fn is_stop(&self) -> bool {
        *self == RX_DMA_STA_A::STOP
    }
    #[doc = "Checks if the value of the field is `RUN_FETCH_DESC`"]
    #[inline(always)]
    pub fn is_run_fetch_desc(&self) -> bool {
        *self == RX_DMA_STA_A::RUN_FETCH_DESC
    }
    #[doc = "Checks if the value of the field is `RUN_WAIT_FRM`"]
    #[inline(always)]
    pub fn is_run_wait_frm(&self) -> bool {
        *self == RX_DMA_STA_A::RUN_WAIT_FRM
    }
    #[doc = "Checks if the value of the field is `SUSPEND`"]
    #[inline(always)]
    pub fn is_suspend(&self) -> bool {
        *self == RX_DMA_STA_A::SUSPEND
    }
    #[doc = "Checks if the value of the field is `RUN_CLOSE_DESC`"]
    #[inline(always)]
    pub fn is_run_close_desc(&self) -> bool {
        *self == RX_DMA_STA_A::RUN_CLOSE_DESC
    }
    #[doc = "Checks if the value of the field is `RUN_TRANS_DATA`"]
    #[inline(always)]
    pub fn is_run_trans_data(&self) -> bool {
        *self == RX_DMA_STA_A::RUN_TRANS_DATA
    }
}
impl R {
    #[doc = "Bits 0:2 - The State of RX DMA FSM"]
    #[inline(always)]
    pub fn rx_dma_sta(&self) -> RX_DMA_STA_R {
        RX_DMA_STA_R::new((self.bits & 7) as u8)
    }
}
#[doc = "EMAC Receive DMA Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [emac_rx_dma_sta](index.html) module"]
pub struct EMAC_RX_DMA_STA_SPEC;
impl crate::RegisterSpec for EMAC_RX_DMA_STA_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [emac_rx_dma_sta::R](R) reader structure"]
impl crate::Readable for EMAC_RX_DMA_STA_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets emac_rx_dma_sta to value 0"]
impl crate::Resettable for EMAC_RX_DMA_STA_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}