stm32l4x2_pac/spi1/
cr1.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::CR1 {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = r" Value of the field"]
46pub struct BIDIMODER {
47    bits: bool,
48}
49impl BIDIMODER {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct BIDIOER {
68    bits: bool,
69}
70impl BIDIOER {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = r" Value of the field"]
88pub struct CRCENR {
89    bits: bool,
90}
91impl CRCENR {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bit(&self) -> bool {
95        self.bits
96    }
97    #[doc = r" Returns `true` if the bit is clear (0)"]
98    #[inline]
99    pub fn bit_is_clear(&self) -> bool {
100        !self.bit()
101    }
102    #[doc = r" Returns `true` if the bit is set (1)"]
103    #[inline]
104    pub fn bit_is_set(&self) -> bool {
105        self.bit()
106    }
107}
108#[doc = r" Value of the field"]
109pub struct CRCNEXTR {
110    bits: bool,
111}
112impl CRCNEXTR {
113    #[doc = r" Value of the field as raw bits"]
114    #[inline]
115    pub fn bit(&self) -> bool {
116        self.bits
117    }
118    #[doc = r" Returns `true` if the bit is clear (0)"]
119    #[inline]
120    pub fn bit_is_clear(&self) -> bool {
121        !self.bit()
122    }
123    #[doc = r" Returns `true` if the bit is set (1)"]
124    #[inline]
125    pub fn bit_is_set(&self) -> bool {
126        self.bit()
127    }
128}
129#[doc = r" Value of the field"]
130pub struct DFFR {
131    bits: bool,
132}
133impl DFFR {
134    #[doc = r" Value of the field as raw bits"]
135    #[inline]
136    pub fn bit(&self) -> bool {
137        self.bits
138    }
139    #[doc = r" Returns `true` if the bit is clear (0)"]
140    #[inline]
141    pub fn bit_is_clear(&self) -> bool {
142        !self.bit()
143    }
144    #[doc = r" Returns `true` if the bit is set (1)"]
145    #[inline]
146    pub fn bit_is_set(&self) -> bool {
147        self.bit()
148    }
149}
150#[doc = r" Value of the field"]
151pub struct RXONLYR {
152    bits: bool,
153}
154impl RXONLYR {
155    #[doc = r" Value of the field as raw bits"]
156    #[inline]
157    pub fn bit(&self) -> bool {
158        self.bits
159    }
160    #[doc = r" Returns `true` if the bit is clear (0)"]
161    #[inline]
162    pub fn bit_is_clear(&self) -> bool {
163        !self.bit()
164    }
165    #[doc = r" Returns `true` if the bit is set (1)"]
166    #[inline]
167    pub fn bit_is_set(&self) -> bool {
168        self.bit()
169    }
170}
171#[doc = r" Value of the field"]
172pub struct SSMR {
173    bits: bool,
174}
175impl SSMR {
176    #[doc = r" Value of the field as raw bits"]
177    #[inline]
178    pub fn bit(&self) -> bool {
179        self.bits
180    }
181    #[doc = r" Returns `true` if the bit is clear (0)"]
182    #[inline]
183    pub fn bit_is_clear(&self) -> bool {
184        !self.bit()
185    }
186    #[doc = r" Returns `true` if the bit is set (1)"]
187    #[inline]
188    pub fn bit_is_set(&self) -> bool {
189        self.bit()
190    }
191}
192#[doc = r" Value of the field"]
193pub struct SSIR {
194    bits: bool,
195}
196impl SSIR {
197    #[doc = r" Value of the field as raw bits"]
198    #[inline]
199    pub fn bit(&self) -> bool {
200        self.bits
201    }
202    #[doc = r" Returns `true` if the bit is clear (0)"]
203    #[inline]
204    pub fn bit_is_clear(&self) -> bool {
205        !self.bit()
206    }
207    #[doc = r" Returns `true` if the bit is set (1)"]
208    #[inline]
209    pub fn bit_is_set(&self) -> bool {
210        self.bit()
211    }
212}
213#[doc = r" Value of the field"]
214pub struct LSBFIRSTR {
215    bits: bool,
216}
217impl LSBFIRSTR {
218    #[doc = r" Value of the field as raw bits"]
219    #[inline]
220    pub fn bit(&self) -> bool {
221        self.bits
222    }
223    #[doc = r" Returns `true` if the bit is clear (0)"]
224    #[inline]
225    pub fn bit_is_clear(&self) -> bool {
226        !self.bit()
227    }
228    #[doc = r" Returns `true` if the bit is set (1)"]
229    #[inline]
230    pub fn bit_is_set(&self) -> bool {
231        self.bit()
232    }
233}
234#[doc = r" Value of the field"]
235pub struct SPER {
236    bits: bool,
237}
238impl SPER {
239    #[doc = r" Value of the field as raw bits"]
240    #[inline]
241    pub fn bit(&self) -> bool {
242        self.bits
243    }
244    #[doc = r" Returns `true` if the bit is clear (0)"]
245    #[inline]
246    pub fn bit_is_clear(&self) -> bool {
247        !self.bit()
248    }
249    #[doc = r" Returns `true` if the bit is set (1)"]
250    #[inline]
251    pub fn bit_is_set(&self) -> bool {
252        self.bit()
253    }
254}
255#[doc = r" Value of the field"]
256pub struct BRR {
257    bits: u8,
258}
259impl BRR {
260    #[doc = r" Value of the field as raw bits"]
261    #[inline]
262    pub fn bits(&self) -> u8 {
263        self.bits
264    }
265}
266#[doc = r" Value of the field"]
267pub struct MSTRR {
268    bits: bool,
269}
270impl MSTRR {
271    #[doc = r" Value of the field as raw bits"]
272    #[inline]
273    pub fn bit(&self) -> bool {
274        self.bits
275    }
276    #[doc = r" Returns `true` if the bit is clear (0)"]
277    #[inline]
278    pub fn bit_is_clear(&self) -> bool {
279        !self.bit()
280    }
281    #[doc = r" Returns `true` if the bit is set (1)"]
282    #[inline]
283    pub fn bit_is_set(&self) -> bool {
284        self.bit()
285    }
286}
287#[doc = r" Value of the field"]
288pub struct CPOLR {
289    bits: bool,
290}
291impl CPOLR {
292    #[doc = r" Value of the field as raw bits"]
293    #[inline]
294    pub fn bit(&self) -> bool {
295        self.bits
296    }
297    #[doc = r" Returns `true` if the bit is clear (0)"]
298    #[inline]
299    pub fn bit_is_clear(&self) -> bool {
300        !self.bit()
301    }
302    #[doc = r" Returns `true` if the bit is set (1)"]
303    #[inline]
304    pub fn bit_is_set(&self) -> bool {
305        self.bit()
306    }
307}
308#[doc = r" Value of the field"]
309pub struct CPHAR {
310    bits: bool,
311}
312impl CPHAR {
313    #[doc = r" Value of the field as raw bits"]
314    #[inline]
315    pub fn bit(&self) -> bool {
316        self.bits
317    }
318    #[doc = r" Returns `true` if the bit is clear (0)"]
319    #[inline]
320    pub fn bit_is_clear(&self) -> bool {
321        !self.bit()
322    }
323    #[doc = r" Returns `true` if the bit is set (1)"]
324    #[inline]
325    pub fn bit_is_set(&self) -> bool {
326        self.bit()
327    }
328}
329#[doc = r" Proxy"]
330pub struct _BIDIMODEW<'a> {
331    w: &'a mut W,
332}
333impl<'a> _BIDIMODEW<'a> {
334    #[doc = r" Sets the field bit"]
335    pub fn set_bit(self) -> &'a mut W {
336        self.bit(true)
337    }
338    #[doc = r" Clears the field bit"]
339    pub fn clear_bit(self) -> &'a mut W {
340        self.bit(false)
341    }
342    #[doc = r" Writes raw bits to the field"]
343    #[inline]
344    pub fn bit(self, value: bool) -> &'a mut W {
345        const MASK: bool = true;
346        const OFFSET: u8 = 15;
347        self.w.bits &= !((MASK as u32) << OFFSET);
348        self.w.bits |= ((value & MASK) as u32) << OFFSET;
349        self.w
350    }
351}
352#[doc = r" Proxy"]
353pub struct _BIDIOEW<'a> {
354    w: &'a mut W,
355}
356impl<'a> _BIDIOEW<'a> {
357    #[doc = r" Sets the field bit"]
358    pub fn set_bit(self) -> &'a mut W {
359        self.bit(true)
360    }
361    #[doc = r" Clears the field bit"]
362    pub fn clear_bit(self) -> &'a mut W {
363        self.bit(false)
364    }
365    #[doc = r" Writes raw bits to the field"]
366    #[inline]
367    pub fn bit(self, value: bool) -> &'a mut W {
368        const MASK: bool = true;
369        const OFFSET: u8 = 14;
370        self.w.bits &= !((MASK as u32) << OFFSET);
371        self.w.bits |= ((value & MASK) as u32) << OFFSET;
372        self.w
373    }
374}
375#[doc = r" Proxy"]
376pub struct _CRCENW<'a> {
377    w: &'a mut W,
378}
379impl<'a> _CRCENW<'a> {
380    #[doc = r" Sets the field bit"]
381    pub fn set_bit(self) -> &'a mut W {
382        self.bit(true)
383    }
384    #[doc = r" Clears the field bit"]
385    pub fn clear_bit(self) -> &'a mut W {
386        self.bit(false)
387    }
388    #[doc = r" Writes raw bits to the field"]
389    #[inline]
390    pub fn bit(self, value: bool) -> &'a mut W {
391        const MASK: bool = true;
392        const OFFSET: u8 = 13;
393        self.w.bits &= !((MASK as u32) << OFFSET);
394        self.w.bits |= ((value & MASK) as u32) << OFFSET;
395        self.w
396    }
397}
398#[doc = r" Proxy"]
399pub struct _CRCNEXTW<'a> {
400    w: &'a mut W,
401}
402impl<'a> _CRCNEXTW<'a> {
403    #[doc = r" Sets the field bit"]
404    pub fn set_bit(self) -> &'a mut W {
405        self.bit(true)
406    }
407    #[doc = r" Clears the field bit"]
408    pub fn clear_bit(self) -> &'a mut W {
409        self.bit(false)
410    }
411    #[doc = r" Writes raw bits to the field"]
412    #[inline]
413    pub fn bit(self, value: bool) -> &'a mut W {
414        const MASK: bool = true;
415        const OFFSET: u8 = 12;
416        self.w.bits &= !((MASK as u32) << OFFSET);
417        self.w.bits |= ((value & MASK) as u32) << OFFSET;
418        self.w
419    }
420}
421#[doc = r" Proxy"]
422pub struct _DFFW<'a> {
423    w: &'a mut W,
424}
425impl<'a> _DFFW<'a> {
426    #[doc = r" Sets the field bit"]
427    pub fn set_bit(self) -> &'a mut W {
428        self.bit(true)
429    }
430    #[doc = r" Clears the field bit"]
431    pub fn clear_bit(self) -> &'a mut W {
432        self.bit(false)
433    }
434    #[doc = r" Writes raw bits to the field"]
435    #[inline]
436    pub fn bit(self, value: bool) -> &'a mut W {
437        const MASK: bool = true;
438        const OFFSET: u8 = 11;
439        self.w.bits &= !((MASK as u32) << OFFSET);
440        self.w.bits |= ((value & MASK) as u32) << OFFSET;
441        self.w
442    }
443}
444#[doc = r" Proxy"]
445pub struct _RXONLYW<'a> {
446    w: &'a mut W,
447}
448impl<'a> _RXONLYW<'a> {
449    #[doc = r" Sets the field bit"]
450    pub fn set_bit(self) -> &'a mut W {
451        self.bit(true)
452    }
453    #[doc = r" Clears the field bit"]
454    pub fn clear_bit(self) -> &'a mut W {
455        self.bit(false)
456    }
457    #[doc = r" Writes raw bits to the field"]
458    #[inline]
459    pub fn bit(self, value: bool) -> &'a mut W {
460        const MASK: bool = true;
461        const OFFSET: u8 = 10;
462        self.w.bits &= !((MASK as u32) << OFFSET);
463        self.w.bits |= ((value & MASK) as u32) << OFFSET;
464        self.w
465    }
466}
467#[doc = r" Proxy"]
468pub struct _SSMW<'a> {
469    w: &'a mut W,
470}
471impl<'a> _SSMW<'a> {
472    #[doc = r" Sets the field bit"]
473    pub fn set_bit(self) -> &'a mut W {
474        self.bit(true)
475    }
476    #[doc = r" Clears the field bit"]
477    pub fn clear_bit(self) -> &'a mut W {
478        self.bit(false)
479    }
480    #[doc = r" Writes raw bits to the field"]
481    #[inline]
482    pub fn bit(self, value: bool) -> &'a mut W {
483        const MASK: bool = true;
484        const OFFSET: u8 = 9;
485        self.w.bits &= !((MASK as u32) << OFFSET);
486        self.w.bits |= ((value & MASK) as u32) << OFFSET;
487        self.w
488    }
489}
490#[doc = r" Proxy"]
491pub struct _SSIW<'a> {
492    w: &'a mut W,
493}
494impl<'a> _SSIW<'a> {
495    #[doc = r" Sets the field bit"]
496    pub fn set_bit(self) -> &'a mut W {
497        self.bit(true)
498    }
499    #[doc = r" Clears the field bit"]
500    pub fn clear_bit(self) -> &'a mut W {
501        self.bit(false)
502    }
503    #[doc = r" Writes raw bits to the field"]
504    #[inline]
505    pub fn bit(self, value: bool) -> &'a mut W {
506        const MASK: bool = true;
507        const OFFSET: u8 = 8;
508        self.w.bits &= !((MASK as u32) << OFFSET);
509        self.w.bits |= ((value & MASK) as u32) << OFFSET;
510        self.w
511    }
512}
513#[doc = r" Proxy"]
514pub struct _LSBFIRSTW<'a> {
515    w: &'a mut W,
516}
517impl<'a> _LSBFIRSTW<'a> {
518    #[doc = r" Sets the field bit"]
519    pub fn set_bit(self) -> &'a mut W {
520        self.bit(true)
521    }
522    #[doc = r" Clears the field bit"]
523    pub fn clear_bit(self) -> &'a mut W {
524        self.bit(false)
525    }
526    #[doc = r" Writes raw bits to the field"]
527    #[inline]
528    pub fn bit(self, value: bool) -> &'a mut W {
529        const MASK: bool = true;
530        const OFFSET: u8 = 7;
531        self.w.bits &= !((MASK as u32) << OFFSET);
532        self.w.bits |= ((value & MASK) as u32) << OFFSET;
533        self.w
534    }
535}
536#[doc = r" Proxy"]
537pub struct _SPEW<'a> {
538    w: &'a mut W,
539}
540impl<'a> _SPEW<'a> {
541    #[doc = r" Sets the field bit"]
542    pub fn set_bit(self) -> &'a mut W {
543        self.bit(true)
544    }
545    #[doc = r" Clears the field bit"]
546    pub fn clear_bit(self) -> &'a mut W {
547        self.bit(false)
548    }
549    #[doc = r" Writes raw bits to the field"]
550    #[inline]
551    pub fn bit(self, value: bool) -> &'a mut W {
552        const MASK: bool = true;
553        const OFFSET: u8 = 6;
554        self.w.bits &= !((MASK as u32) << OFFSET);
555        self.w.bits |= ((value & MASK) as u32) << OFFSET;
556        self.w
557    }
558}
559#[doc = r" Proxy"]
560pub struct _BRW<'a> {
561    w: &'a mut W,
562}
563impl<'a> _BRW<'a> {
564    #[doc = r" Writes raw bits to the field"]
565    #[inline]
566    pub unsafe fn bits(self, value: u8) -> &'a mut W {
567        const MASK: u8 = 7;
568        const OFFSET: u8 = 3;
569        self.w.bits &= !((MASK as u32) << OFFSET);
570        self.w.bits |= ((value & MASK) as u32) << OFFSET;
571        self.w
572    }
573}
574#[doc = r" Proxy"]
575pub struct _MSTRW<'a> {
576    w: &'a mut W,
577}
578impl<'a> _MSTRW<'a> {
579    #[doc = r" Sets the field bit"]
580    pub fn set_bit(self) -> &'a mut W {
581        self.bit(true)
582    }
583    #[doc = r" Clears the field bit"]
584    pub fn clear_bit(self) -> &'a mut W {
585        self.bit(false)
586    }
587    #[doc = r" Writes raw bits to the field"]
588    #[inline]
589    pub fn bit(self, value: bool) -> &'a mut W {
590        const MASK: bool = true;
591        const OFFSET: u8 = 2;
592        self.w.bits &= !((MASK as u32) << OFFSET);
593        self.w.bits |= ((value & MASK) as u32) << OFFSET;
594        self.w
595    }
596}
597#[doc = r" Proxy"]
598pub struct _CPOLW<'a> {
599    w: &'a mut W,
600}
601impl<'a> _CPOLW<'a> {
602    #[doc = r" Sets the field bit"]
603    pub fn set_bit(self) -> &'a mut W {
604        self.bit(true)
605    }
606    #[doc = r" Clears the field bit"]
607    pub fn clear_bit(self) -> &'a mut W {
608        self.bit(false)
609    }
610    #[doc = r" Writes raw bits to the field"]
611    #[inline]
612    pub fn bit(self, value: bool) -> &'a mut W {
613        const MASK: bool = true;
614        const OFFSET: u8 = 1;
615        self.w.bits &= !((MASK as u32) << OFFSET);
616        self.w.bits |= ((value & MASK) as u32) << OFFSET;
617        self.w
618    }
619}
620#[doc = r" Proxy"]
621pub struct _CPHAW<'a> {
622    w: &'a mut W,
623}
624impl<'a> _CPHAW<'a> {
625    #[doc = r" Sets the field bit"]
626    pub fn set_bit(self) -> &'a mut W {
627        self.bit(true)
628    }
629    #[doc = r" Clears the field bit"]
630    pub fn clear_bit(self) -> &'a mut W {
631        self.bit(false)
632    }
633    #[doc = r" Writes raw bits to the field"]
634    #[inline]
635    pub fn bit(self, value: bool) -> &'a mut W {
636        const MASK: bool = true;
637        const OFFSET: u8 = 0;
638        self.w.bits &= !((MASK as u32) << OFFSET);
639        self.w.bits |= ((value & MASK) as u32) << OFFSET;
640        self.w
641    }
642}
643impl R {
644    #[doc = r" Value of the register as raw bits"]
645    #[inline]
646    pub fn bits(&self) -> u32 {
647        self.bits
648    }
649    #[doc = "Bit 15 - Bidirectional data mode enable"]
650    #[inline]
651    pub fn bidimode(&self) -> BIDIMODER {
652        let bits = {
653            const MASK: bool = true;
654            const OFFSET: u8 = 15;
655            ((self.bits >> OFFSET) & MASK as u32) != 0
656        };
657        BIDIMODER { bits }
658    }
659    #[doc = "Bit 14 - Output enable in bidirectional mode"]
660    #[inline]
661    pub fn bidioe(&self) -> BIDIOER {
662        let bits = {
663            const MASK: bool = true;
664            const OFFSET: u8 = 14;
665            ((self.bits >> OFFSET) & MASK as u32) != 0
666        };
667        BIDIOER { bits }
668    }
669    #[doc = "Bit 13 - Hardware CRC calculation enable"]
670    #[inline]
671    pub fn crcen(&self) -> CRCENR {
672        let bits = {
673            const MASK: bool = true;
674            const OFFSET: u8 = 13;
675            ((self.bits >> OFFSET) & MASK as u32) != 0
676        };
677        CRCENR { bits }
678    }
679    #[doc = "Bit 12 - CRC transfer next"]
680    #[inline]
681    pub fn crcnext(&self) -> CRCNEXTR {
682        let bits = {
683            const MASK: bool = true;
684            const OFFSET: u8 = 12;
685            ((self.bits >> OFFSET) & MASK as u32) != 0
686        };
687        CRCNEXTR { bits }
688    }
689    #[doc = "Bit 11 - Data frame format"]
690    #[inline]
691    pub fn dff(&self) -> DFFR {
692        let bits = {
693            const MASK: bool = true;
694            const OFFSET: u8 = 11;
695            ((self.bits >> OFFSET) & MASK as u32) != 0
696        };
697        DFFR { bits }
698    }
699    #[doc = "Bit 10 - Receive only"]
700    #[inline]
701    pub fn rxonly(&self) -> RXONLYR {
702        let bits = {
703            const MASK: bool = true;
704            const OFFSET: u8 = 10;
705            ((self.bits >> OFFSET) & MASK as u32) != 0
706        };
707        RXONLYR { bits }
708    }
709    #[doc = "Bit 9 - Software slave management"]
710    #[inline]
711    pub fn ssm(&self) -> SSMR {
712        let bits = {
713            const MASK: bool = true;
714            const OFFSET: u8 = 9;
715            ((self.bits >> OFFSET) & MASK as u32) != 0
716        };
717        SSMR { bits }
718    }
719    #[doc = "Bit 8 - Internal slave select"]
720    #[inline]
721    pub fn ssi(&self) -> SSIR {
722        let bits = {
723            const MASK: bool = true;
724            const OFFSET: u8 = 8;
725            ((self.bits >> OFFSET) & MASK as u32) != 0
726        };
727        SSIR { bits }
728    }
729    #[doc = "Bit 7 - Frame format"]
730    #[inline]
731    pub fn lsbfirst(&self) -> LSBFIRSTR {
732        let bits = {
733            const MASK: bool = true;
734            const OFFSET: u8 = 7;
735            ((self.bits >> OFFSET) & MASK as u32) != 0
736        };
737        LSBFIRSTR { bits }
738    }
739    #[doc = "Bit 6 - SPI enable"]
740    #[inline]
741    pub fn spe(&self) -> SPER {
742        let bits = {
743            const MASK: bool = true;
744            const OFFSET: u8 = 6;
745            ((self.bits >> OFFSET) & MASK as u32) != 0
746        };
747        SPER { bits }
748    }
749    #[doc = "Bits 3:5 - Baud rate control"]
750    #[inline]
751    pub fn br(&self) -> BRR {
752        let bits = {
753            const MASK: u8 = 7;
754            const OFFSET: u8 = 3;
755            ((self.bits >> OFFSET) & MASK as u32) as u8
756        };
757        BRR { bits }
758    }
759    #[doc = "Bit 2 - Master selection"]
760    #[inline]
761    pub fn mstr(&self) -> MSTRR {
762        let bits = {
763            const MASK: bool = true;
764            const OFFSET: u8 = 2;
765            ((self.bits >> OFFSET) & MASK as u32) != 0
766        };
767        MSTRR { bits }
768    }
769    #[doc = "Bit 1 - Clock polarity"]
770    #[inline]
771    pub fn cpol(&self) -> CPOLR {
772        let bits = {
773            const MASK: bool = true;
774            const OFFSET: u8 = 1;
775            ((self.bits >> OFFSET) & MASK as u32) != 0
776        };
777        CPOLR { bits }
778    }
779    #[doc = "Bit 0 - Clock phase"]
780    #[inline]
781    pub fn cpha(&self) -> CPHAR {
782        let bits = {
783            const MASK: bool = true;
784            const OFFSET: u8 = 0;
785            ((self.bits >> OFFSET) & MASK as u32) != 0
786        };
787        CPHAR { bits }
788    }
789}
790impl W {
791    #[doc = r" Reset value of the register"]
792    #[inline]
793    pub fn reset_value() -> W {
794        W { bits: 0 }
795    }
796    #[doc = r" Writes raw bits to the register"]
797    #[inline]
798    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
799        self.bits = bits;
800        self
801    }
802    #[doc = "Bit 15 - Bidirectional data mode enable"]
803    #[inline]
804    pub fn bidimode(&mut self) -> _BIDIMODEW {
805        _BIDIMODEW { w: self }
806    }
807    #[doc = "Bit 14 - Output enable in bidirectional mode"]
808    #[inline]
809    pub fn bidioe(&mut self) -> _BIDIOEW {
810        _BIDIOEW { w: self }
811    }
812    #[doc = "Bit 13 - Hardware CRC calculation enable"]
813    #[inline]
814    pub fn crcen(&mut self) -> _CRCENW {
815        _CRCENW { w: self }
816    }
817    #[doc = "Bit 12 - CRC transfer next"]
818    #[inline]
819    pub fn crcnext(&mut self) -> _CRCNEXTW {
820        _CRCNEXTW { w: self }
821    }
822    #[doc = "Bit 11 - Data frame format"]
823    #[inline]
824    pub fn dff(&mut self) -> _DFFW {
825        _DFFW { w: self }
826    }
827    #[doc = "Bit 10 - Receive only"]
828    #[inline]
829    pub fn rxonly(&mut self) -> _RXONLYW {
830        _RXONLYW { w: self }
831    }
832    #[doc = "Bit 9 - Software slave management"]
833    #[inline]
834    pub fn ssm(&mut self) -> _SSMW {
835        _SSMW { w: self }
836    }
837    #[doc = "Bit 8 - Internal slave select"]
838    #[inline]
839    pub fn ssi(&mut self) -> _SSIW {
840        _SSIW { w: self }
841    }
842    #[doc = "Bit 7 - Frame format"]
843    #[inline]
844    pub fn lsbfirst(&mut self) -> _LSBFIRSTW {
845        _LSBFIRSTW { w: self }
846    }
847    #[doc = "Bit 6 - SPI enable"]
848    #[inline]
849    pub fn spe(&mut self) -> _SPEW {
850        _SPEW { w: self }
851    }
852    #[doc = "Bits 3:5 - Baud rate control"]
853    #[inline]
854    pub fn br(&mut self) -> _BRW {
855        _BRW { w: self }
856    }
857    #[doc = "Bit 2 - Master selection"]
858    #[inline]
859    pub fn mstr(&mut self) -> _MSTRW {
860        _MSTRW { w: self }
861    }
862    #[doc = "Bit 1 - Clock polarity"]
863    #[inline]
864    pub fn cpol(&mut self) -> _CPOLW {
865        _CPOLW { w: self }
866    }
867    #[doc = "Bit 0 - Clock phase"]
868    #[inline]
869    pub fn cpha(&mut self) -> _CPHAW {
870        _CPHAW { w: self }
871    }
872}