stm32l4/stm32l4x5/sai1/ch/
im.rs

1///Register `IM` reader
2pub type R = crate::R<IMrs>;
3///Register `IM` writer
4pub type W = crate::W<IMrs>;
5/**Overrun/underrun interrupt enable
6
7Value on reset: 0*/
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum OVRUDRIE {
11    ///0: Interrupt is disabled
12    Disabled = 0,
13    ///1: Interrupt is enabled
14    Enabled = 1,
15}
16impl From<OVRUDRIE> for bool {
17    #[inline(always)]
18    fn from(variant: OVRUDRIE) -> Self {
19        variant as u8 != 0
20    }
21}
22///Field `OVRUDRIE` reader - Overrun/underrun interrupt enable
23pub type OVRUDRIE_R = crate::BitReader<OVRUDRIE>;
24impl OVRUDRIE_R {
25    ///Get enumerated values variant
26    #[inline(always)]
27    pub const fn variant(&self) -> OVRUDRIE {
28        match self.bits {
29            false => OVRUDRIE::Disabled,
30            true => OVRUDRIE::Enabled,
31        }
32    }
33    ///Interrupt is disabled
34    #[inline(always)]
35    pub fn is_disabled(&self) -> bool {
36        *self == OVRUDRIE::Disabled
37    }
38    ///Interrupt is enabled
39    #[inline(always)]
40    pub fn is_enabled(&self) -> bool {
41        *self == OVRUDRIE::Enabled
42    }
43}
44///Field `OVRUDRIE` writer - Overrun/underrun interrupt enable
45pub type OVRUDRIE_W<'a, REG> = crate::BitWriter<'a, REG, OVRUDRIE>;
46impl<'a, REG> OVRUDRIE_W<'a, REG>
47where
48    REG: crate::Writable + crate::RegisterSpec,
49{
50    ///Interrupt is disabled
51    #[inline(always)]
52    pub fn disabled(self) -> &'a mut crate::W<REG> {
53        self.variant(OVRUDRIE::Disabled)
54    }
55    ///Interrupt is enabled
56    #[inline(always)]
57    pub fn enabled(self) -> &'a mut crate::W<REG> {
58        self.variant(OVRUDRIE::Enabled)
59    }
60}
61/**Mute detection interrupt enable
62
63Value on reset: 0*/
64#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum MUTEDETIE {
67    ///0: Interrupt is disabled
68    Disabled = 0,
69    ///1: Interrupt is enabled
70    Enabled = 1,
71}
72impl From<MUTEDETIE> for bool {
73    #[inline(always)]
74    fn from(variant: MUTEDETIE) -> Self {
75        variant as u8 != 0
76    }
77}
78///Field `MUTEDETIE` reader - Mute detection interrupt enable
79pub type MUTEDETIE_R = crate::BitReader<MUTEDETIE>;
80impl MUTEDETIE_R {
81    ///Get enumerated values variant
82    #[inline(always)]
83    pub const fn variant(&self) -> MUTEDETIE {
84        match self.bits {
85            false => MUTEDETIE::Disabled,
86            true => MUTEDETIE::Enabled,
87        }
88    }
89    ///Interrupt is disabled
90    #[inline(always)]
91    pub fn is_disabled(&self) -> bool {
92        *self == MUTEDETIE::Disabled
93    }
94    ///Interrupt is enabled
95    #[inline(always)]
96    pub fn is_enabled(&self) -> bool {
97        *self == MUTEDETIE::Enabled
98    }
99}
100///Field `MUTEDETIE` writer - Mute detection interrupt enable
101pub type MUTEDETIE_W<'a, REG> = crate::BitWriter<'a, REG, MUTEDETIE>;
102impl<'a, REG> MUTEDETIE_W<'a, REG>
103where
104    REG: crate::Writable + crate::RegisterSpec,
105{
106    ///Interrupt is disabled
107    #[inline(always)]
108    pub fn disabled(self) -> &'a mut crate::W<REG> {
109        self.variant(MUTEDETIE::Disabled)
110    }
111    ///Interrupt is enabled
112    #[inline(always)]
113    pub fn enabled(self) -> &'a mut crate::W<REG> {
114        self.variant(MUTEDETIE::Enabled)
115    }
116}
117/**Wrong clock configuration interrupt enable
118
119Value on reset: 0*/
120#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum WCKCFGIE {
123    ///0: Interrupt is disabled
124    Disabled = 0,
125    ///1: Interrupt is enabled
126    Enabled = 1,
127}
128impl From<WCKCFGIE> for bool {
129    #[inline(always)]
130    fn from(variant: WCKCFGIE) -> Self {
131        variant as u8 != 0
132    }
133}
134///Field `WCKCFGIE` reader - Wrong clock configuration interrupt enable
135pub type WCKCFGIE_R = crate::BitReader<WCKCFGIE>;
136impl WCKCFGIE_R {
137    ///Get enumerated values variant
138    #[inline(always)]
139    pub const fn variant(&self) -> WCKCFGIE {
140        match self.bits {
141            false => WCKCFGIE::Disabled,
142            true => WCKCFGIE::Enabled,
143        }
144    }
145    ///Interrupt is disabled
146    #[inline(always)]
147    pub fn is_disabled(&self) -> bool {
148        *self == WCKCFGIE::Disabled
149    }
150    ///Interrupt is enabled
151    #[inline(always)]
152    pub fn is_enabled(&self) -> bool {
153        *self == WCKCFGIE::Enabled
154    }
155}
156///Field `WCKCFGIE` writer - Wrong clock configuration interrupt enable
157pub type WCKCFGIE_W<'a, REG> = crate::BitWriter<'a, REG, WCKCFGIE>;
158impl<'a, REG> WCKCFGIE_W<'a, REG>
159where
160    REG: crate::Writable + crate::RegisterSpec,
161{
162    ///Interrupt is disabled
163    #[inline(always)]
164    pub fn disabled(self) -> &'a mut crate::W<REG> {
165        self.variant(WCKCFGIE::Disabled)
166    }
167    ///Interrupt is enabled
168    #[inline(always)]
169    pub fn enabled(self) -> &'a mut crate::W<REG> {
170        self.variant(WCKCFGIE::Enabled)
171    }
172}
173/**FIFO request interrupt enable
174
175Value on reset: 0*/
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum FREQIE {
179    ///0: Interrupt is disabled
180    Disabled = 0,
181    ///1: Interrupt is enabled
182    Enabled = 1,
183}
184impl From<FREQIE> for bool {
185    #[inline(always)]
186    fn from(variant: FREQIE) -> Self {
187        variant as u8 != 0
188    }
189}
190///Field `FREQIE` reader - FIFO request interrupt enable
191pub type FREQIE_R = crate::BitReader<FREQIE>;
192impl FREQIE_R {
193    ///Get enumerated values variant
194    #[inline(always)]
195    pub const fn variant(&self) -> FREQIE {
196        match self.bits {
197            false => FREQIE::Disabled,
198            true => FREQIE::Enabled,
199        }
200    }
201    ///Interrupt is disabled
202    #[inline(always)]
203    pub fn is_disabled(&self) -> bool {
204        *self == FREQIE::Disabled
205    }
206    ///Interrupt is enabled
207    #[inline(always)]
208    pub fn is_enabled(&self) -> bool {
209        *self == FREQIE::Enabled
210    }
211}
212///Field `FREQIE` writer - FIFO request interrupt enable
213pub type FREQIE_W<'a, REG> = crate::BitWriter<'a, REG, FREQIE>;
214impl<'a, REG> FREQIE_W<'a, REG>
215where
216    REG: crate::Writable + crate::RegisterSpec,
217{
218    ///Interrupt is disabled
219    #[inline(always)]
220    pub fn disabled(self) -> &'a mut crate::W<REG> {
221        self.variant(FREQIE::Disabled)
222    }
223    ///Interrupt is enabled
224    #[inline(always)]
225    pub fn enabled(self) -> &'a mut crate::W<REG> {
226        self.variant(FREQIE::Enabled)
227    }
228}
229/**Codec not ready interrupt enable
230
231Value on reset: 0*/
232#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum CNRDYIE {
235    ///0: Interrupt is disabled
236    Disabled = 0,
237    ///1: Interrupt is enabled
238    Enabled = 1,
239}
240impl From<CNRDYIE> for bool {
241    #[inline(always)]
242    fn from(variant: CNRDYIE) -> Self {
243        variant as u8 != 0
244    }
245}
246///Field `CNRDYIE` reader - Codec not ready interrupt enable
247pub type CNRDYIE_R = crate::BitReader<CNRDYIE>;
248impl CNRDYIE_R {
249    ///Get enumerated values variant
250    #[inline(always)]
251    pub const fn variant(&self) -> CNRDYIE {
252        match self.bits {
253            false => CNRDYIE::Disabled,
254            true => CNRDYIE::Enabled,
255        }
256    }
257    ///Interrupt is disabled
258    #[inline(always)]
259    pub fn is_disabled(&self) -> bool {
260        *self == CNRDYIE::Disabled
261    }
262    ///Interrupt is enabled
263    #[inline(always)]
264    pub fn is_enabled(&self) -> bool {
265        *self == CNRDYIE::Enabled
266    }
267}
268///Field `CNRDYIE` writer - Codec not ready interrupt enable
269pub type CNRDYIE_W<'a, REG> = crate::BitWriter<'a, REG, CNRDYIE>;
270impl<'a, REG> CNRDYIE_W<'a, REG>
271where
272    REG: crate::Writable + crate::RegisterSpec,
273{
274    ///Interrupt is disabled
275    #[inline(always)]
276    pub fn disabled(self) -> &'a mut crate::W<REG> {
277        self.variant(CNRDYIE::Disabled)
278    }
279    ///Interrupt is enabled
280    #[inline(always)]
281    pub fn enabled(self) -> &'a mut crate::W<REG> {
282        self.variant(CNRDYIE::Enabled)
283    }
284}
285/**Anticipated frame synchronization detection interrupt enable
286
287Value on reset: 0*/
288#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum AFSDETIE {
291    ///0: Interrupt is disabled
292    Disabled = 0,
293    ///1: Interrupt is enabled
294    Enabled = 1,
295}
296impl From<AFSDETIE> for bool {
297    #[inline(always)]
298    fn from(variant: AFSDETIE) -> Self {
299        variant as u8 != 0
300    }
301}
302///Field `AFSDETIE` reader - Anticipated frame synchronization detection interrupt enable
303pub type AFSDETIE_R = crate::BitReader<AFSDETIE>;
304impl AFSDETIE_R {
305    ///Get enumerated values variant
306    #[inline(always)]
307    pub const fn variant(&self) -> AFSDETIE {
308        match self.bits {
309            false => AFSDETIE::Disabled,
310            true => AFSDETIE::Enabled,
311        }
312    }
313    ///Interrupt is disabled
314    #[inline(always)]
315    pub fn is_disabled(&self) -> bool {
316        *self == AFSDETIE::Disabled
317    }
318    ///Interrupt is enabled
319    #[inline(always)]
320    pub fn is_enabled(&self) -> bool {
321        *self == AFSDETIE::Enabled
322    }
323}
324///Field `AFSDETIE` writer - Anticipated frame synchronization detection interrupt enable
325pub type AFSDETIE_W<'a, REG> = crate::BitWriter<'a, REG, AFSDETIE>;
326impl<'a, REG> AFSDETIE_W<'a, REG>
327where
328    REG: crate::Writable + crate::RegisterSpec,
329{
330    ///Interrupt is disabled
331    #[inline(always)]
332    pub fn disabled(self) -> &'a mut crate::W<REG> {
333        self.variant(AFSDETIE::Disabled)
334    }
335    ///Interrupt is enabled
336    #[inline(always)]
337    pub fn enabled(self) -> &'a mut crate::W<REG> {
338        self.variant(AFSDETIE::Enabled)
339    }
340}
341/**Late frame synchronization detection interrupt enable
342
343Value on reset: 0*/
344#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum LFSDETIE {
347    ///0: Interrupt is disabled
348    Disabled = 0,
349    ///1: Interrupt is enabled
350    Enabled = 1,
351}
352impl From<LFSDETIE> for bool {
353    #[inline(always)]
354    fn from(variant: LFSDETIE) -> Self {
355        variant as u8 != 0
356    }
357}
358///Field `LFSDETIE` reader - Late frame synchronization detection interrupt enable
359pub type LFSDETIE_R = crate::BitReader<LFSDETIE>;
360impl LFSDETIE_R {
361    ///Get enumerated values variant
362    #[inline(always)]
363    pub const fn variant(&self) -> LFSDETIE {
364        match self.bits {
365            false => LFSDETIE::Disabled,
366            true => LFSDETIE::Enabled,
367        }
368    }
369    ///Interrupt is disabled
370    #[inline(always)]
371    pub fn is_disabled(&self) -> bool {
372        *self == LFSDETIE::Disabled
373    }
374    ///Interrupt is enabled
375    #[inline(always)]
376    pub fn is_enabled(&self) -> bool {
377        *self == LFSDETIE::Enabled
378    }
379}
380///Field `LFSDETIE` writer - Late frame synchronization detection interrupt enable
381pub type LFSDETIE_W<'a, REG> = crate::BitWriter<'a, REG, LFSDETIE>;
382impl<'a, REG> LFSDETIE_W<'a, REG>
383where
384    REG: crate::Writable + crate::RegisterSpec,
385{
386    ///Interrupt is disabled
387    #[inline(always)]
388    pub fn disabled(self) -> &'a mut crate::W<REG> {
389        self.variant(LFSDETIE::Disabled)
390    }
391    ///Interrupt is enabled
392    #[inline(always)]
393    pub fn enabled(self) -> &'a mut crate::W<REG> {
394        self.variant(LFSDETIE::Enabled)
395    }
396}
397impl R {
398    ///Bit 0 - Overrun/underrun interrupt enable
399    #[inline(always)]
400    pub fn ovrudrie(&self) -> OVRUDRIE_R {
401        OVRUDRIE_R::new((self.bits & 1) != 0)
402    }
403    ///Bit 1 - Mute detection interrupt enable
404    #[inline(always)]
405    pub fn mutedetie(&self) -> MUTEDETIE_R {
406        MUTEDETIE_R::new(((self.bits >> 1) & 1) != 0)
407    }
408    ///Bit 2 - Wrong clock configuration interrupt enable
409    #[inline(always)]
410    pub fn wckcfgie(&self) -> WCKCFGIE_R {
411        WCKCFGIE_R::new(((self.bits >> 2) & 1) != 0)
412    }
413    ///Bit 3 - FIFO request interrupt enable
414    #[inline(always)]
415    pub fn freqie(&self) -> FREQIE_R {
416        FREQIE_R::new(((self.bits >> 3) & 1) != 0)
417    }
418    ///Bit 4 - Codec not ready interrupt enable
419    #[inline(always)]
420    pub fn cnrdyie(&self) -> CNRDYIE_R {
421        CNRDYIE_R::new(((self.bits >> 4) & 1) != 0)
422    }
423    ///Bit 5 - Anticipated frame synchronization detection interrupt enable
424    #[inline(always)]
425    pub fn afsdetie(&self) -> AFSDETIE_R {
426        AFSDETIE_R::new(((self.bits >> 5) & 1) != 0)
427    }
428    ///Bit 6 - Late frame synchronization detection interrupt enable
429    #[inline(always)]
430    pub fn lfsdetie(&self) -> LFSDETIE_R {
431        LFSDETIE_R::new(((self.bits >> 6) & 1) != 0)
432    }
433}
434impl core::fmt::Debug for R {
435    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
436        f.debug_struct("IM")
437            .field("lfsdetie", &self.lfsdetie())
438            .field("afsdetie", &self.afsdetie())
439            .field("cnrdyie", &self.cnrdyie())
440            .field("freqie", &self.freqie())
441            .field("wckcfgie", &self.wckcfgie())
442            .field("mutedetie", &self.mutedetie())
443            .field("ovrudrie", &self.ovrudrie())
444            .finish()
445    }
446}
447impl W {
448    ///Bit 0 - Overrun/underrun interrupt enable
449    #[inline(always)]
450    pub fn ovrudrie(&mut self) -> OVRUDRIE_W<IMrs> {
451        OVRUDRIE_W::new(self, 0)
452    }
453    ///Bit 1 - Mute detection interrupt enable
454    #[inline(always)]
455    pub fn mutedetie(&mut self) -> MUTEDETIE_W<IMrs> {
456        MUTEDETIE_W::new(self, 1)
457    }
458    ///Bit 2 - Wrong clock configuration interrupt enable
459    #[inline(always)]
460    pub fn wckcfgie(&mut self) -> WCKCFGIE_W<IMrs> {
461        WCKCFGIE_W::new(self, 2)
462    }
463    ///Bit 3 - FIFO request interrupt enable
464    #[inline(always)]
465    pub fn freqie(&mut self) -> FREQIE_W<IMrs> {
466        FREQIE_W::new(self, 3)
467    }
468    ///Bit 4 - Codec not ready interrupt enable
469    #[inline(always)]
470    pub fn cnrdyie(&mut self) -> CNRDYIE_W<IMrs> {
471        CNRDYIE_W::new(self, 4)
472    }
473    ///Bit 5 - Anticipated frame synchronization detection interrupt enable
474    #[inline(always)]
475    pub fn afsdetie(&mut self) -> AFSDETIE_W<IMrs> {
476        AFSDETIE_W::new(self, 5)
477    }
478    ///Bit 6 - Late frame synchronization detection interrupt enable
479    #[inline(always)]
480    pub fn lfsdetie(&mut self) -> LFSDETIE_W<IMrs> {
481        LFSDETIE_W::new(self, 6)
482    }
483}
484/**AInterrupt mask register2
485
486You can [`read`](crate::Reg::read) this register and get [`im::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`im::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
487pub struct IMrs;
488impl crate::RegisterSpec for IMrs {
489    type Ux = u32;
490}
491///`read()` method returns [`im::R`](R) reader structure
492impl crate::Readable for IMrs {}
493///`write(|w| ..)` method takes [`im::W`](W) writer structure
494impl crate::Writable for IMrs {
495    type Safety = crate::Unsafe;
496}
497///`reset()` method sets IM to value 0
498impl crate::Resettable for IMrs {}