stm32l4x2_pac/dfsdm/ch/
cfgr1.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::CFGR1 {
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 DFSDMENR {
47    bits: bool,
48}
49impl DFSDMENR {
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 CKOUTSRCR {
68    bits: bool,
69}
70impl CKOUTSRCR {
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 CKOUTDIVR {
89    bits: u8,
90}
91impl CKOUTDIVR {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bits(&self) -> u8 {
95        self.bits
96    }
97}
98#[doc = r" Value of the field"]
99pub struct DATPACKR {
100    bits: u8,
101}
102impl DATPACKR {
103    #[doc = r" Value of the field as raw bits"]
104    #[inline]
105    pub fn bits(&self) -> u8 {
106        self.bits
107    }
108}
109#[doc = r" Value of the field"]
110pub struct DATMPXR {
111    bits: u8,
112}
113impl DATMPXR {
114    #[doc = r" Value of the field as raw bits"]
115    #[inline]
116    pub fn bits(&self) -> u8 {
117        self.bits
118    }
119}
120#[doc = r" Value of the field"]
121pub struct CHINSELR {
122    bits: bool,
123}
124impl CHINSELR {
125    #[doc = r" Value of the field as raw bits"]
126    #[inline]
127    pub fn bit(&self) -> bool {
128        self.bits
129    }
130    #[doc = r" Returns `true` if the bit is clear (0)"]
131    #[inline]
132    pub fn bit_is_clear(&self) -> bool {
133        !self.bit()
134    }
135    #[doc = r" Returns `true` if the bit is set (1)"]
136    #[inline]
137    pub fn bit_is_set(&self) -> bool {
138        self.bit()
139    }
140}
141#[doc = r" Value of the field"]
142pub struct CHENR {
143    bits: bool,
144}
145impl CHENR {
146    #[doc = r" Value of the field as raw bits"]
147    #[inline]
148    pub fn bit(&self) -> bool {
149        self.bits
150    }
151    #[doc = r" Returns `true` if the bit is clear (0)"]
152    #[inline]
153    pub fn bit_is_clear(&self) -> bool {
154        !self.bit()
155    }
156    #[doc = r" Returns `true` if the bit is set (1)"]
157    #[inline]
158    pub fn bit_is_set(&self) -> bool {
159        self.bit()
160    }
161}
162#[doc = r" Value of the field"]
163pub struct CKABENR {
164    bits: bool,
165}
166impl CKABENR {
167    #[doc = r" Value of the field as raw bits"]
168    #[inline]
169    pub fn bit(&self) -> bool {
170        self.bits
171    }
172    #[doc = r" Returns `true` if the bit is clear (0)"]
173    #[inline]
174    pub fn bit_is_clear(&self) -> bool {
175        !self.bit()
176    }
177    #[doc = r" Returns `true` if the bit is set (1)"]
178    #[inline]
179    pub fn bit_is_set(&self) -> bool {
180        self.bit()
181    }
182}
183#[doc = r" Value of the field"]
184pub struct SCDENR {
185    bits: bool,
186}
187impl SCDENR {
188    #[doc = r" Value of the field as raw bits"]
189    #[inline]
190    pub fn bit(&self) -> bool {
191        self.bits
192    }
193    #[doc = r" Returns `true` if the bit is clear (0)"]
194    #[inline]
195    pub fn bit_is_clear(&self) -> bool {
196        !self.bit()
197    }
198    #[doc = r" Returns `true` if the bit is set (1)"]
199    #[inline]
200    pub fn bit_is_set(&self) -> bool {
201        self.bit()
202    }
203}
204#[doc = r" Value of the field"]
205pub struct SPICKSELR {
206    bits: u8,
207}
208impl SPICKSELR {
209    #[doc = r" Value of the field as raw bits"]
210    #[inline]
211    pub fn bits(&self) -> u8 {
212        self.bits
213    }
214}
215#[doc = r" Value of the field"]
216pub struct SITPR {
217    bits: u8,
218}
219impl SITPR {
220    #[doc = r" Value of the field as raw bits"]
221    #[inline]
222    pub fn bits(&self) -> u8 {
223        self.bits
224    }
225}
226#[doc = r" Proxy"]
227pub struct _DFSDMENW<'a> {
228    w: &'a mut W,
229}
230impl<'a> _DFSDMENW<'a> {
231    #[doc = r" Sets the field bit"]
232    pub fn set_bit(self) -> &'a mut W {
233        self.bit(true)
234    }
235    #[doc = r" Clears the field bit"]
236    pub fn clear_bit(self) -> &'a mut W {
237        self.bit(false)
238    }
239    #[doc = r" Writes raw bits to the field"]
240    #[inline]
241    pub fn bit(self, value: bool) -> &'a mut W {
242        const MASK: bool = true;
243        const OFFSET: u8 = 31;
244        self.w.bits &= !((MASK as u32) << OFFSET);
245        self.w.bits |= ((value & MASK) as u32) << OFFSET;
246        self.w
247    }
248}
249#[doc = r" Proxy"]
250pub struct _CKOUTSRCW<'a> {
251    w: &'a mut W,
252}
253impl<'a> _CKOUTSRCW<'a> {
254    #[doc = r" Sets the field bit"]
255    pub fn set_bit(self) -> &'a mut W {
256        self.bit(true)
257    }
258    #[doc = r" Clears the field bit"]
259    pub fn clear_bit(self) -> &'a mut W {
260        self.bit(false)
261    }
262    #[doc = r" Writes raw bits to the field"]
263    #[inline]
264    pub fn bit(self, value: bool) -> &'a mut W {
265        const MASK: bool = true;
266        const OFFSET: u8 = 30;
267        self.w.bits &= !((MASK as u32) << OFFSET);
268        self.w.bits |= ((value & MASK) as u32) << OFFSET;
269        self.w
270    }
271}
272#[doc = r" Proxy"]
273pub struct _CKOUTDIVW<'a> {
274    w: &'a mut W,
275}
276impl<'a> _CKOUTDIVW<'a> {
277    #[doc = r" Writes raw bits to the field"]
278    #[inline]
279    pub unsafe fn bits(self, value: u8) -> &'a mut W {
280        const MASK: u8 = 255;
281        const OFFSET: u8 = 16;
282        self.w.bits &= !((MASK as u32) << OFFSET);
283        self.w.bits |= ((value & MASK) as u32) << OFFSET;
284        self.w
285    }
286}
287#[doc = r" Proxy"]
288pub struct _DATPACKW<'a> {
289    w: &'a mut W,
290}
291impl<'a> _DATPACKW<'a> {
292    #[doc = r" Writes raw bits to the field"]
293    #[inline]
294    pub unsafe fn bits(self, value: u8) -> &'a mut W {
295        const MASK: u8 = 3;
296        const OFFSET: u8 = 14;
297        self.w.bits &= !((MASK as u32) << OFFSET);
298        self.w.bits |= ((value & MASK) as u32) << OFFSET;
299        self.w
300    }
301}
302#[doc = r" Proxy"]
303pub struct _DATMPXW<'a> {
304    w: &'a mut W,
305}
306impl<'a> _DATMPXW<'a> {
307    #[doc = r" Writes raw bits to the field"]
308    #[inline]
309    pub unsafe fn bits(self, value: u8) -> &'a mut W {
310        const MASK: u8 = 3;
311        const OFFSET: u8 = 12;
312        self.w.bits &= !((MASK as u32) << OFFSET);
313        self.w.bits |= ((value & MASK) as u32) << OFFSET;
314        self.w
315    }
316}
317#[doc = r" Proxy"]
318pub struct _CHINSELW<'a> {
319    w: &'a mut W,
320}
321impl<'a> _CHINSELW<'a> {
322    #[doc = r" Sets the field bit"]
323    pub fn set_bit(self) -> &'a mut W {
324        self.bit(true)
325    }
326    #[doc = r" Clears the field bit"]
327    pub fn clear_bit(self) -> &'a mut W {
328        self.bit(false)
329    }
330    #[doc = r" Writes raw bits to the field"]
331    #[inline]
332    pub fn bit(self, value: bool) -> &'a mut W {
333        const MASK: bool = true;
334        const OFFSET: u8 = 8;
335        self.w.bits &= !((MASK as u32) << OFFSET);
336        self.w.bits |= ((value & MASK) as u32) << OFFSET;
337        self.w
338    }
339}
340#[doc = r" Proxy"]
341pub struct _CHENW<'a> {
342    w: &'a mut W,
343}
344impl<'a> _CHENW<'a> {
345    #[doc = r" Sets the field bit"]
346    pub fn set_bit(self) -> &'a mut W {
347        self.bit(true)
348    }
349    #[doc = r" Clears the field bit"]
350    pub fn clear_bit(self) -> &'a mut W {
351        self.bit(false)
352    }
353    #[doc = r" Writes raw bits to the field"]
354    #[inline]
355    pub fn bit(self, value: bool) -> &'a mut W {
356        const MASK: bool = true;
357        const OFFSET: u8 = 7;
358        self.w.bits &= !((MASK as u32) << OFFSET);
359        self.w.bits |= ((value & MASK) as u32) << OFFSET;
360        self.w
361    }
362}
363#[doc = r" Proxy"]
364pub struct _CKABENW<'a> {
365    w: &'a mut W,
366}
367impl<'a> _CKABENW<'a> {
368    #[doc = r" Sets the field bit"]
369    pub fn set_bit(self) -> &'a mut W {
370        self.bit(true)
371    }
372    #[doc = r" Clears the field bit"]
373    pub fn clear_bit(self) -> &'a mut W {
374        self.bit(false)
375    }
376    #[doc = r" Writes raw bits to the field"]
377    #[inline]
378    pub fn bit(self, value: bool) -> &'a mut W {
379        const MASK: bool = true;
380        const OFFSET: u8 = 6;
381        self.w.bits &= !((MASK as u32) << OFFSET);
382        self.w.bits |= ((value & MASK) as u32) << OFFSET;
383        self.w
384    }
385}
386#[doc = r" Proxy"]
387pub struct _SCDENW<'a> {
388    w: &'a mut W,
389}
390impl<'a> _SCDENW<'a> {
391    #[doc = r" Sets the field bit"]
392    pub fn set_bit(self) -> &'a mut W {
393        self.bit(true)
394    }
395    #[doc = r" Clears the field bit"]
396    pub fn clear_bit(self) -> &'a mut W {
397        self.bit(false)
398    }
399    #[doc = r" Writes raw bits to the field"]
400    #[inline]
401    pub fn bit(self, value: bool) -> &'a mut W {
402        const MASK: bool = true;
403        const OFFSET: u8 = 5;
404        self.w.bits &= !((MASK as u32) << OFFSET);
405        self.w.bits |= ((value & MASK) as u32) << OFFSET;
406        self.w
407    }
408}
409#[doc = r" Proxy"]
410pub struct _SPICKSELW<'a> {
411    w: &'a mut W,
412}
413impl<'a> _SPICKSELW<'a> {
414    #[doc = r" Writes raw bits to the field"]
415    #[inline]
416    pub unsafe fn bits(self, value: u8) -> &'a mut W {
417        const MASK: u8 = 3;
418        const OFFSET: u8 = 2;
419        self.w.bits &= !((MASK as u32) << OFFSET);
420        self.w.bits |= ((value & MASK) as u32) << OFFSET;
421        self.w
422    }
423}
424#[doc = r" Proxy"]
425pub struct _SITPW<'a> {
426    w: &'a mut W,
427}
428impl<'a> _SITPW<'a> {
429    #[doc = r" Writes raw bits to the field"]
430    #[inline]
431    pub unsafe fn bits(self, value: u8) -> &'a mut W {
432        const MASK: u8 = 3;
433        const OFFSET: u8 = 0;
434        self.w.bits &= !((MASK as u32) << OFFSET);
435        self.w.bits |= ((value & MASK) as u32) << OFFSET;
436        self.w
437    }
438}
439impl R {
440    #[doc = r" Value of the register as raw bits"]
441    #[inline]
442    pub fn bits(&self) -> u32 {
443        self.bits
444    }
445    #[doc = "Bit 31 - DFSDMEN"]
446    #[inline]
447    pub fn dfsdmen(&self) -> DFSDMENR {
448        let bits = {
449            const MASK: bool = true;
450            const OFFSET: u8 = 31;
451            ((self.bits >> OFFSET) & MASK as u32) != 0
452        };
453        DFSDMENR { bits }
454    }
455    #[doc = "Bit 30 - CKOUTSRC"]
456    #[inline]
457    pub fn ckoutsrc(&self) -> CKOUTSRCR {
458        let bits = {
459            const MASK: bool = true;
460            const OFFSET: u8 = 30;
461            ((self.bits >> OFFSET) & MASK as u32) != 0
462        };
463        CKOUTSRCR { bits }
464    }
465    #[doc = "Bits 16:23 - CKOUTDIV"]
466    #[inline]
467    pub fn ckoutdiv(&self) -> CKOUTDIVR {
468        let bits = {
469            const MASK: u8 = 255;
470            const OFFSET: u8 = 16;
471            ((self.bits >> OFFSET) & MASK as u32) as u8
472        };
473        CKOUTDIVR { bits }
474    }
475    #[doc = "Bits 14:15 - DATPACK"]
476    #[inline]
477    pub fn datpack(&self) -> DATPACKR {
478        let bits = {
479            const MASK: u8 = 3;
480            const OFFSET: u8 = 14;
481            ((self.bits >> OFFSET) & MASK as u32) as u8
482        };
483        DATPACKR { bits }
484    }
485    #[doc = "Bits 12:13 - DATMPX"]
486    #[inline]
487    pub fn datmpx(&self) -> DATMPXR {
488        let bits = {
489            const MASK: u8 = 3;
490            const OFFSET: u8 = 12;
491            ((self.bits >> OFFSET) & MASK as u32) as u8
492        };
493        DATMPXR { bits }
494    }
495    #[doc = "Bit 8 - CHINSEL"]
496    #[inline]
497    pub fn chinsel(&self) -> CHINSELR {
498        let bits = {
499            const MASK: bool = true;
500            const OFFSET: u8 = 8;
501            ((self.bits >> OFFSET) & MASK as u32) != 0
502        };
503        CHINSELR { bits }
504    }
505    #[doc = "Bit 7 - CHEN"]
506    #[inline]
507    pub fn chen(&self) -> CHENR {
508        let bits = {
509            const MASK: bool = true;
510            const OFFSET: u8 = 7;
511            ((self.bits >> OFFSET) & MASK as u32) != 0
512        };
513        CHENR { bits }
514    }
515    #[doc = "Bit 6 - CKABEN"]
516    #[inline]
517    pub fn ckaben(&self) -> CKABENR {
518        let bits = {
519            const MASK: bool = true;
520            const OFFSET: u8 = 6;
521            ((self.bits >> OFFSET) & MASK as u32) != 0
522        };
523        CKABENR { bits }
524    }
525    #[doc = "Bit 5 - SCDEN"]
526    #[inline]
527    pub fn scden(&self) -> SCDENR {
528        let bits = {
529            const MASK: bool = true;
530            const OFFSET: u8 = 5;
531            ((self.bits >> OFFSET) & MASK as u32) != 0
532        };
533        SCDENR { bits }
534    }
535    #[doc = "Bits 2:3 - SPICKSEL"]
536    #[inline]
537    pub fn spicksel(&self) -> SPICKSELR {
538        let bits = {
539            const MASK: u8 = 3;
540            const OFFSET: u8 = 2;
541            ((self.bits >> OFFSET) & MASK as u32) as u8
542        };
543        SPICKSELR { bits }
544    }
545    #[doc = "Bits 0:1 - SITP"]
546    #[inline]
547    pub fn sitp(&self) -> SITPR {
548        let bits = {
549            const MASK: u8 = 3;
550            const OFFSET: u8 = 0;
551            ((self.bits >> OFFSET) & MASK as u32) as u8
552        };
553        SITPR { bits }
554    }
555}
556impl W {
557    #[doc = r" Reset value of the register"]
558    #[inline]
559    pub fn reset_value() -> W {
560        W { bits: 0 }
561    }
562    #[doc = r" Writes raw bits to the register"]
563    #[inline]
564    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
565        self.bits = bits;
566        self
567    }
568    #[doc = "Bit 31 - DFSDMEN"]
569    #[inline]
570    pub fn dfsdmen(&mut self) -> _DFSDMENW {
571        _DFSDMENW { w: self }
572    }
573    #[doc = "Bit 30 - CKOUTSRC"]
574    #[inline]
575    pub fn ckoutsrc(&mut self) -> _CKOUTSRCW {
576        _CKOUTSRCW { w: self }
577    }
578    #[doc = "Bits 16:23 - CKOUTDIV"]
579    #[inline]
580    pub fn ckoutdiv(&mut self) -> _CKOUTDIVW {
581        _CKOUTDIVW { w: self }
582    }
583    #[doc = "Bits 14:15 - DATPACK"]
584    #[inline]
585    pub fn datpack(&mut self) -> _DATPACKW {
586        _DATPACKW { w: self }
587    }
588    #[doc = "Bits 12:13 - DATMPX"]
589    #[inline]
590    pub fn datmpx(&mut self) -> _DATMPXW {
591        _DATMPXW { w: self }
592    }
593    #[doc = "Bit 8 - CHINSEL"]
594    #[inline]
595    pub fn chinsel(&mut self) -> _CHINSELW {
596        _CHINSELW { w: self }
597    }
598    #[doc = "Bit 7 - CHEN"]
599    #[inline]
600    pub fn chen(&mut self) -> _CHENW {
601        _CHENW { w: self }
602    }
603    #[doc = "Bit 6 - CKABEN"]
604    #[inline]
605    pub fn ckaben(&mut self) -> _CKABENW {
606        _CKABENW { w: self }
607    }
608    #[doc = "Bit 5 - SCDEN"]
609    #[inline]
610    pub fn scden(&mut self) -> _SCDENW {
611        _SCDENW { w: self }
612    }
613    #[doc = "Bits 2:3 - SPICKSEL"]
614    #[inline]
615    pub fn spicksel(&mut self) -> _SPICKSELW {
616        _SPICKSELW { w: self }
617    }
618    #[doc = "Bits 0:1 - SITP"]
619    #[inline]
620    pub fn sitp(&mut self) -> _SITPW {
621        _SITPW { w: self }
622    }
623}