esp32s2/crypto_dma/
out_link.rs1#[doc = "Register `OUT_LINK` reader"]
2pub type R = crate::R<OUT_LINK_SPEC>;
3#[doc = "Register `OUT_LINK` writer"]
4pub type W = crate::W<OUT_LINK_SPEC>;
5#[doc = "Field `OUTLINK_ADDR` reader - This register stores the 20 least significant bits of the first transmit descriptor’s address."]
6pub type OUTLINK_ADDR_R = crate::FieldReader<u32>;
7#[doc = "Field `OUTLINK_ADDR` writer - This register stores the 20 least significant bits of the first transmit descriptor’s address."]
8pub type OUTLINK_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>;
9#[doc = "Field `OUTLINK_STOP` reader - Set this bit to stop DMA from reading transmit descriptors after finishing the current data transaction."]
10pub type OUTLINK_STOP_R = crate::BitReader;
11#[doc = "Field `OUTLINK_STOP` writer - Set this bit to stop DMA from reading transmit descriptors after finishing the current data transaction."]
12pub type OUTLINK_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `OUTLINK_START` reader - Set this bit to enable DMA to read transmit descriptors."]
14pub type OUTLINK_START_R = crate::BitReader;
15#[doc = "Field `OUTLINK_START` writer - Set this bit to enable DMA to read transmit descriptors."]
16pub type OUTLINK_START_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `OUTLINK_RESTART` reader - Set this bit to restart a new outlink from the last address."]
18pub type OUTLINK_RESTART_R = crate::BitReader;
19#[doc = "Field `OUTLINK_RESTART` writer - Set this bit to restart a new outlink from the last address."]
20pub type OUTLINK_RESTART_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "1: the transmit descriptor’s FSM is in idle state. 0: the transmit descriptor’s FSM is working.\n\nValue on reset: 0"]
22#[cfg_attr(feature = "defmt", derive(defmt::Format))]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24pub enum OUTLINK_PARK {
25 #[doc = "0: The transmit descriptor’s FSM is working"]
26 Working = 0,
27 #[doc = "1: The transmit descriptor’s FSM is in idle state"]
28 Idle = 1,
29}
30impl From<OUTLINK_PARK> for bool {
31 #[inline(always)]
32 fn from(variant: OUTLINK_PARK) -> Self {
33 variant as u8 != 0
34 }
35}
36#[doc = "Field `OUTLINK_PARK` reader - 1: the transmit descriptor’s FSM is in idle state. 0: the transmit descriptor’s FSM is working."]
37pub type OUTLINK_PARK_R = crate::BitReader<OUTLINK_PARK>;
38impl OUTLINK_PARK_R {
39 #[doc = "Get enumerated values variant"]
40 #[inline(always)]
41 pub const fn variant(&self) -> OUTLINK_PARK {
42 match self.bits {
43 false => OUTLINK_PARK::Working,
44 true => OUTLINK_PARK::Idle,
45 }
46 }
47 #[doc = "The transmit descriptor’s FSM is working"]
48 #[inline(always)]
49 pub fn is_working(&self) -> bool {
50 *self == OUTLINK_PARK::Working
51 }
52 #[doc = "The transmit descriptor’s FSM is in idle state"]
53 #[inline(always)]
54 pub fn is_idle(&self) -> bool {
55 *self == OUTLINK_PARK::Idle
56 }
57}
58impl R {
59 #[doc = "Bits 0:19 - This register stores the 20 least significant bits of the first transmit descriptor’s address."]
60 #[inline(always)]
61 pub fn outlink_addr(&self) -> OUTLINK_ADDR_R {
62 OUTLINK_ADDR_R::new(self.bits & 0x000f_ffff)
63 }
64 #[doc = "Bit 28 - Set this bit to stop DMA from reading transmit descriptors after finishing the current data transaction."]
65 #[inline(always)]
66 pub fn outlink_stop(&self) -> OUTLINK_STOP_R {
67 OUTLINK_STOP_R::new(((self.bits >> 28) & 1) != 0)
68 }
69 #[doc = "Bit 29 - Set this bit to enable DMA to read transmit descriptors."]
70 #[inline(always)]
71 pub fn outlink_start(&self) -> OUTLINK_START_R {
72 OUTLINK_START_R::new(((self.bits >> 29) & 1) != 0)
73 }
74 #[doc = "Bit 30 - Set this bit to restart a new outlink from the last address."]
75 #[inline(always)]
76 pub fn outlink_restart(&self) -> OUTLINK_RESTART_R {
77 OUTLINK_RESTART_R::new(((self.bits >> 30) & 1) != 0)
78 }
79 #[doc = "Bit 31 - 1: the transmit descriptor’s FSM is in idle state. 0: the transmit descriptor’s FSM is working."]
80 #[inline(always)]
81 pub fn outlink_park(&self) -> OUTLINK_PARK_R {
82 OUTLINK_PARK_R::new(((self.bits >> 31) & 1) != 0)
83 }
84}
85#[cfg(feature = "impl-register-debug")]
86impl core::fmt::Debug for R {
87 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
88 f.debug_struct("OUT_LINK")
89 .field("outlink_addr", &self.outlink_addr())
90 .field("outlink_stop", &self.outlink_stop())
91 .field("outlink_start", &self.outlink_start())
92 .field("outlink_restart", &self.outlink_restart())
93 .field("outlink_park", &self.outlink_park())
94 .finish()
95 }
96}
97impl W {
98 #[doc = "Bits 0:19 - This register stores the 20 least significant bits of the first transmit descriptor’s address."]
99 #[inline(always)]
100 pub fn outlink_addr(&mut self) -> OUTLINK_ADDR_W<OUT_LINK_SPEC> {
101 OUTLINK_ADDR_W::new(self, 0)
102 }
103 #[doc = "Bit 28 - Set this bit to stop DMA from reading transmit descriptors after finishing the current data transaction."]
104 #[inline(always)]
105 pub fn outlink_stop(&mut self) -> OUTLINK_STOP_W<OUT_LINK_SPEC> {
106 OUTLINK_STOP_W::new(self, 28)
107 }
108 #[doc = "Bit 29 - Set this bit to enable DMA to read transmit descriptors."]
109 #[inline(always)]
110 pub fn outlink_start(&mut self) -> OUTLINK_START_W<OUT_LINK_SPEC> {
111 OUTLINK_START_W::new(self, 29)
112 }
113 #[doc = "Bit 30 - Set this bit to restart a new outlink from the last address."]
114 #[inline(always)]
115 pub fn outlink_restart(&mut self) -> OUTLINK_RESTART_W<OUT_LINK_SPEC> {
116 OUTLINK_RESTART_W::new(self, 30)
117 }
118}
119#[doc = "Link descriptor address and control\n\nYou can [`read`](crate::Reg::read) this register and get [`out_link::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`out_link::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
120pub struct OUT_LINK_SPEC;
121impl crate::RegisterSpec for OUT_LINK_SPEC {
122 type Ux = u32;
123}
124#[doc = "`read()` method returns [`out_link::R`](R) reader structure"]
125impl crate::Readable for OUT_LINK_SPEC {}
126#[doc = "`write(|w| ..)` method takes [`out_link::W`](W) writer structure"]
127impl crate::Writable for OUT_LINK_SPEC {
128 type Safety = crate::Unsafe;
129}
130#[doc = "`reset()` method sets OUT_LINK to value 0"]
131impl crate::Resettable for OUT_LINK_SPEC {}