esp32/spi0/
dma_in_link.rs

1#[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 - The address of the first inlink descriptor."]
6pub type INLINK_ADDR_R = crate::FieldReader<u32>;
7#[doc = "Field `INLINK_ADDR` writer - The address of the first inlink descriptor."]
8pub type INLINK_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>;
9#[doc = "Field `INLINK_AUTO_RET` reader - when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong"]
10pub type INLINK_AUTO_RET_R = crate::BitReader;
11#[doc = "Field `INLINK_AUTO_RET` writer - when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong"]
12pub type INLINK_AUTO_RET_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `INLINK_STOP` reader - Set the bit to stop to use inlink descriptor."]
14pub type INLINK_STOP_R = crate::BitReader;
15#[doc = "Field `INLINK_STOP` writer - Set the bit to stop to use inlink descriptor."]
16pub type INLINK_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `INLINK_START` reader - Set the bit to start to use inlink descriptor."]
18pub type INLINK_START_R = crate::BitReader;
19#[doc = "Field `INLINK_START` writer - Set the bit to start to use inlink descriptor."]
20pub type INLINK_START_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `INLINK_RESTART` reader - Set the bit to mount on new inlink descriptors."]
22pub type INLINK_RESTART_R = crate::BitReader;
23#[doc = "Field `INLINK_RESTART` writer - Set the bit to mount on new inlink descriptors."]
24pub type INLINK_RESTART_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bits 0:19 - The address of the first inlink descriptor."]
27    #[inline(always)]
28    pub fn inlink_addr(&self) -> INLINK_ADDR_R {
29        INLINK_ADDR_R::new(self.bits & 0x000f_ffff)
30    }
31    #[doc = "Bit 20 - when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong"]
32    #[inline(always)]
33    pub fn inlink_auto_ret(&self) -> INLINK_AUTO_RET_R {
34        INLINK_AUTO_RET_R::new(((self.bits >> 20) & 1) != 0)
35    }
36    #[doc = "Bit 28 - Set the bit to stop to use inlink descriptor."]
37    #[inline(always)]
38    pub fn inlink_stop(&self) -> INLINK_STOP_R {
39        INLINK_STOP_R::new(((self.bits >> 28) & 1) != 0)
40    }
41    #[doc = "Bit 29 - Set the bit to start to use inlink descriptor."]
42    #[inline(always)]
43    pub fn inlink_start(&self) -> INLINK_START_R {
44        INLINK_START_R::new(((self.bits >> 29) & 1) != 0)
45    }
46    #[doc = "Bit 30 - Set the bit to mount on new inlink descriptors."]
47    #[inline(always)]
48    pub fn inlink_restart(&self) -> INLINK_RESTART_R {
49        INLINK_RESTART_R::new(((self.bits >> 30) & 1) != 0)
50    }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55        f.debug_struct("DMA_IN_LINK")
56            .field("inlink_addr", &self.inlink_addr())
57            .field("inlink_auto_ret", &self.inlink_auto_ret())
58            .field("inlink_stop", &self.inlink_stop())
59            .field("inlink_start", &self.inlink_start())
60            .field("inlink_restart", &self.inlink_restart())
61            .finish()
62    }
63}
64impl W {
65    #[doc = "Bits 0:19 - The address of the first inlink descriptor."]
66    #[inline(always)]
67    pub fn inlink_addr(&mut self) -> INLINK_ADDR_W<DMA_IN_LINK_SPEC> {
68        INLINK_ADDR_W::new(self, 0)
69    }
70    #[doc = "Bit 20 - when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong"]
71    #[inline(always)]
72    pub fn inlink_auto_ret(&mut self) -> INLINK_AUTO_RET_W<DMA_IN_LINK_SPEC> {
73        INLINK_AUTO_RET_W::new(self, 20)
74    }
75    #[doc = "Bit 28 - Set the bit to stop to use inlink descriptor."]
76    #[inline(always)]
77    pub fn inlink_stop(&mut self) -> INLINK_STOP_W<DMA_IN_LINK_SPEC> {
78        INLINK_STOP_W::new(self, 28)
79    }
80    #[doc = "Bit 29 - Set the bit to start to use inlink descriptor."]
81    #[inline(always)]
82    pub fn inlink_start(&mut self) -> INLINK_START_W<DMA_IN_LINK_SPEC> {
83        INLINK_START_W::new(self, 29)
84    }
85    #[doc = "Bit 30 - Set the bit to mount on new inlink descriptors."]
86    #[inline(always)]
87    pub fn inlink_restart(&mut self) -> INLINK_RESTART_W<DMA_IN_LINK_SPEC> {
88        INLINK_RESTART_W::new(self, 30)
89    }
90}
91#[doc = "\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)."]
92pub struct DMA_IN_LINK_SPEC;
93impl crate::RegisterSpec for DMA_IN_LINK_SPEC {
94    type Ux = u32;
95}
96#[doc = "`read()` method returns [`dma_in_link::R`](R) reader structure"]
97impl crate::Readable for DMA_IN_LINK_SPEC {}
98#[doc = "`write(|w| ..)` method takes [`dma_in_link::W`](W) writer structure"]
99impl crate::Writable for DMA_IN_LINK_SPEC {
100    type Safety = crate::Unsafe;
101}
102#[doc = "`reset()` method sets DMA_IN_LINK to value 0"]
103impl crate::Resettable for DMA_IN_LINK_SPEC {}