1pub type R = crate::R<MCRrs>;
3pub type W = crate::W<MCRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum MODE1 {
12 NormalPinBuffer = 0,
14 NormalPinChipBuffer = 1,
16 NormalPinNoBuffer = 2,
18 NormalChipNoBuffer = 3,
20 ShpinBuffer = 4,
22 ShpinChipBuffer = 5,
24 ShpinNoBuffer = 6,
26 ShchipNoBuffer = 7,
28}
29impl From<MODE1> for u8 {
30 #[inline(always)]
31 fn from(variant: MODE1) -> Self {
32 variant as _
33 }
34}
35impl crate::FieldSpec for MODE1 {
36 type Ux = u8;
37}
38impl crate::IsEnum for MODE1 {}
39pub type MODE_R = crate::FieldReader<MODE1>;
41impl MODE_R {
42 #[inline(always)]
44 pub const fn variant(&self) -> MODE1 {
45 match self.bits {
46 0 => MODE1::NormalPinBuffer,
47 1 => MODE1::NormalPinChipBuffer,
48 2 => MODE1::NormalPinNoBuffer,
49 3 => MODE1::NormalChipNoBuffer,
50 4 => MODE1::ShpinBuffer,
51 5 => MODE1::ShpinChipBuffer,
52 6 => MODE1::ShpinNoBuffer,
53 7 => MODE1::ShchipNoBuffer,
54 _ => unreachable!(),
55 }
56 }
57 #[inline(always)]
59 pub fn is_normal_pin_buffer(&self) -> bool {
60 *self == MODE1::NormalPinBuffer
61 }
62 #[inline(always)]
64 pub fn is_normal_pin_chip_buffer(&self) -> bool {
65 *self == MODE1::NormalPinChipBuffer
66 }
67 #[inline(always)]
69 pub fn is_normal_pin_no_buffer(&self) -> bool {
70 *self == MODE1::NormalPinNoBuffer
71 }
72 #[inline(always)]
74 pub fn is_normal_chip_no_buffer(&self) -> bool {
75 *self == MODE1::NormalChipNoBuffer
76 }
77 #[inline(always)]
79 pub fn is_shpin_buffer(&self) -> bool {
80 *self == MODE1::ShpinBuffer
81 }
82 #[inline(always)]
84 pub fn is_shpin_chip_buffer(&self) -> bool {
85 *self == MODE1::ShpinChipBuffer
86 }
87 #[inline(always)]
89 pub fn is_shpin_no_buffer(&self) -> bool {
90 *self == MODE1::ShpinNoBuffer
91 }
92 #[inline(always)]
94 pub fn is_shchip_no_buffer(&self) -> bool {
95 *self == MODE1::ShchipNoBuffer
96 }
97}
98pub type MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, MODE1, crate::Safe>;
100impl<'a, REG> MODE_W<'a, REG>
101where
102 REG: crate::Writable + crate::RegisterSpec,
103 REG::Ux: From<u8>,
104{
105 #[inline(always)]
107 pub fn normal_pin_buffer(self) -> &'a mut crate::W<REG> {
108 self.variant(MODE1::NormalPinBuffer)
109 }
110 #[inline(always)]
112 pub fn normal_pin_chip_buffer(self) -> &'a mut crate::W<REG> {
113 self.variant(MODE1::NormalPinChipBuffer)
114 }
115 #[inline(always)]
117 pub fn normal_pin_no_buffer(self) -> &'a mut crate::W<REG> {
118 self.variant(MODE1::NormalPinNoBuffer)
119 }
120 #[inline(always)]
122 pub fn normal_chip_no_buffer(self) -> &'a mut crate::W<REG> {
123 self.variant(MODE1::NormalChipNoBuffer)
124 }
125 #[inline(always)]
127 pub fn shpin_buffer(self) -> &'a mut crate::W<REG> {
128 self.variant(MODE1::ShpinBuffer)
129 }
130 #[inline(always)]
132 pub fn shpin_chip_buffer(self) -> &'a mut crate::W<REG> {
133 self.variant(MODE1::ShpinChipBuffer)
134 }
135 #[inline(always)]
137 pub fn shpin_no_buffer(self) -> &'a mut crate::W<REG> {
138 self.variant(MODE1::ShpinNoBuffer)
139 }
140 #[inline(always)]
142 pub fn shchip_no_buffer(self) -> &'a mut crate::W<REG> {
143 self.variant(MODE1::ShchipNoBuffer)
144 }
145}
146#[cfg_attr(feature = "defmt", derive(defmt::Format))]
150#[derive(Clone, Copy, Debug, PartialEq, Eq)]
151pub enum DMADOUBLE1 {
152 Normal = 0,
154 DoubleData = 1,
156}
157impl From<DMADOUBLE1> for bool {
158 #[inline(always)]
159 fn from(variant: DMADOUBLE1) -> Self {
160 variant as u8 != 0
161 }
162}
163pub type DMADOUBLE_R = crate::BitReader<DMADOUBLE1>;
165impl DMADOUBLE_R {
166 #[inline(always)]
168 pub const fn variant(&self) -> DMADOUBLE1 {
169 match self.bits {
170 false => DMADOUBLE1::Normal,
171 true => DMADOUBLE1::DoubleData,
172 }
173 }
174 #[inline(always)]
176 pub fn is_normal(&self) -> bool {
177 *self == DMADOUBLE1::Normal
178 }
179 #[inline(always)]
181 pub fn is_double_data(&self) -> bool {
182 *self == DMADOUBLE1::DoubleData
183 }
184}
185pub type DMADOUBLE_W<'a, REG> = crate::BitWriter<'a, REG, DMADOUBLE1>;
187impl<'a, REG> DMADOUBLE_W<'a, REG>
188where
189 REG: crate::Writable + crate::RegisterSpec,
190{
191 #[inline(always)]
193 pub fn normal(self) -> &'a mut crate::W<REG> {
194 self.variant(DMADOUBLE1::Normal)
195 }
196 #[inline(always)]
198 pub fn double_data(self) -> &'a mut crate::W<REG> {
199 self.variant(DMADOUBLE1::DoubleData)
200 }
201}
202#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum SINFORMAT1 {
208 Unsigned = 0,
210 Signed = 1,
212}
213impl From<SINFORMAT1> for bool {
214 #[inline(always)]
215 fn from(variant: SINFORMAT1) -> Self {
216 variant as u8 != 0
217 }
218}
219pub type SINFORMAT_R = crate::BitReader<SINFORMAT1>;
221impl SINFORMAT_R {
222 #[inline(always)]
224 pub const fn variant(&self) -> SINFORMAT1 {
225 match self.bits {
226 false => SINFORMAT1::Unsigned,
227 true => SINFORMAT1::Signed,
228 }
229 }
230 #[inline(always)]
232 pub fn is_unsigned(&self) -> bool {
233 *self == SINFORMAT1::Unsigned
234 }
235 #[inline(always)]
237 pub fn is_signed(&self) -> bool {
238 *self == SINFORMAT1::Signed
239 }
240}
241pub type SINFORMAT_W<'a, REG> = crate::BitWriter<'a, REG, SINFORMAT1>;
243impl<'a, REG> SINFORMAT_W<'a, REG>
244where
245 REG: crate::Writable + crate::RegisterSpec,
246{
247 #[inline(always)]
249 pub fn unsigned(self) -> &'a mut crate::W<REG> {
250 self.variant(SINFORMAT1::Unsigned)
251 }
252 #[inline(always)]
254 pub fn signed(self) -> &'a mut crate::W<REG> {
255 self.variant(SINFORMAT1::Signed)
256 }
257}
258#[cfg_attr(feature = "defmt", derive(defmt::Format))]
262#[derive(Clone, Copy, Debug, PartialEq, Eq)]
263#[repr(u8)]
264pub enum HFSEL {
265 Disabled = 0,
267 More80mhz = 1,
269 More160mhz = 2,
271}
272impl From<HFSEL> for u8 {
273 #[inline(always)]
274 fn from(variant: HFSEL) -> Self {
275 variant as _
276 }
277}
278impl crate::FieldSpec for HFSEL {
279 type Ux = u8;
280}
281impl crate::IsEnum for HFSEL {}
282pub type HFSEL_R = crate::FieldReader<HFSEL>;
284impl HFSEL_R {
285 #[inline(always)]
287 pub const fn variant(&self) -> Option<HFSEL> {
288 match self.bits {
289 0 => Some(HFSEL::Disabled),
290 1 => Some(HFSEL::More80mhz),
291 2 => Some(HFSEL::More160mhz),
292 _ => None,
293 }
294 }
295 #[inline(always)]
297 pub fn is_disabled(&self) -> bool {
298 *self == HFSEL::Disabled
299 }
300 #[inline(always)]
302 pub fn is_more80mhz(&self) -> bool {
303 *self == HFSEL::More80mhz
304 }
305 #[inline(always)]
307 pub fn is_more160mhz(&self) -> bool {
308 *self == HFSEL::More160mhz
309 }
310}
311pub type HFSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HFSEL>;
313impl<'a, REG> HFSEL_W<'a, REG>
314where
315 REG: crate::Writable + crate::RegisterSpec,
316 REG::Ux: From<u8>,
317{
318 #[inline(always)]
320 pub fn disabled(self) -> &'a mut crate::W<REG> {
321 self.variant(HFSEL::Disabled)
322 }
323 #[inline(always)]
325 pub fn more80mhz(self) -> &'a mut crate::W<REG> {
326 self.variant(HFSEL::More80mhz)
327 }
328 #[inline(always)]
330 pub fn more160mhz(self) -> &'a mut crate::W<REG> {
331 self.variant(HFSEL::More160mhz)
332 }
333}
334impl R {
335 #[inline(always)]
339 pub fn mode(&self, n: u8) -> MODE_R {
340 #[allow(clippy::no_effect)]
341 [(); 2][n as usize];
342 MODE_R::new(((self.bits >> (n * 16)) & 7) as u8)
343 }
344 #[inline(always)]
347 pub fn mode_iter(&self) -> impl Iterator<Item = MODE_R> + '_ {
348 (0..2).map(move |n| MODE_R::new(((self.bits >> (n * 16)) & 7) as u8))
349 }
350 #[inline(always)]
352 pub fn mode1(&self) -> MODE_R {
353 MODE_R::new((self.bits & 7) as u8)
354 }
355 #[inline(always)]
357 pub fn mode2(&self) -> MODE_R {
358 MODE_R::new(((self.bits >> 16) & 7) as u8)
359 }
360 #[inline(always)]
364 pub fn dmadouble(&self, n: u8) -> DMADOUBLE_R {
365 #[allow(clippy::no_effect)]
366 [(); 2][n as usize];
367 DMADOUBLE_R::new(((self.bits >> (n * 16 + 8)) & 1) != 0)
368 }
369 #[inline(always)]
372 pub fn dmadouble_iter(&self) -> impl Iterator<Item = DMADOUBLE_R> + '_ {
373 (0..2).map(move |n| DMADOUBLE_R::new(((self.bits >> (n * 16 + 8)) & 1) != 0))
374 }
375 #[inline(always)]
377 pub fn dmadouble1(&self) -> DMADOUBLE_R {
378 DMADOUBLE_R::new(((self.bits >> 8) & 1) != 0)
379 }
380 #[inline(always)]
382 pub fn dmadouble2(&self) -> DMADOUBLE_R {
383 DMADOUBLE_R::new(((self.bits >> 24) & 1) != 0)
384 }
385 #[inline(always)]
389 pub fn sinformat(&self, n: u8) -> SINFORMAT_R {
390 #[allow(clippy::no_effect)]
391 [(); 2][n as usize];
392 SINFORMAT_R::new(((self.bits >> (n * 16 + 9)) & 1) != 0)
393 }
394 #[inline(always)]
397 pub fn sinformat_iter(&self) -> impl Iterator<Item = SINFORMAT_R> + '_ {
398 (0..2).map(move |n| SINFORMAT_R::new(((self.bits >> (n * 16 + 9)) & 1) != 0))
399 }
400 #[inline(always)]
402 pub fn sinformat1(&self) -> SINFORMAT_R {
403 SINFORMAT_R::new(((self.bits >> 9) & 1) != 0)
404 }
405 #[inline(always)]
407 pub fn sinformat2(&self) -> SINFORMAT_R {
408 SINFORMAT_R::new(((self.bits >> 25) & 1) != 0)
409 }
410 #[inline(always)]
412 pub fn hfsel(&self) -> HFSEL_R {
413 HFSEL_R::new(((self.bits >> 14) & 3) as u8)
414 }
415}
416impl core::fmt::Debug for R {
417 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
418 f.debug_struct("MCR")
419 .field("mode1", &self.mode1())
420 .field("mode2", &self.mode2())
421 .field("dmadouble1", &self.dmadouble1())
422 .field("dmadouble2", &self.dmadouble2())
423 .field("sinformat1", &self.sinformat1())
424 .field("sinformat2", &self.sinformat2())
425 .field("hfsel", &self.hfsel())
426 .finish()
427 }
428}
429impl W {
430 #[inline(always)]
434 pub fn mode(&mut self, n: u8) -> MODE_W<MCRrs> {
435 #[allow(clippy::no_effect)]
436 [(); 2][n as usize];
437 MODE_W::new(self, n * 16)
438 }
439 #[inline(always)]
441 pub fn mode1(&mut self) -> MODE_W<MCRrs> {
442 MODE_W::new(self, 0)
443 }
444 #[inline(always)]
446 pub fn mode2(&mut self) -> MODE_W<MCRrs> {
447 MODE_W::new(self, 16)
448 }
449 #[inline(always)]
453 pub fn dmadouble(&mut self, n: u8) -> DMADOUBLE_W<MCRrs> {
454 #[allow(clippy::no_effect)]
455 [(); 2][n as usize];
456 DMADOUBLE_W::new(self, n * 16 + 8)
457 }
458 #[inline(always)]
460 pub fn dmadouble1(&mut self) -> DMADOUBLE_W<MCRrs> {
461 DMADOUBLE_W::new(self, 8)
462 }
463 #[inline(always)]
465 pub fn dmadouble2(&mut self) -> DMADOUBLE_W<MCRrs> {
466 DMADOUBLE_W::new(self, 24)
467 }
468 #[inline(always)]
472 pub fn sinformat(&mut self, n: u8) -> SINFORMAT_W<MCRrs> {
473 #[allow(clippy::no_effect)]
474 [(); 2][n as usize];
475 SINFORMAT_W::new(self, n * 16 + 9)
476 }
477 #[inline(always)]
479 pub fn sinformat1(&mut self) -> SINFORMAT_W<MCRrs> {
480 SINFORMAT_W::new(self, 9)
481 }
482 #[inline(always)]
484 pub fn sinformat2(&mut self) -> SINFORMAT_W<MCRrs> {
485 SINFORMAT_W::new(self, 25)
486 }
487 #[inline(always)]
489 pub fn hfsel(&mut self) -> HFSEL_W<MCRrs> {
490 HFSEL_W::new(self, 14)
491 }
492}
493pub struct MCRrs;
499impl crate::RegisterSpec for MCRrs {
500 type Ux = u32;
501}
502impl crate::Readable for MCRrs {}
504impl crate::Writable for MCRrs {
506 type Safety = crate::Unsafe;
507}
508impl crate::Resettable for MCRrs {}