-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathconf.rs
217 lines (217 loc) · 9.64 KB
/
conf.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#[doc = "Register `CONF` reader"]
pub type R = crate::R<CONF_SPEC>;
#[doc = "Register `CONF` writer"]
pub type W = crate::W<CONF_SPEC>;
#[doc = "Field `IN_RST` reader - Set this bit to reset in DMA FSM."]
pub type IN_RST_R = crate::BitReader;
#[doc = "Field `IN_RST` writer - Set this bit to reset in DMA FSM."]
pub type IN_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `OUT_RST` reader - Set this bit to reset out DMA FSM."]
pub type OUT_RST_R = crate::BitReader;
#[doc = "Field `OUT_RST` writer - Set this bit to reset out DMA FSM."]
pub type OUT_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CMDFIFO_RST` reader - Set this bit to reset in_cmd FIFO and out_cmd FIFO."]
pub type CMDFIFO_RST_R = crate::BitReader;
#[doc = "Field `CMDFIFO_RST` writer - Set this bit to reset in_cmd FIFO and out_cmd FIFO."]
pub type CMDFIFO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `FIFO_RST` reader - Set this bit to reset data in RX FIFO."]
pub type FIFO_RST_R = crate::BitReader;
#[doc = "Field `FIFO_RST` writer - Set this bit to reset data in RX FIFO."]
pub type FIFO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `OUT_OWNER` reader - This is used to configure the owner bit in transmit descriptor. This is effective only when you set OUT_AUTO_WRBACK."]
pub type OUT_OWNER_R = crate::BitReader;
#[doc = "Field `OUT_OWNER` writer - This is used to configure the owner bit in transmit descriptor. This is effective only when you set OUT_AUTO_WRBACK."]
pub type OUT_OWNER_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `IN_OWNER` reader - This is used to configure the owner bit in receive descriptor."]
pub type IN_OWNER_R = crate::BitReader;
#[doc = "Field `IN_OWNER` writer - This is used to configure the owner bit in receive descriptor."]
pub type IN_OWNER_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `OUT_AUTO_WRBACK` reader - This bit is used to write back out descriptor when hardware has already used this descriptor."]
pub type OUT_AUTO_WRBACK_R = crate::BitReader;
#[doc = "Field `OUT_AUTO_WRBACK` writer - This bit is used to write back out descriptor when hardware has already used this descriptor."]
pub type OUT_AUTO_WRBACK_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHECK_OWNER` reader - Set this bit to enable owner bit check in descriptor."]
pub type CHECK_OWNER_R = crate::BitReader;
#[doc = "Field `CHECK_OWNER` writer - Set this bit to enable owner bit check in descriptor."]
pub type CHECK_OWNER_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "1’b1: Force clock on for register. 1’b0: Support clock only when application writes registers.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CLK_EN {
#[doc = "0: Support clock only when application writes registers"]
OnWrite = 0,
#[doc = "1: Force clock on for register"]
Force = 1,
}
impl From<CLK_EN> for bool {
#[inline(always)]
fn from(variant: CLK_EN) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CLK_EN` reader - 1’b1: Force clock on for register. 1’b0: Support clock only when application writes registers."]
pub type CLK_EN_R = crate::BitReader<CLK_EN>;
impl CLK_EN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> CLK_EN {
match self.bits {
false => CLK_EN::OnWrite,
true => CLK_EN::Force,
}
}
#[doc = "Support clock only when application writes registers"]
#[inline(always)]
pub fn is_on_write(&self) -> bool {
*self == CLK_EN::OnWrite
}
#[doc = "Force clock on for register"]
#[inline(always)]
pub fn is_force(&self) -> bool {
*self == CLK_EN::Force
}
}
#[doc = "Field `CLK_EN` writer - 1’b1: Force clock on for register. 1’b0: Support clock only when application writes registers."]
pub type CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG, CLK_EN>;
impl<'a, REG> CLK_EN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[doc = "Support clock only when application writes registers"]
#[inline(always)]
pub fn on_write(self) -> &'a mut crate::W<REG> {
self.variant(CLK_EN::OnWrite)
}
#[doc = "Force clock on for register"]
#[inline(always)]
pub fn force(self) -> &'a mut crate::W<REG> {
self.variant(CLK_EN::Force)
}
}
impl R {
#[doc = "Bit 0 - Set this bit to reset in DMA FSM."]
#[inline(always)]
pub fn in_rst(&self) -> IN_RST_R {
IN_RST_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Set this bit to reset out DMA FSM."]
#[inline(always)]
pub fn out_rst(&self) -> OUT_RST_R {
OUT_RST_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Set this bit to reset in_cmd FIFO and out_cmd FIFO."]
#[inline(always)]
pub fn cmdfifo_rst(&self) -> CMDFIFO_RST_R {
CMDFIFO_RST_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 3 - Set this bit to reset data in RX FIFO."]
#[inline(always)]
pub fn fifo_rst(&self) -> FIFO_RST_R {
FIFO_RST_R::new(((self.bits >> 3) & 1) != 0)
}
#[doc = "Bit 4 - This is used to configure the owner bit in transmit descriptor. This is effective only when you set OUT_AUTO_WRBACK."]
#[inline(always)]
pub fn out_owner(&self) -> OUT_OWNER_R {
OUT_OWNER_R::new(((self.bits >> 4) & 1) != 0)
}
#[doc = "Bit 5 - This is used to configure the owner bit in receive descriptor."]
#[inline(always)]
pub fn in_owner(&self) -> IN_OWNER_R {
IN_OWNER_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 6 - This bit is used to write back out descriptor when hardware has already used this descriptor."]
#[inline(always)]
pub fn out_auto_wrback(&self) -> OUT_AUTO_WRBACK_R {
OUT_AUTO_WRBACK_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 7 - Set this bit to enable owner bit check in descriptor."]
#[inline(always)]
pub fn check_owner(&self) -> CHECK_OWNER_R {
CHECK_OWNER_R::new(((self.bits >> 7) & 1) != 0)
}
#[doc = "Bit 31 - 1’b1: Force clock on for register. 1’b0: Support clock only when application writes registers."]
#[inline(always)]
pub fn clk_en(&self) -> CLK_EN_R {
CLK_EN_R::new(((self.bits >> 31) & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CONF")
.field("in_rst", &self.in_rst())
.field("out_rst", &self.out_rst())
.field("cmdfifo_rst", &self.cmdfifo_rst())
.field("fifo_rst", &self.fifo_rst())
.field("out_owner", &self.out_owner())
.field("in_owner", &self.in_owner())
.field("out_auto_wrback", &self.out_auto_wrback())
.field("check_owner", &self.check_owner())
.field("clk_en", &self.clk_en())
.finish()
}
}
impl W {
#[doc = "Bit 0 - Set this bit to reset in DMA FSM."]
#[inline(always)]
pub fn in_rst(&mut self) -> IN_RST_W<CONF_SPEC> {
IN_RST_W::new(self, 0)
}
#[doc = "Bit 1 - Set this bit to reset out DMA FSM."]
#[inline(always)]
pub fn out_rst(&mut self) -> OUT_RST_W<CONF_SPEC> {
OUT_RST_W::new(self, 1)
}
#[doc = "Bit 2 - Set this bit to reset in_cmd FIFO and out_cmd FIFO."]
#[inline(always)]
pub fn cmdfifo_rst(&mut self) -> CMDFIFO_RST_W<CONF_SPEC> {
CMDFIFO_RST_W::new(self, 2)
}
#[doc = "Bit 3 - Set this bit to reset data in RX FIFO."]
#[inline(always)]
pub fn fifo_rst(&mut self) -> FIFO_RST_W<CONF_SPEC> {
FIFO_RST_W::new(self, 3)
}
#[doc = "Bit 4 - This is used to configure the owner bit in transmit descriptor. This is effective only when you set OUT_AUTO_WRBACK."]
#[inline(always)]
pub fn out_owner(&mut self) -> OUT_OWNER_W<CONF_SPEC> {
OUT_OWNER_W::new(self, 4)
}
#[doc = "Bit 5 - This is used to configure the owner bit in receive descriptor."]
#[inline(always)]
pub fn in_owner(&mut self) -> IN_OWNER_W<CONF_SPEC> {
IN_OWNER_W::new(self, 5)
}
#[doc = "Bit 6 - This bit is used to write back out descriptor when hardware has already used this descriptor."]
#[inline(always)]
pub fn out_auto_wrback(&mut self) -> OUT_AUTO_WRBACK_W<CONF_SPEC> {
OUT_AUTO_WRBACK_W::new(self, 6)
}
#[doc = "Bit 7 - Set this bit to enable owner bit check in descriptor."]
#[inline(always)]
pub fn check_owner(&mut self) -> CHECK_OWNER_W<CONF_SPEC> {
CHECK_OWNER_W::new(self, 7)
}
#[doc = "Bit 31 - 1’b1: Force clock on for register. 1’b0: Support clock only when application writes registers."]
#[inline(always)]
pub fn clk_en(&mut self) -> CLK_EN_W<CONF_SPEC> {
CLK_EN_W::new(self, 31)
}
}
#[doc = "Copy DMA configuration register\n\nYou can [`read`](crate::Reg::read) this register and get [`conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CONF_SPEC;
impl crate::RegisterSpec for CONF_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`conf::R`](R) reader structure"]
impl crate::Readable for CONF_SPEC {}
#[doc = "`write(|w| ..)` method takes [`conf::W`](W) writer structure"]
impl crate::Writable for CONF_SPEC {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CONF to value 0"]
impl crate::Resettable for CONF_SPEC {
const RESET_VALUE: u32 = 0;
}