esp32s2/uhci0/
dma_in_link.rs1#[doc = "Register `DMA_IN_LINK` reader"]
2pub type R = crate::R<DMA_IN_LINK_SPEC>;
3#[doc = "Register `DMA_IN_LINK` writer"]
4pub type W = crate::W<DMA_IN_LINK_SPEC>;
5#[doc = "Field `INLINK_ADDR` reader - This register is used to specify the least significant 20 bits of the first receive descriptor's address."]
6pub type INLINK_ADDR_R = crate::FieldReader<u32>;
7#[doc = "Field `INLINK_ADDR` writer - This register is used to specify the least significant 20 bits of the first receive descriptor's address."]
8pub type INLINK_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>;
9#[doc = "Field `INLINK_AUTO_RET` reader - This is the enable bit to return to current receive descriptor's address, when there are some errors in current packet."]
10pub type INLINK_AUTO_RET_R = crate::BitReader;
11#[doc = "Field `INLINK_AUTO_RET` writer - This is the enable bit to return to current receive descriptor's address, when there are some errors in current packet."]
12pub type INLINK_AUTO_RET_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `INLINK_STOP` reader - Set this bit to stop dealing with the receive descriptors."]
14pub type INLINK_STOP_R = crate::BitReader;
15#[doc = "Field `INLINK_STOP` writer - Set this bit to stop dealing with the receive descriptors."]
16pub type INLINK_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `INLINK_START` reader - Set this bit to start dealing with the receive descriptors."]
18pub type INLINK_START_R = crate::BitReader;
19#[doc = "Field `INLINK_START` writer - Set this bit to start dealing with the receive descriptors."]
20pub type INLINK_START_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `INLINK_RESTART` reader - Set this bit to restart new receive descriptors."]
22pub type INLINK_RESTART_R = crate::BitReader;
23#[doc = "Field `INLINK_RESTART` writer - Set this bit to restart new receive descriptors."]
24pub type INLINK_RESTART_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `INLINK_PARK` reader - 1: the receive descriptor's FSM is in idle state. 0: the receive descriptor's FSM is working."]
26pub type INLINK_PARK_R = crate::BitReader;
27impl R {
28 #[doc = "Bits 0:19 - This register is used to specify the least significant 20 bits of the first receive descriptor's address."]
29 #[inline(always)]
30 pub fn inlink_addr(&self) -> INLINK_ADDR_R {
31 INLINK_ADDR_R::new(self.bits & 0x000f_ffff)
32 }
33 #[doc = "Bit 20 - This is the enable bit to return to current receive descriptor's address, when there are some errors in current packet."]
34 #[inline(always)]
35 pub fn inlink_auto_ret(&self) -> INLINK_AUTO_RET_R {
36 INLINK_AUTO_RET_R::new(((self.bits >> 20) & 1) != 0)
37 }
38 #[doc = "Bit 28 - Set this bit to stop dealing with the receive descriptors."]
39 #[inline(always)]
40 pub fn inlink_stop(&self) -> INLINK_STOP_R {
41 INLINK_STOP_R::new(((self.bits >> 28) & 1) != 0)
42 }
43 #[doc = "Bit 29 - Set this bit to start dealing with the receive descriptors."]
44 #[inline(always)]
45 pub fn inlink_start(&self) -> INLINK_START_R {
46 INLINK_START_R::new(((self.bits >> 29) & 1) != 0)
47 }
48 #[doc = "Bit 30 - Set this bit to restart new receive descriptors."]
49 #[inline(always)]
50 pub fn inlink_restart(&self) -> INLINK_RESTART_R {
51 INLINK_RESTART_R::new(((self.bits >> 30) & 1) != 0)
52 }
53 #[doc = "Bit 31 - 1: the receive descriptor's FSM is in idle state. 0: the receive descriptor's FSM is working."]
54 #[inline(always)]
55 pub fn inlink_park(&self) -> INLINK_PARK_R {
56 INLINK_PARK_R::new(((self.bits >> 31) & 1) != 0)
57 }
58}
59#[cfg(feature = "impl-register-debug")]
60impl core::fmt::Debug for R {
61 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
62 f.debug_struct("DMA_IN_LINK")
63 .field("inlink_addr", &self.inlink_addr())
64 .field("inlink_auto_ret", &self.inlink_auto_ret())
65 .field("inlink_stop", &self.inlink_stop())
66 .field("inlink_start", &self.inlink_start())
67 .field("inlink_restart", &self.inlink_restart())
68 .field("inlink_park", &self.inlink_park())
69 .finish()
70 }
71}
72impl W {
73 #[doc = "Bits 0:19 - This register is used to specify the least significant 20 bits of the first receive descriptor's address."]
74 #[inline(always)]
75 pub fn inlink_addr(&mut self) -> INLINK_ADDR_W<DMA_IN_LINK_SPEC> {
76 INLINK_ADDR_W::new(self, 0)
77 }
78 #[doc = "Bit 20 - This is the enable bit to return to current receive descriptor's address, when there are some errors in current packet."]
79 #[inline(always)]
80 pub fn inlink_auto_ret(&mut self) -> INLINK_AUTO_RET_W<DMA_IN_LINK_SPEC> {
81 INLINK_AUTO_RET_W::new(self, 20)
82 }
83 #[doc = "Bit 28 - Set this bit to stop dealing with the receive descriptors."]
84 #[inline(always)]
85 pub fn inlink_stop(&mut self) -> INLINK_STOP_W<DMA_IN_LINK_SPEC> {
86 INLINK_STOP_W::new(self, 28)
87 }
88 #[doc = "Bit 29 - Set this bit to start dealing with the receive descriptors."]
89 #[inline(always)]
90 pub fn inlink_start(&mut self) -> INLINK_START_W<DMA_IN_LINK_SPEC> {
91 INLINK_START_W::new(self, 29)
92 }
93 #[doc = "Bit 30 - Set this bit to restart new receive descriptors."]
94 #[inline(always)]
95 pub fn inlink_restart(&mut self) -> INLINK_RESTART_W<DMA_IN_LINK_SPEC> {
96 INLINK_RESTART_W::new(self, 30)
97 }
98}
99#[doc = "Link descriptor address and control\n\nYou can [`read`](crate::Reg::read) this register and get [`dma_in_link::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dma_in_link::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct DMA_IN_LINK_SPEC;
101impl crate::RegisterSpec for DMA_IN_LINK_SPEC {
102 type Ux = u32;
103}
104#[doc = "`read()` method returns [`dma_in_link::R`](R) reader structure"]
105impl crate::Readable for DMA_IN_LINK_SPEC {}
106#[doc = "`write(|w| ..)` method takes [`dma_in_link::W`](W) writer structure"]
107impl crate::Writable for DMA_IN_LINK_SPEC {
108 type Safety = crate::Unsafe;
109 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111}
112#[doc = "`reset()` method sets DMA_IN_LINK to value 0x0010_0000"]
113impl crate::Resettable for DMA_IN_LINK_SPEC {
114 const RESET_VALUE: u32 = 0x0010_0000;
115}