d1_pac/emac/
emac_rx_dma_sta.rs1#[doc = "Register `emac_rx_dma_sta` reader"]
2pub type R = crate::R<EMAC_RX_DMA_STA_SPEC>;
3#[doc = "Field `rx_dma_sta` reader - The State of RX DMA FSM"]
4pub type RX_DMA_STA_R = crate::FieldReader<RX_DMA_STA_A>;
5#[doc = "The State of RX DMA FSM\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum RX_DMA_STA_A {
9 #[doc = "0: `0`"]
10 STOP = 0,
11 #[doc = "1: `1`"]
12 RUN_FETCH_DESC = 1,
13 #[doc = "3: `11`"]
14 RUN_WAIT_FRM = 3,
15 #[doc = "4: `100`"]
16 SUSPEND = 4,
17 #[doc = "5: `101`"]
18 RUN_CLOSE_DESC = 5,
19 #[doc = "7: `111`"]
20 RUN_TRANS_DATA = 7,
21}
22impl From<RX_DMA_STA_A> for u8 {
23 #[inline(always)]
24 fn from(variant: RX_DMA_STA_A) -> Self {
25 variant as _
26 }
27}
28impl crate::FieldSpec for RX_DMA_STA_A {
29 type Ux = u8;
30}
31impl RX_DMA_STA_R {
32 #[doc = "Get enumerated values variant"]
33 #[inline(always)]
34 pub const fn variant(&self) -> Option<RX_DMA_STA_A> {
35 match self.bits {
36 0 => Some(RX_DMA_STA_A::STOP),
37 1 => Some(RX_DMA_STA_A::RUN_FETCH_DESC),
38 3 => Some(RX_DMA_STA_A::RUN_WAIT_FRM),
39 4 => Some(RX_DMA_STA_A::SUSPEND),
40 5 => Some(RX_DMA_STA_A::RUN_CLOSE_DESC),
41 7 => Some(RX_DMA_STA_A::RUN_TRANS_DATA),
42 _ => None,
43 }
44 }
45 #[doc = "`0`"]
46 #[inline(always)]
47 pub fn is_stop(&self) -> bool {
48 *self == RX_DMA_STA_A::STOP
49 }
50 #[doc = "`1`"]
51 #[inline(always)]
52 pub fn is_run_fetch_desc(&self) -> bool {
53 *self == RX_DMA_STA_A::RUN_FETCH_DESC
54 }
55 #[doc = "`11`"]
56 #[inline(always)]
57 pub fn is_run_wait_frm(&self) -> bool {
58 *self == RX_DMA_STA_A::RUN_WAIT_FRM
59 }
60 #[doc = "`100`"]
61 #[inline(always)]
62 pub fn is_suspend(&self) -> bool {
63 *self == RX_DMA_STA_A::SUSPEND
64 }
65 #[doc = "`101`"]
66 #[inline(always)]
67 pub fn is_run_close_desc(&self) -> bool {
68 *self == RX_DMA_STA_A::RUN_CLOSE_DESC
69 }
70 #[doc = "`111`"]
71 #[inline(always)]
72 pub fn is_run_trans_data(&self) -> bool {
73 *self == RX_DMA_STA_A::RUN_TRANS_DATA
74 }
75}
76impl R {
77 #[doc = "Bits 0:2 - The State of RX DMA FSM"]
78 #[inline(always)]
79 pub fn rx_dma_sta(&self) -> RX_DMA_STA_R {
80 RX_DMA_STA_R::new((self.bits & 7) as u8)
81 }
82}
83#[doc = "EMAC Receive DMA Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emac_rx_dma_sta::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
84pub struct EMAC_RX_DMA_STA_SPEC;
85impl crate::RegisterSpec for EMAC_RX_DMA_STA_SPEC {
86 type Ux = u32;
87}
88#[doc = "`read()` method returns [`emac_rx_dma_sta::R`](R) reader structure"]
89impl crate::Readable for EMAC_RX_DMA_STA_SPEC {}
90#[doc = "`reset()` method sets emac_rx_dma_sta to value 0"]
91impl crate::Resettable for EMAC_RX_DMA_STA_SPEC {
92 const RESET_VALUE: Self::Ux = 0;
93}