esp32s2/spi2/
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, the inlink descriptor returns to the first link node when a packet is error."]
10pub type INLINK_AUTO_RET_R = crate::BitReader;
11#[doc = "Field `INLINK_AUTO_RET` writer - when the bit is set, the inlink descriptor returns to the first link node when a packet is error."]
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>;
25#[doc = "Field `DMA_RX_ENA` reader - SPI DMA read data status bit."]
26pub type DMA_RX_ENA_R = crate::BitReader;
27#[doc = "Field `DMA_RX_ENA` writer - SPI DMA read data status bit."]
28pub type DMA_RX_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bits 0:19 - The address of the first inlink descriptor."]
31    #[inline(always)]
32    pub fn inlink_addr(&self) -> INLINK_ADDR_R {
33        INLINK_ADDR_R::new(self.bits & 0x000f_ffff)
34    }
35    #[doc = "Bit 20 - when the bit is set, the inlink descriptor returns to the first link node when a packet is error."]
36    #[inline(always)]
37    pub fn inlink_auto_ret(&self) -> INLINK_AUTO_RET_R {
38        INLINK_AUTO_RET_R::new(((self.bits >> 20) & 1) != 0)
39    }
40    #[doc = "Bit 28 - Set the bit to stop to use inlink descriptor."]
41    #[inline(always)]
42    pub fn inlink_stop(&self) -> INLINK_STOP_R {
43        INLINK_STOP_R::new(((self.bits >> 28) & 1) != 0)
44    }
45    #[doc = "Bit 29 - Set the bit to start to use inlink descriptor."]
46    #[inline(always)]
47    pub fn inlink_start(&self) -> INLINK_START_R {
48        INLINK_START_R::new(((self.bits >> 29) & 1) != 0)
49    }
50    #[doc = "Bit 30 - Set the bit to mount on new inlink descriptors."]
51    #[inline(always)]
52    pub fn inlink_restart(&self) -> INLINK_RESTART_R {
53        INLINK_RESTART_R::new(((self.bits >> 30) & 1) != 0)
54    }
55    #[doc = "Bit 31 - SPI DMA read data status bit."]
56    #[inline(always)]
57    pub fn dma_rx_ena(&self) -> DMA_RX_ENA_R {
58        DMA_RX_ENA_R::new(((self.bits >> 31) & 1) != 0)
59    }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("DMA_IN_LINK")
65            .field("inlink_addr", &self.inlink_addr())
66            .field("inlink_auto_ret", &self.inlink_auto_ret())
67            .field("inlink_stop", &self.inlink_stop())
68            .field("inlink_start", &self.inlink_start())
69            .field("inlink_restart", &self.inlink_restart())
70            .field("dma_rx_ena", &self.dma_rx_ena())
71            .finish()
72    }
73}
74impl W {
75    #[doc = "Bits 0:19 - The address of the first inlink descriptor."]
76    #[inline(always)]
77    pub fn inlink_addr(&mut self) -> INLINK_ADDR_W<DMA_IN_LINK_SPEC> {
78        INLINK_ADDR_W::new(self, 0)
79    }
80    #[doc = "Bit 20 - when the bit is set, the inlink descriptor returns to the first link node when a packet is error."]
81    #[inline(always)]
82    pub fn inlink_auto_ret(&mut self) -> INLINK_AUTO_RET_W<DMA_IN_LINK_SPEC> {
83        INLINK_AUTO_RET_W::new(self, 20)
84    }
85    #[doc = "Bit 28 - Set the bit to stop to use inlink descriptor."]
86    #[inline(always)]
87    pub fn inlink_stop(&mut self) -> INLINK_STOP_W<DMA_IN_LINK_SPEC> {
88        INLINK_STOP_W::new(self, 28)
89    }
90    #[doc = "Bit 29 - Set the bit to start to use inlink descriptor."]
91    #[inline(always)]
92    pub fn inlink_start(&mut self) -> INLINK_START_W<DMA_IN_LINK_SPEC> {
93        INLINK_START_W::new(self, 29)
94    }
95    #[doc = "Bit 30 - Set the bit to mount on new inlink descriptors."]
96    #[inline(always)]
97    pub fn inlink_restart(&mut self) -> INLINK_RESTART_W<DMA_IN_LINK_SPEC> {
98        INLINK_RESTART_W::new(self, 30)
99    }
100    #[doc = "Bit 31 - SPI DMA read data status bit."]
101    #[inline(always)]
102    pub fn dma_rx_ena(&mut self) -> DMA_RX_ENA_W<DMA_IN_LINK_SPEC> {
103        DMA_RX_ENA_W::new(self, 31)
104    }
105}
106#[doc = "SPI DMA RX link configuration\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)."]
107pub struct DMA_IN_LINK_SPEC;
108impl crate::RegisterSpec for DMA_IN_LINK_SPEC {
109    type Ux = u32;
110}
111#[doc = "`read()` method returns [`dma_in_link::R`](R) reader structure"]
112impl crate::Readable for DMA_IN_LINK_SPEC {}
113#[doc = "`write(|w| ..)` method takes [`dma_in_link::W`](W) writer structure"]
114impl crate::Writable for DMA_IN_LINK_SPEC {
115    type Safety = crate::Unsafe;
116}
117#[doc = "`reset()` method sets DMA_IN_LINK to value 0"]
118impl crate::Resettable for DMA_IN_LINK_SPEC {}