saml10d16a/dmac/
qosctrl.rs1#[doc = "Reader of register QOSCTRL"]
2pub type R = crate::R<u8, super::QOSCTRL>;
3#[doc = "Writer for register QOSCTRL"]
4pub type W = crate::W<u8, super::QOSCTRL>;
5#[doc = "Register QOSCTRL `reset()`'s with value 0x2a"]
6impl crate::ResetValue for super::QOSCTRL {
7 type Type = u8;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0x2a
11 }
12}
13#[doc = "Possible values of the field `WRBQOS`"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum WRBQOS_A {
16 #[doc = "Background (no sensitive operation)"]
17 DISABLE,
18 #[doc = "Sensitive Bandwidth"]
19 LOW,
20 #[doc = "Sensitive Latency"]
21 MEDIUM,
22 #[doc = "Critical Latency"]
23 HIGH,
24}
25impl crate::ToBits<u8> for WRBQOS_A {
26 #[inline(always)]
27 fn _bits(&self) -> u8 {
28 match *self {
29 WRBQOS_A::DISABLE => 0,
30 WRBQOS_A::LOW => 1,
31 WRBQOS_A::MEDIUM => 2,
32 WRBQOS_A::HIGH => 3,
33 }
34 }
35}
36#[doc = "Reader of field `WRBQOS`"]
37pub type WRBQOS_R = crate::R<u8, WRBQOS_A>;
38impl WRBQOS_R {
39 #[doc = r"Get enumerated values variant"]
40 #[inline(always)]
41 pub fn variant(&self) -> WRBQOS_A {
42 match self.bits {
43 0 => WRBQOS_A::DISABLE,
44 1 => WRBQOS_A::LOW,
45 2 => WRBQOS_A::MEDIUM,
46 3 => WRBQOS_A::HIGH,
47 _ => unreachable!(),
48 }
49 }
50 #[doc = "Checks if the value of the field is `DISABLE`"]
51 #[inline(always)]
52 pub fn is_disable(&self) -> bool {
53 *self == WRBQOS_A::DISABLE
54 }
55 #[doc = "Checks if the value of the field is `LOW`"]
56 #[inline(always)]
57 pub fn is_low(&self) -> bool {
58 *self == WRBQOS_A::LOW
59 }
60 #[doc = "Checks if the value of the field is `MEDIUM`"]
61 #[inline(always)]
62 pub fn is_medium(&self) -> bool {
63 *self == WRBQOS_A::MEDIUM
64 }
65 #[doc = "Checks if the value of the field is `HIGH`"]
66 #[inline(always)]
67 pub fn is_high(&self) -> bool {
68 *self == WRBQOS_A::HIGH
69 }
70}
71#[doc = "Write proxy for field `WRBQOS`"]
72pub struct WRBQOS_W<'a> {
73 w: &'a mut W,
74}
75impl<'a> WRBQOS_W<'a> {
76 #[doc = r"Writes `variant` to the field"]
77 #[inline(always)]
78 pub fn variant(self, variant: WRBQOS_A) -> &'a mut W {
79 use crate::ToBits;
80 {
81 self.bits(variant._bits())
82 }
83 }
84 #[doc = "Background (no sensitive operation)"]
85 #[inline(always)]
86 pub fn disable(self) -> &'a mut W {
87 self.variant(WRBQOS_A::DISABLE)
88 }
89 #[doc = "Sensitive Bandwidth"]
90 #[inline(always)]
91 pub fn low(self) -> &'a mut W {
92 self.variant(WRBQOS_A::LOW)
93 }
94 #[doc = "Sensitive Latency"]
95 #[inline(always)]
96 pub fn medium(self) -> &'a mut W {
97 self.variant(WRBQOS_A::MEDIUM)
98 }
99 #[doc = "Critical Latency"]
100 #[inline(always)]
101 pub fn high(self) -> &'a mut W {
102 self.variant(WRBQOS_A::HIGH)
103 }
104 #[doc = r"Writes raw bits to the field"]
105 #[inline(always)]
106 pub fn bits(self, value: u8) -> &'a mut W {
107 self.w.bits = (self.w.bits & !0x03) | ((value as u8) & 0x03);
108 self.w
109 }
110}
111#[doc = "Possible values of the field `FQOS`"]
112#[derive(Clone, Copy, Debug, PartialEq)]
113pub enum FQOS_A {
114 #[doc = "Background (no sensitive operation)"]
115 DISABLE,
116 #[doc = "Sensitive Bandwidth"]
117 LOW,
118 #[doc = "Sensitive Latency"]
119 MEDIUM,
120 #[doc = "Critical Latency"]
121 HIGH,
122}
123impl crate::ToBits<u8> for FQOS_A {
124 #[inline(always)]
125 fn _bits(&self) -> u8 {
126 match *self {
127 FQOS_A::DISABLE => 0,
128 FQOS_A::LOW => 1,
129 FQOS_A::MEDIUM => 2,
130 FQOS_A::HIGH => 3,
131 }
132 }
133}
134#[doc = "Reader of field `FQOS`"]
135pub type FQOS_R = crate::R<u8, FQOS_A>;
136impl FQOS_R {
137 #[doc = r"Get enumerated values variant"]
138 #[inline(always)]
139 pub fn variant(&self) -> FQOS_A {
140 match self.bits {
141 0 => FQOS_A::DISABLE,
142 1 => FQOS_A::LOW,
143 2 => FQOS_A::MEDIUM,
144 3 => FQOS_A::HIGH,
145 _ => unreachable!(),
146 }
147 }
148 #[doc = "Checks if the value of the field is `DISABLE`"]
149 #[inline(always)]
150 pub fn is_disable(&self) -> bool {
151 *self == FQOS_A::DISABLE
152 }
153 #[doc = "Checks if the value of the field is `LOW`"]
154 #[inline(always)]
155 pub fn is_low(&self) -> bool {
156 *self == FQOS_A::LOW
157 }
158 #[doc = "Checks if the value of the field is `MEDIUM`"]
159 #[inline(always)]
160 pub fn is_medium(&self) -> bool {
161 *self == FQOS_A::MEDIUM
162 }
163 #[doc = "Checks if the value of the field is `HIGH`"]
164 #[inline(always)]
165 pub fn is_high(&self) -> bool {
166 *self == FQOS_A::HIGH
167 }
168}
169#[doc = "Write proxy for field `FQOS`"]
170pub struct FQOS_W<'a> {
171 w: &'a mut W,
172}
173impl<'a> FQOS_W<'a> {
174 #[doc = r"Writes `variant` to the field"]
175 #[inline(always)]
176 pub fn variant(self, variant: FQOS_A) -> &'a mut W {
177 use crate::ToBits;
178 {
179 self.bits(variant._bits())
180 }
181 }
182 #[doc = "Background (no sensitive operation)"]
183 #[inline(always)]
184 pub fn disable(self) -> &'a mut W {
185 self.variant(FQOS_A::DISABLE)
186 }
187 #[doc = "Sensitive Bandwidth"]
188 #[inline(always)]
189 pub fn low(self) -> &'a mut W {
190 self.variant(FQOS_A::LOW)
191 }
192 #[doc = "Sensitive Latency"]
193 #[inline(always)]
194 pub fn medium(self) -> &'a mut W {
195 self.variant(FQOS_A::MEDIUM)
196 }
197 #[doc = "Critical Latency"]
198 #[inline(always)]
199 pub fn high(self) -> &'a mut W {
200 self.variant(FQOS_A::HIGH)
201 }
202 #[doc = r"Writes raw bits to the field"]
203 #[inline(always)]
204 pub fn bits(self, value: u8) -> &'a mut W {
205 self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u8) & 0x03) << 2);
206 self.w
207 }
208}
209#[doc = "Possible values of the field `DQOS`"]
210#[derive(Clone, Copy, Debug, PartialEq)]
211pub enum DQOS_A {
212 #[doc = "Background (no sensitive operation)"]
213 DISABLE,
214 #[doc = "Sensitive Bandwidth"]
215 LOW,
216 #[doc = "Sensitive Latency"]
217 MEDIUM,
218 #[doc = "Critical Latency"]
219 HIGH,
220}
221impl crate::ToBits<u8> for DQOS_A {
222 #[inline(always)]
223 fn _bits(&self) -> u8 {
224 match *self {
225 DQOS_A::DISABLE => 0,
226 DQOS_A::LOW => 1,
227 DQOS_A::MEDIUM => 2,
228 DQOS_A::HIGH => 3,
229 }
230 }
231}
232#[doc = "Reader of field `DQOS`"]
233pub type DQOS_R = crate::R<u8, DQOS_A>;
234impl DQOS_R {
235 #[doc = r"Get enumerated values variant"]
236 #[inline(always)]
237 pub fn variant(&self) -> DQOS_A {
238 match self.bits {
239 0 => DQOS_A::DISABLE,
240 1 => DQOS_A::LOW,
241 2 => DQOS_A::MEDIUM,
242 3 => DQOS_A::HIGH,
243 _ => unreachable!(),
244 }
245 }
246 #[doc = "Checks if the value of the field is `DISABLE`"]
247 #[inline(always)]
248 pub fn is_disable(&self) -> bool {
249 *self == DQOS_A::DISABLE
250 }
251 #[doc = "Checks if the value of the field is `LOW`"]
252 #[inline(always)]
253 pub fn is_low(&self) -> bool {
254 *self == DQOS_A::LOW
255 }
256 #[doc = "Checks if the value of the field is `MEDIUM`"]
257 #[inline(always)]
258 pub fn is_medium(&self) -> bool {
259 *self == DQOS_A::MEDIUM
260 }
261 #[doc = "Checks if the value of the field is `HIGH`"]
262 #[inline(always)]
263 pub fn is_high(&self) -> bool {
264 *self == DQOS_A::HIGH
265 }
266}
267#[doc = "Write proxy for field `DQOS`"]
268pub struct DQOS_W<'a> {
269 w: &'a mut W,
270}
271impl<'a> DQOS_W<'a> {
272 #[doc = r"Writes `variant` to the field"]
273 #[inline(always)]
274 pub fn variant(self, variant: DQOS_A) -> &'a mut W {
275 use crate::ToBits;
276 {
277 self.bits(variant._bits())
278 }
279 }
280 #[doc = "Background (no sensitive operation)"]
281 #[inline(always)]
282 pub fn disable(self) -> &'a mut W {
283 self.variant(DQOS_A::DISABLE)
284 }
285 #[doc = "Sensitive Bandwidth"]
286 #[inline(always)]
287 pub fn low(self) -> &'a mut W {
288 self.variant(DQOS_A::LOW)
289 }
290 #[doc = "Sensitive Latency"]
291 #[inline(always)]
292 pub fn medium(self) -> &'a mut W {
293 self.variant(DQOS_A::MEDIUM)
294 }
295 #[doc = "Critical Latency"]
296 #[inline(always)]
297 pub fn high(self) -> &'a mut W {
298 self.variant(DQOS_A::HIGH)
299 }
300 #[doc = r"Writes raw bits to the field"]
301 #[inline(always)]
302 pub fn bits(self, value: u8) -> &'a mut W {
303 self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u8) & 0x03) << 4);
304 self.w
305 }
306}
307impl R {
308 #[doc = "Bits 0:1 - Write-Back Quality of Service"]
309 #[inline(always)]
310 pub fn wrbqos(&self) -> WRBQOS_R {
311 WRBQOS_R::new((self.bits & 0x03) as u8)
312 }
313 #[doc = "Bits 2:3 - Fetch Quality of Service"]
314 #[inline(always)]
315 pub fn fqos(&self) -> FQOS_R {
316 FQOS_R::new(((self.bits >> 2) & 0x03) as u8)
317 }
318 #[doc = "Bits 4:5 - Data Transfer Quality of Service"]
319 #[inline(always)]
320 pub fn dqos(&self) -> DQOS_R {
321 DQOS_R::new(((self.bits >> 4) & 0x03) as u8)
322 }
323}
324impl W {
325 #[doc = "Bits 0:1 - Write-Back Quality of Service"]
326 #[inline(always)]
327 pub fn wrbqos(&mut self) -> WRBQOS_W {
328 WRBQOS_W { w: self }
329 }
330 #[doc = "Bits 2:3 - Fetch Quality of Service"]
331 #[inline(always)]
332 pub fn fqos(&mut self) -> FQOS_W {
333 FQOS_W { w: self }
334 }
335 #[doc = "Bits 4:5 - Data Transfer Quality of Service"]
336 #[inline(always)]
337 pub fn dqos(&mut self) -> DQOS_W {
338 DQOS_W { w: self }
339 }
340}