esp32s2/crypto_dma/
in_link.rs

1#[doc = "Register `IN_LINK` reader"]
2pub type R = crate::R<IN_LINK_SPEC>;
3#[doc = "Register `IN_LINK` writer"]
4pub type W = crate::W<IN_LINK_SPEC>;
5#[doc = "Field `INLINK_ADDR` reader - This register stores the 20 least significant bits of the first receive descriptor’s address."]
6pub type INLINK_ADDR_R = crate::FieldReader<u32>;
7#[doc = "Field `INLINK_ADDR` writer - This register stores the 20 least significant 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 - Reserved"]
10pub type INLINK_AUTO_RET_R = crate::BitReader;
11#[doc = "Field `INLINK_AUTO_RET` writer - Reserved"]
12pub type INLINK_AUTO_RET_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `INLINK_STOP` reader - Set this bit to stop DMA from reading receive descriptors after finishing the current data transaction."]
14pub type INLINK_STOP_R = crate::BitReader;
15#[doc = "Field `INLINK_STOP` writer - Set this bit to stop DMA from reading receive descriptors after finishing the current data transaction."]
16pub type INLINK_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `INLINK_START` reader - Set this bit to enable DMA to read receive descriptors."]
18pub type INLINK_START_R = crate::BitReader;
19#[doc = "Field `INLINK_START` writer - Set this bit to enable DMA to read receive descriptors."]
20pub type INLINK_START_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `INLINK_RESTART` reader - Set this bit to mount a new receive descriptor."]
22pub type INLINK_RESTART_R = crate::BitReader;
23#[doc = "Field `INLINK_RESTART` writer - Set this bit to mount a new receive descriptor."]
24pub type INLINK_RESTART_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "1: the receive descriptor’s FSM is in idle state. 0: the receive descriptor’s FSM is working.\n\nValue on reset: 0"]
26#[cfg_attr(feature = "defmt", derive(defmt::Format))]
27#[derive(Clone, Copy, Debug, PartialEq, Eq)]
28pub enum INLINK_PARK {
29    #[doc = "0: The receive descriptor’s FSM is working"]
30    Working = 0,
31    #[doc = "1: The receive descriptor’s FSM is in idle state"]
32    Idle = 1,
33}
34impl From<INLINK_PARK> for bool {
35    #[inline(always)]
36    fn from(variant: INLINK_PARK) -> Self {
37        variant as u8 != 0
38    }
39}
40#[doc = "Field `INLINK_PARK` reader - 1: the receive descriptor’s FSM is in idle state. 0: the receive descriptor’s FSM is working."]
41pub type INLINK_PARK_R = crate::BitReader<INLINK_PARK>;
42impl INLINK_PARK_R {
43    #[doc = "Get enumerated values variant"]
44    #[inline(always)]
45    pub const fn variant(&self) -> INLINK_PARK {
46        match self.bits {
47            false => INLINK_PARK::Working,
48            true => INLINK_PARK::Idle,
49        }
50    }
51    #[doc = "The receive descriptor’s FSM is working"]
52    #[inline(always)]
53    pub fn is_working(&self) -> bool {
54        *self == INLINK_PARK::Working
55    }
56    #[doc = "The receive descriptor’s FSM is in idle state"]
57    #[inline(always)]
58    pub fn is_idle(&self) -> bool {
59        *self == INLINK_PARK::Idle
60    }
61}
62impl R {
63    #[doc = "Bits 0:19 - This register stores the 20 least significant bits of the first receive descriptor’s address."]
64    #[inline(always)]
65    pub fn inlink_addr(&self) -> INLINK_ADDR_R {
66        INLINK_ADDR_R::new(self.bits & 0x000f_ffff)
67    }
68    #[doc = "Bit 20 - Reserved"]
69    #[inline(always)]
70    pub fn inlink_auto_ret(&self) -> INLINK_AUTO_RET_R {
71        INLINK_AUTO_RET_R::new(((self.bits >> 20) & 1) != 0)
72    }
73    #[doc = "Bit 28 - Set this bit to stop DMA from reading receive descriptors after finishing the current data transaction."]
74    #[inline(always)]
75    pub fn inlink_stop(&self) -> INLINK_STOP_R {
76        INLINK_STOP_R::new(((self.bits >> 28) & 1) != 0)
77    }
78    #[doc = "Bit 29 - Set this bit to enable DMA to read receive descriptors."]
79    #[inline(always)]
80    pub fn inlink_start(&self) -> INLINK_START_R {
81        INLINK_START_R::new(((self.bits >> 29) & 1) != 0)
82    }
83    #[doc = "Bit 30 - Set this bit to mount a new receive descriptor."]
84    #[inline(always)]
85    pub fn inlink_restart(&self) -> INLINK_RESTART_R {
86        INLINK_RESTART_R::new(((self.bits >> 30) & 1) != 0)
87    }
88    #[doc = "Bit 31 - 1: the receive descriptor’s FSM is in idle state. 0: the receive descriptor’s FSM is working."]
89    #[inline(always)]
90    pub fn inlink_park(&self) -> INLINK_PARK_R {
91        INLINK_PARK_R::new(((self.bits >> 31) & 1) != 0)
92    }
93}
94#[cfg(feature = "impl-register-debug")]
95impl core::fmt::Debug for R {
96    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
97        f.debug_struct("IN_LINK")
98            .field("inlink_addr", &self.inlink_addr())
99            .field("inlink_auto_ret", &self.inlink_auto_ret())
100            .field("inlink_stop", &self.inlink_stop())
101            .field("inlink_start", &self.inlink_start())
102            .field("inlink_restart", &self.inlink_restart())
103            .field("inlink_park", &self.inlink_park())
104            .finish()
105    }
106}
107impl W {
108    #[doc = "Bits 0:19 - This register stores the 20 least significant bits of the first receive descriptor’s address."]
109    #[inline(always)]
110    pub fn inlink_addr(&mut self) -> INLINK_ADDR_W<IN_LINK_SPEC> {
111        INLINK_ADDR_W::new(self, 0)
112    }
113    #[doc = "Bit 20 - Reserved"]
114    #[inline(always)]
115    pub fn inlink_auto_ret(&mut self) -> INLINK_AUTO_RET_W<IN_LINK_SPEC> {
116        INLINK_AUTO_RET_W::new(self, 20)
117    }
118    #[doc = "Bit 28 - Set this bit to stop DMA from reading receive descriptors after finishing the current data transaction."]
119    #[inline(always)]
120    pub fn inlink_stop(&mut self) -> INLINK_STOP_W<IN_LINK_SPEC> {
121        INLINK_STOP_W::new(self, 28)
122    }
123    #[doc = "Bit 29 - Set this bit to enable DMA to read receive descriptors."]
124    #[inline(always)]
125    pub fn inlink_start(&mut self) -> INLINK_START_W<IN_LINK_SPEC> {
126        INLINK_START_W::new(self, 29)
127    }
128    #[doc = "Bit 30 - Set this bit to mount a new receive descriptor."]
129    #[inline(always)]
130    pub fn inlink_restart(&mut self) -> INLINK_RESTART_W<IN_LINK_SPEC> {
131        INLINK_RESTART_W::new(self, 30)
132    }
133}
134#[doc = "Link descriptor address and control\n\nYou can [`read`](crate::Reg::read) this register and get [`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 [`in_link::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
135pub struct IN_LINK_SPEC;
136impl crate::RegisterSpec for IN_LINK_SPEC {
137    type Ux = u32;
138}
139#[doc = "`read()` method returns [`in_link::R`](R) reader structure"]
140impl crate::Readable for IN_LINK_SPEC {}
141#[doc = "`write(|w| ..)` method takes [`in_link::W`](W) writer structure"]
142impl crate::Writable for IN_LINK_SPEC {
143    type Safety = crate::Unsafe;
144}
145#[doc = "`reset()` method sets IN_LINK to value 0x0010_0000"]
146impl crate::Resettable for IN_LINK_SPEC {
147    const RESET_VALUE: u32 = 0x0010_0000;
148}