1#[doc = "Register `SPCMD0` reader"]
2pub struct R(crate::R<SPCMD0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SPCMD0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SPCMD0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SPCMD0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SPCMD0` writer"]
17pub struct W(crate::W<SPCMD0_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SPCMD0_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<SPCMD0_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SPCMD0_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CPHA` reader - RSPCK Phase Setting"]
38pub type CPHA_R = crate::BitReader<CPHA_A>;
39#[doc = "RSPCK Phase Setting\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum CPHA_A {
42 #[doc = "0: Data sampling on odd edge, data variation on even edge"]
43 _0 = 0,
44 #[doc = "1: Data variation on odd edge, data sampling on even edge"]
45 _1 = 1,
46}
47impl From<CPHA_A> for bool {
48 #[inline(always)]
49 fn from(variant: CPHA_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl CPHA_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> CPHA_A {
57 match self.bits {
58 false => CPHA_A::_0,
59 true => CPHA_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == CPHA_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == CPHA_A::_1
71 }
72}
73#[doc = "Field `CPHA` writer - RSPCK Phase Setting"]
74pub type CPHA_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, CPHA_A, O>;
75impl<'a, const O: u8> CPHA_W<'a, O> {
76 #[doc = "Data sampling on odd edge, data variation on even edge"]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(CPHA_A::_0)
80 }
81 #[doc = "Data variation on odd edge, data sampling on even edge"]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(CPHA_A::_1)
85 }
86}
87#[doc = "Field `CPOL` reader - RSPCK Polarity Setting"]
88pub type CPOL_R = crate::BitReader<CPOL_A>;
89#[doc = "RSPCK Polarity Setting\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum CPOL_A {
92 #[doc = "0: RSPCK is low when idle"]
93 _0 = 0,
94 #[doc = "1: RSPCK is high when idle"]
95 _1 = 1,
96}
97impl From<CPOL_A> for bool {
98 #[inline(always)]
99 fn from(variant: CPOL_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl CPOL_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> CPOL_A {
107 match self.bits {
108 false => CPOL_A::_0,
109 true => CPOL_A::_1,
110 }
111 }
112 #[doc = "Checks if the value of the field is `_0`"]
113 #[inline(always)]
114 pub fn is_0(&self) -> bool {
115 *self == CPOL_A::_0
116 }
117 #[doc = "Checks if the value of the field is `_1`"]
118 #[inline(always)]
119 pub fn is_1(&self) -> bool {
120 *self == CPOL_A::_1
121 }
122}
123#[doc = "Field `CPOL` writer - RSPCK Polarity Setting"]
124pub type CPOL_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, CPOL_A, O>;
125impl<'a, const O: u8> CPOL_W<'a, O> {
126 #[doc = "RSPCK is low when idle"]
127 #[inline(always)]
128 pub fn _0(self) -> &'a mut W {
129 self.variant(CPOL_A::_0)
130 }
131 #[doc = "RSPCK is high when idle"]
132 #[inline(always)]
133 pub fn _1(self) -> &'a mut W {
134 self.variant(CPOL_A::_1)
135 }
136}
137#[doc = "Field `BRDV` reader - Bit Rate Division Setting"]
138pub type BRDV_R = crate::FieldReader<u8, BRDV_A>;
139#[doc = "Bit Rate Division Setting\n\nValue on reset: 3"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141#[repr(u8)]
142pub enum BRDV_A {
143 #[doc = "0: These bits select the base bit rate"]
144 _00 = 0,
145 #[doc = "1: These bits select the base bit rate divided by 2"]
146 _01 = 1,
147 #[doc = "2: These bits select the base bit rate divided by 4"]
148 _10 = 2,
149 #[doc = "3: These bits select the base bit rate divided by 8"]
150 _11 = 3,
151}
152impl From<BRDV_A> for u8 {
153 #[inline(always)]
154 fn from(variant: BRDV_A) -> Self {
155 variant as _
156 }
157}
158impl BRDV_R {
159 #[doc = "Get enumerated values variant"]
160 #[inline(always)]
161 pub fn variant(&self) -> BRDV_A {
162 match self.bits {
163 0 => BRDV_A::_00,
164 1 => BRDV_A::_01,
165 2 => BRDV_A::_10,
166 3 => BRDV_A::_11,
167 _ => unreachable!(),
168 }
169 }
170 #[doc = "Checks if the value of the field is `_00`"]
171 #[inline(always)]
172 pub fn is_00(&self) -> bool {
173 *self == BRDV_A::_00
174 }
175 #[doc = "Checks if the value of the field is `_01`"]
176 #[inline(always)]
177 pub fn is_01(&self) -> bool {
178 *self == BRDV_A::_01
179 }
180 #[doc = "Checks if the value of the field is `_10`"]
181 #[inline(always)]
182 pub fn is_10(&self) -> bool {
183 *self == BRDV_A::_10
184 }
185 #[doc = "Checks if the value of the field is `_11`"]
186 #[inline(always)]
187 pub fn is_11(&self) -> bool {
188 *self == BRDV_A::_11
189 }
190}
191#[doc = "Field `BRDV` writer - Bit Rate Division Setting"]
192pub type BRDV_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, SPCMD0_SPEC, u8, BRDV_A, 2, O>;
193impl<'a, const O: u8> BRDV_W<'a, O> {
194 #[doc = "These bits select the base bit rate"]
195 #[inline(always)]
196 pub fn _00(self) -> &'a mut W {
197 self.variant(BRDV_A::_00)
198 }
199 #[doc = "These bits select the base bit rate divided by 2"]
200 #[inline(always)]
201 pub fn _01(self) -> &'a mut W {
202 self.variant(BRDV_A::_01)
203 }
204 #[doc = "These bits select the base bit rate divided by 4"]
205 #[inline(always)]
206 pub fn _10(self) -> &'a mut W {
207 self.variant(BRDV_A::_10)
208 }
209 #[doc = "These bits select the base bit rate divided by 8"]
210 #[inline(always)]
211 pub fn _11(self) -> &'a mut W {
212 self.variant(BRDV_A::_11)
213 }
214}
215#[doc = "Field `SSLA` reader - SSL Signal Assertion Setting"]
216pub type SSLA_R = crate::FieldReader<u8, SSLA_A>;
217#[doc = "SSL Signal Assertion Setting\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219#[repr(u8)]
220pub enum SSLA_A {
221 #[doc = "0: SSL0"]
222 _000 = 0,
223 #[doc = "1: SSL1"]
224 _001 = 1,
225 #[doc = "2: SSL2"]
226 _010 = 2,
227 #[doc = "3: SSL3"]
228 _011 = 3,
229}
230impl From<SSLA_A> for u8 {
231 #[inline(always)]
232 fn from(variant: SSLA_A) -> Self {
233 variant as _
234 }
235}
236impl SSLA_R {
237 #[doc = "Get enumerated values variant"]
238 #[inline(always)]
239 pub fn variant(&self) -> Option<SSLA_A> {
240 match self.bits {
241 0 => Some(SSLA_A::_000),
242 1 => Some(SSLA_A::_001),
243 2 => Some(SSLA_A::_010),
244 3 => Some(SSLA_A::_011),
245 _ => None,
246 }
247 }
248 #[doc = "Checks if the value of the field is `_000`"]
249 #[inline(always)]
250 pub fn is_000(&self) -> bool {
251 *self == SSLA_A::_000
252 }
253 #[doc = "Checks if the value of the field is `_001`"]
254 #[inline(always)]
255 pub fn is_001(&self) -> bool {
256 *self == SSLA_A::_001
257 }
258 #[doc = "Checks if the value of the field is `_010`"]
259 #[inline(always)]
260 pub fn is_010(&self) -> bool {
261 *self == SSLA_A::_010
262 }
263 #[doc = "Checks if the value of the field is `_011`"]
264 #[inline(always)]
265 pub fn is_011(&self) -> bool {
266 *self == SSLA_A::_011
267 }
268}
269#[doc = "Field `SSLA` writer - SSL Signal Assertion Setting"]
270pub type SSLA_W<'a, const O: u8> = crate::FieldWriter<'a, u16, SPCMD0_SPEC, u8, SSLA_A, 3, O>;
271impl<'a, const O: u8> SSLA_W<'a, O> {
272 #[doc = "SSL0"]
273 #[inline(always)]
274 pub fn _000(self) -> &'a mut W {
275 self.variant(SSLA_A::_000)
276 }
277 #[doc = "SSL1"]
278 #[inline(always)]
279 pub fn _001(self) -> &'a mut W {
280 self.variant(SSLA_A::_001)
281 }
282 #[doc = "SSL2"]
283 #[inline(always)]
284 pub fn _010(self) -> &'a mut W {
285 self.variant(SSLA_A::_010)
286 }
287 #[doc = "SSL3"]
288 #[inline(always)]
289 pub fn _011(self) -> &'a mut W {
290 self.variant(SSLA_A::_011)
291 }
292}
293#[doc = "Field `SPB` reader - RSPI Data Length Setting"]
294pub type SPB_R = crate::FieldReader<u8, SPB_A>;
295#[doc = "RSPI Data Length Setting\n\nValue on reset: 7"]
296#[derive(Clone, Copy, Debug, PartialEq, Eq)]
297#[repr(u8)]
298pub enum SPB_A {
299 #[doc = "0: 20 bits"]
300 _0000 = 0,
301 #[doc = "1: 24 bits"]
302 _0001 = 1,
303 #[doc = "2: 32 bits"]
304 _0010 = 2,
305 #[doc = "3: 32 bits"]
306 _0011 = 3,
307 #[doc = "8: 9 bits"]
308 _1000 = 8,
309 #[doc = "9: 10 bits"]
310 _1001 = 9,
311 #[doc = "10: 11 bits"]
312 _1010 = 10,
313 #[doc = "11: 12 bits"]
314 _1011 = 11,
315 #[doc = "12: 13 bits"]
316 _1100 = 12,
317 #[doc = "13: 14 bits"]
318 _1101 = 13,
319 #[doc = "14: 15 bits"]
320 _1110 = 14,
321 #[doc = "15: 16 bits"]
322 _1111 = 15,
323}
324impl From<SPB_A> for u8 {
325 #[inline(always)]
326 fn from(variant: SPB_A) -> Self {
327 variant as _
328 }
329}
330impl SPB_R {
331 #[doc = "Get enumerated values variant"]
332 #[inline(always)]
333 pub fn variant(&self) -> Option<SPB_A> {
334 match self.bits {
335 0 => Some(SPB_A::_0000),
336 1 => Some(SPB_A::_0001),
337 2 => Some(SPB_A::_0010),
338 3 => Some(SPB_A::_0011),
339 8 => Some(SPB_A::_1000),
340 9 => Some(SPB_A::_1001),
341 10 => Some(SPB_A::_1010),
342 11 => Some(SPB_A::_1011),
343 12 => Some(SPB_A::_1100),
344 13 => Some(SPB_A::_1101),
345 14 => Some(SPB_A::_1110),
346 15 => Some(SPB_A::_1111),
347 _ => None,
348 }
349 }
350 #[doc = "Checks if the value of the field is `_0000`"]
351 #[inline(always)]
352 pub fn is_0000(&self) -> bool {
353 *self == SPB_A::_0000
354 }
355 #[doc = "Checks if the value of the field is `_0001`"]
356 #[inline(always)]
357 pub fn is_0001(&self) -> bool {
358 *self == SPB_A::_0001
359 }
360 #[doc = "Checks if the value of the field is `_0010`"]
361 #[inline(always)]
362 pub fn is_0010(&self) -> bool {
363 *self == SPB_A::_0010
364 }
365 #[doc = "Checks if the value of the field is `_0011`"]
366 #[inline(always)]
367 pub fn is_0011(&self) -> bool {
368 *self == SPB_A::_0011
369 }
370 #[doc = "Checks if the value of the field is `_1000`"]
371 #[inline(always)]
372 pub fn is_1000(&self) -> bool {
373 *self == SPB_A::_1000
374 }
375 #[doc = "Checks if the value of the field is `_1001`"]
376 #[inline(always)]
377 pub fn is_1001(&self) -> bool {
378 *self == SPB_A::_1001
379 }
380 #[doc = "Checks if the value of the field is `_1010`"]
381 #[inline(always)]
382 pub fn is_1010(&self) -> bool {
383 *self == SPB_A::_1010
384 }
385 #[doc = "Checks if the value of the field is `_1011`"]
386 #[inline(always)]
387 pub fn is_1011(&self) -> bool {
388 *self == SPB_A::_1011
389 }
390 #[doc = "Checks if the value of the field is `_1100`"]
391 #[inline(always)]
392 pub fn is_1100(&self) -> bool {
393 *self == SPB_A::_1100
394 }
395 #[doc = "Checks if the value of the field is `_1101`"]
396 #[inline(always)]
397 pub fn is_1101(&self) -> bool {
398 *self == SPB_A::_1101
399 }
400 #[doc = "Checks if the value of the field is `_1110`"]
401 #[inline(always)]
402 pub fn is_1110(&self) -> bool {
403 *self == SPB_A::_1110
404 }
405 #[doc = "Checks if the value of the field is `_1111`"]
406 #[inline(always)]
407 pub fn is_1111(&self) -> bool {
408 *self == SPB_A::_1111
409 }
410}
411#[doc = "Field `SPB` writer - RSPI Data Length Setting"]
412pub type SPB_W<'a, const O: u8> = crate::FieldWriter<'a, u16, SPCMD0_SPEC, u8, SPB_A, 4, O>;
413impl<'a, const O: u8> SPB_W<'a, O> {
414 #[doc = "20 bits"]
415 #[inline(always)]
416 pub fn _0000(self) -> &'a mut W {
417 self.variant(SPB_A::_0000)
418 }
419 #[doc = "24 bits"]
420 #[inline(always)]
421 pub fn _0001(self) -> &'a mut W {
422 self.variant(SPB_A::_0001)
423 }
424 #[doc = "32 bits"]
425 #[inline(always)]
426 pub fn _0010(self) -> &'a mut W {
427 self.variant(SPB_A::_0010)
428 }
429 #[doc = "32 bits"]
430 #[inline(always)]
431 pub fn _0011(self) -> &'a mut W {
432 self.variant(SPB_A::_0011)
433 }
434 #[doc = "9 bits"]
435 #[inline(always)]
436 pub fn _1000(self) -> &'a mut W {
437 self.variant(SPB_A::_1000)
438 }
439 #[doc = "10 bits"]
440 #[inline(always)]
441 pub fn _1001(self) -> &'a mut W {
442 self.variant(SPB_A::_1001)
443 }
444 #[doc = "11 bits"]
445 #[inline(always)]
446 pub fn _1010(self) -> &'a mut W {
447 self.variant(SPB_A::_1010)
448 }
449 #[doc = "12 bits"]
450 #[inline(always)]
451 pub fn _1011(self) -> &'a mut W {
452 self.variant(SPB_A::_1011)
453 }
454 #[doc = "13 bits"]
455 #[inline(always)]
456 pub fn _1100(self) -> &'a mut W {
457 self.variant(SPB_A::_1100)
458 }
459 #[doc = "14 bits"]
460 #[inline(always)]
461 pub fn _1101(self) -> &'a mut W {
462 self.variant(SPB_A::_1101)
463 }
464 #[doc = "15 bits"]
465 #[inline(always)]
466 pub fn _1110(self) -> &'a mut W {
467 self.variant(SPB_A::_1110)
468 }
469 #[doc = "16 bits"]
470 #[inline(always)]
471 pub fn _1111(self) -> &'a mut W {
472 self.variant(SPB_A::_1111)
473 }
474}
475#[doc = "Field `LSBF` reader - RSPI LSB First"]
476pub type LSBF_R = crate::BitReader<LSBF_A>;
477#[doc = "RSPI LSB First\n\nValue on reset: 0"]
478#[derive(Clone, Copy, Debug, PartialEq, Eq)]
479pub enum LSBF_A {
480 #[doc = "0: MSB first"]
481 _0 = 0,
482 #[doc = "1: LSB first"]
483 _1 = 1,
484}
485impl From<LSBF_A> for bool {
486 #[inline(always)]
487 fn from(variant: LSBF_A) -> Self {
488 variant as u8 != 0
489 }
490}
491impl LSBF_R {
492 #[doc = "Get enumerated values variant"]
493 #[inline(always)]
494 pub fn variant(&self) -> LSBF_A {
495 match self.bits {
496 false => LSBF_A::_0,
497 true => LSBF_A::_1,
498 }
499 }
500 #[doc = "Checks if the value of the field is `_0`"]
501 #[inline(always)]
502 pub fn is_0(&self) -> bool {
503 *self == LSBF_A::_0
504 }
505 #[doc = "Checks if the value of the field is `_1`"]
506 #[inline(always)]
507 pub fn is_1(&self) -> bool {
508 *self == LSBF_A::_1
509 }
510}
511#[doc = "Field `LSBF` writer - RSPI LSB First"]
512pub type LSBF_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, LSBF_A, O>;
513impl<'a, const O: u8> LSBF_W<'a, O> {
514 #[doc = "MSB first"]
515 #[inline(always)]
516 pub fn _0(self) -> &'a mut W {
517 self.variant(LSBF_A::_0)
518 }
519 #[doc = "LSB first"]
520 #[inline(always)]
521 pub fn _1(self) -> &'a mut W {
522 self.variant(LSBF_A::_1)
523 }
524}
525#[doc = "Field `SPNDEN` reader - RSPI Next-Access Delay Enable"]
526pub type SPNDEN_R = crate::BitReader<SPNDEN_A>;
527#[doc = "RSPI Next-Access Delay Enable\n\nValue on reset: 0"]
528#[derive(Clone, Copy, Debug, PartialEq, Eq)]
529pub enum SPNDEN_A {
530 #[doc = "0: A next-access delay of 1 RSPCK + 2 PCLK"]
531 _0 = 0,
532 #[doc = "1: A next-access delay is equal to the setting of the RSPI next-access delay register (SPND)"]
533 _1 = 1,
534}
535impl From<SPNDEN_A> for bool {
536 #[inline(always)]
537 fn from(variant: SPNDEN_A) -> Self {
538 variant as u8 != 0
539 }
540}
541impl SPNDEN_R {
542 #[doc = "Get enumerated values variant"]
543 #[inline(always)]
544 pub fn variant(&self) -> SPNDEN_A {
545 match self.bits {
546 false => SPNDEN_A::_0,
547 true => SPNDEN_A::_1,
548 }
549 }
550 #[doc = "Checks if the value of the field is `_0`"]
551 #[inline(always)]
552 pub fn is_0(&self) -> bool {
553 *self == SPNDEN_A::_0
554 }
555 #[doc = "Checks if the value of the field is `_1`"]
556 #[inline(always)]
557 pub fn is_1(&self) -> bool {
558 *self == SPNDEN_A::_1
559 }
560}
561#[doc = "Field `SPNDEN` writer - RSPI Next-Access Delay Enable"]
562pub type SPNDEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, SPNDEN_A, O>;
563impl<'a, const O: u8> SPNDEN_W<'a, O> {
564 #[doc = "A next-access delay of 1 RSPCK + 2 PCLK"]
565 #[inline(always)]
566 pub fn _0(self) -> &'a mut W {
567 self.variant(SPNDEN_A::_0)
568 }
569 #[doc = "A next-access delay is equal to the setting of the RSPI next-access delay register (SPND)"]
570 #[inline(always)]
571 pub fn _1(self) -> &'a mut W {
572 self.variant(SPNDEN_A::_1)
573 }
574}
575#[doc = "Field `SLNDEN` reader - SSL Negation Delay Setting Enable"]
576pub type SLNDEN_R = crate::BitReader<SLNDEN_A>;
577#[doc = "SSL Negation Delay Setting Enable\n\nValue on reset: 0"]
578#[derive(Clone, Copy, Debug, PartialEq, Eq)]
579pub enum SLNDEN_A {
580 #[doc = "0: An SSL negation delay of 1 RSPCK"]
581 _0 = 0,
582 #[doc = "1: An SSL negation delay is equal to the setting of the RSPI slave select negation delay register (SSLND)"]
583 _1 = 1,
584}
585impl From<SLNDEN_A> for bool {
586 #[inline(always)]
587 fn from(variant: SLNDEN_A) -> Self {
588 variant as u8 != 0
589 }
590}
591impl SLNDEN_R {
592 #[doc = "Get enumerated values variant"]
593 #[inline(always)]
594 pub fn variant(&self) -> SLNDEN_A {
595 match self.bits {
596 false => SLNDEN_A::_0,
597 true => SLNDEN_A::_1,
598 }
599 }
600 #[doc = "Checks if the value of the field is `_0`"]
601 #[inline(always)]
602 pub fn is_0(&self) -> bool {
603 *self == SLNDEN_A::_0
604 }
605 #[doc = "Checks if the value of the field is `_1`"]
606 #[inline(always)]
607 pub fn is_1(&self) -> bool {
608 *self == SLNDEN_A::_1
609 }
610}
611#[doc = "Field `SLNDEN` writer - SSL Negation Delay Setting Enable"]
612pub type SLNDEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, SLNDEN_A, O>;
613impl<'a, const O: u8> SLNDEN_W<'a, O> {
614 #[doc = "An SSL negation delay of 1 RSPCK"]
615 #[inline(always)]
616 pub fn _0(self) -> &'a mut W {
617 self.variant(SLNDEN_A::_0)
618 }
619 #[doc = "An SSL negation delay is equal to the setting of the RSPI slave select negation delay register (SSLND)"]
620 #[inline(always)]
621 pub fn _1(self) -> &'a mut W {
622 self.variant(SLNDEN_A::_1)
623 }
624}
625#[doc = "Field `SCKDEN` reader - RSPCK Delay Setting Enable"]
626pub type SCKDEN_R = crate::BitReader<SCKDEN_A>;
627#[doc = "RSPCK Delay Setting Enable\n\nValue on reset: 0"]
628#[derive(Clone, Copy, Debug, PartialEq, Eq)]
629pub enum SCKDEN_A {
630 #[doc = "0: An RSPCK delay of 1 RSPCK"]
631 _0 = 0,
632 #[doc = "1: An RSPCK delay is equal to the setting of the RSPI clock delay register (SPCKD)"]
633 _1 = 1,
634}
635impl From<SCKDEN_A> for bool {
636 #[inline(always)]
637 fn from(variant: SCKDEN_A) -> Self {
638 variant as u8 != 0
639 }
640}
641impl SCKDEN_R {
642 #[doc = "Get enumerated values variant"]
643 #[inline(always)]
644 pub fn variant(&self) -> SCKDEN_A {
645 match self.bits {
646 false => SCKDEN_A::_0,
647 true => SCKDEN_A::_1,
648 }
649 }
650 #[doc = "Checks if the value of the field is `_0`"]
651 #[inline(always)]
652 pub fn is_0(&self) -> bool {
653 *self == SCKDEN_A::_0
654 }
655 #[doc = "Checks if the value of the field is `_1`"]
656 #[inline(always)]
657 pub fn is_1(&self) -> bool {
658 *self == SCKDEN_A::_1
659 }
660}
661#[doc = "Field `SCKDEN` writer - RSPCK Delay Setting Enable"]
662pub type SCKDEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, SPCMD0_SPEC, SCKDEN_A, O>;
663impl<'a, const O: u8> SCKDEN_W<'a, O> {
664 #[doc = "An RSPCK delay of 1 RSPCK"]
665 #[inline(always)]
666 pub fn _0(self) -> &'a mut W {
667 self.variant(SCKDEN_A::_0)
668 }
669 #[doc = "An RSPCK delay is equal to the setting of the RSPI clock delay register (SPCKD)"]
670 #[inline(always)]
671 pub fn _1(self) -> &'a mut W {
672 self.variant(SCKDEN_A::_1)
673 }
674}
675impl R {
676 #[doc = "Bit 0 - RSPCK Phase Setting"]
677 #[inline(always)]
678 pub fn cpha(&self) -> CPHA_R {
679 CPHA_R::new((self.bits & 1) != 0)
680 }
681 #[doc = "Bit 1 - RSPCK Polarity Setting"]
682 #[inline(always)]
683 pub fn cpol(&self) -> CPOL_R {
684 CPOL_R::new(((self.bits >> 1) & 1) != 0)
685 }
686 #[doc = "Bits 2:3 - Bit Rate Division Setting"]
687 #[inline(always)]
688 pub fn brdv(&self) -> BRDV_R {
689 BRDV_R::new(((self.bits >> 2) & 3) as u8)
690 }
691 #[doc = "Bits 4:6 - SSL Signal Assertion Setting"]
692 #[inline(always)]
693 pub fn ssla(&self) -> SSLA_R {
694 SSLA_R::new(((self.bits >> 4) & 7) as u8)
695 }
696 #[doc = "Bits 8:11 - RSPI Data Length Setting"]
697 #[inline(always)]
698 pub fn spb(&self) -> SPB_R {
699 SPB_R::new(((self.bits >> 8) & 0x0f) as u8)
700 }
701 #[doc = "Bit 12 - RSPI LSB First"]
702 #[inline(always)]
703 pub fn lsbf(&self) -> LSBF_R {
704 LSBF_R::new(((self.bits >> 12) & 1) != 0)
705 }
706 #[doc = "Bit 13 - RSPI Next-Access Delay Enable"]
707 #[inline(always)]
708 pub fn spnden(&self) -> SPNDEN_R {
709 SPNDEN_R::new(((self.bits >> 13) & 1) != 0)
710 }
711 #[doc = "Bit 14 - SSL Negation Delay Setting Enable"]
712 #[inline(always)]
713 pub fn slnden(&self) -> SLNDEN_R {
714 SLNDEN_R::new(((self.bits >> 14) & 1) != 0)
715 }
716 #[doc = "Bit 15 - RSPCK Delay Setting Enable"]
717 #[inline(always)]
718 pub fn sckden(&self) -> SCKDEN_R {
719 SCKDEN_R::new(((self.bits >> 15) & 1) != 0)
720 }
721}
722impl W {
723 #[doc = "Bit 0 - RSPCK Phase Setting"]
724 #[inline(always)]
725 #[must_use]
726 pub fn cpha(&mut self) -> CPHA_W<0> {
727 CPHA_W::new(self)
728 }
729 #[doc = "Bit 1 - RSPCK Polarity Setting"]
730 #[inline(always)]
731 #[must_use]
732 pub fn cpol(&mut self) -> CPOL_W<1> {
733 CPOL_W::new(self)
734 }
735 #[doc = "Bits 2:3 - Bit Rate Division Setting"]
736 #[inline(always)]
737 #[must_use]
738 pub fn brdv(&mut self) -> BRDV_W<2> {
739 BRDV_W::new(self)
740 }
741 #[doc = "Bits 4:6 - SSL Signal Assertion Setting"]
742 #[inline(always)]
743 #[must_use]
744 pub fn ssla(&mut self) -> SSLA_W<4> {
745 SSLA_W::new(self)
746 }
747 #[doc = "Bits 8:11 - RSPI Data Length Setting"]
748 #[inline(always)]
749 #[must_use]
750 pub fn spb(&mut self) -> SPB_W<8> {
751 SPB_W::new(self)
752 }
753 #[doc = "Bit 12 - RSPI LSB First"]
754 #[inline(always)]
755 #[must_use]
756 pub fn lsbf(&mut self) -> LSBF_W<12> {
757 LSBF_W::new(self)
758 }
759 #[doc = "Bit 13 - RSPI Next-Access Delay Enable"]
760 #[inline(always)]
761 #[must_use]
762 pub fn spnden(&mut self) -> SPNDEN_W<13> {
763 SPNDEN_W::new(self)
764 }
765 #[doc = "Bit 14 - SSL Negation Delay Setting Enable"]
766 #[inline(always)]
767 #[must_use]
768 pub fn slnden(&mut self) -> SLNDEN_W<14> {
769 SLNDEN_W::new(self)
770 }
771 #[doc = "Bit 15 - RSPCK Delay Setting Enable"]
772 #[inline(always)]
773 #[must_use]
774 pub fn sckden(&mut self) -> SCKDEN_W<15> {
775 SCKDEN_W::new(self)
776 }
777 #[doc = "Writes raw bits to the register."]
778 #[inline(always)]
779 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
780 self.0.bits(bits);
781 self
782 }
783}
784#[doc = "SPI Command Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spcmd0](index.html) module"]
785pub struct SPCMD0_SPEC;
786impl crate::RegisterSpec for SPCMD0_SPEC {
787 type Ux = u16;
788}
789#[doc = "`read()` method returns [spcmd0::R](R) reader structure"]
790impl crate::Readable for SPCMD0_SPEC {
791 type Reader = R;
792}
793#[doc = "`write(|w| ..)` method takes [spcmd0::W](W) writer structure"]
794impl crate::Writable for SPCMD0_SPEC {
795 type Writer = W;
796 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
797 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
798}
799#[doc = "`reset()` method sets SPCMD0 to value 0x070d"]
800impl crate::Resettable for SPCMD0_SPEC {
801 const RESET_VALUE: Self::Ux = 0x070d;
802}