stm32l4/stm32l4x1/sai1/ch/
clrfr.rs

1///Register `CLRFR` writer
2pub type W = crate::W<CLRFRrs>;
3/**Clear overrun / underrun
4
5Value on reset: 0*/
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum COVRUDRW {
9    ///1: Clears the OVRUDR flag
10    Clear = 1,
11}
12impl From<COVRUDRW> for bool {
13    #[inline(always)]
14    fn from(variant: COVRUDRW) -> Self {
15        variant as u8 != 0
16    }
17}
18///Field `COVRUDR` writer - Clear overrun / underrun
19pub type COVRUDR_W<'a, REG> = crate::BitWriter<'a, REG, COVRUDRW>;
20impl<'a, REG> COVRUDR_W<'a, REG>
21where
22    REG: crate::Writable + crate::RegisterSpec,
23{
24    ///Clears the OVRUDR flag
25    #[inline(always)]
26    pub fn clear(self) -> &'a mut crate::W<REG> {
27        self.variant(COVRUDRW::Clear)
28    }
29}
30/**Mute detection flag
31
32Value on reset: 0*/
33#[cfg_attr(feature = "defmt", derive(defmt::Format))]
34#[derive(Clone, Copy, Debug, PartialEq, Eq)]
35pub enum CMUTEDETW {
36    ///1: Clears the MUTEDET flag
37    Clear = 1,
38}
39impl From<CMUTEDETW> for bool {
40    #[inline(always)]
41    fn from(variant: CMUTEDETW) -> Self {
42        variant as u8 != 0
43    }
44}
45///Field `CMUTEDET` writer - Mute detection flag
46pub type CMUTEDET_W<'a, REG> = crate::BitWriter<'a, REG, CMUTEDETW>;
47impl<'a, REG> CMUTEDET_W<'a, REG>
48where
49    REG: crate::Writable + crate::RegisterSpec,
50{
51    ///Clears the MUTEDET flag
52    #[inline(always)]
53    pub fn clear(self) -> &'a mut crate::W<REG> {
54        self.variant(CMUTEDETW::Clear)
55    }
56}
57/**Clear wrong clock configuration flag
58
59Value on reset: 0*/
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum CWCKCFGW {
63    ///1: Clears the WCKCFG flag
64    Clear = 1,
65}
66impl From<CWCKCFGW> for bool {
67    #[inline(always)]
68    fn from(variant: CWCKCFGW) -> Self {
69        variant as u8 != 0
70    }
71}
72///Field `CWCKCFG` writer - Clear wrong clock configuration flag
73pub type CWCKCFG_W<'a, REG> = crate::BitWriter<'a, REG, CWCKCFGW>;
74impl<'a, REG> CWCKCFG_W<'a, REG>
75where
76    REG: crate::Writable + crate::RegisterSpec,
77{
78    ///Clears the WCKCFG flag
79    #[inline(always)]
80    pub fn clear(self) -> &'a mut crate::W<REG> {
81        self.variant(CWCKCFGW::Clear)
82    }
83}
84/**Clear codec not ready flag
85
86Value on reset: 0*/
87#[cfg_attr(feature = "defmt", derive(defmt::Format))]
88#[derive(Clone, Copy, Debug, PartialEq, Eq)]
89pub enum CCNRDYW {
90    ///1: Clears the CNRDY flag
91    Clear = 1,
92}
93impl From<CCNRDYW> for bool {
94    #[inline(always)]
95    fn from(variant: CCNRDYW) -> Self {
96        variant as u8 != 0
97    }
98}
99///Field `CCNRDY` writer - Clear codec not ready flag
100pub type CCNRDY_W<'a, REG> = crate::BitWriter<'a, REG, CCNRDYW>;
101impl<'a, REG> CCNRDY_W<'a, REG>
102where
103    REG: crate::Writable + crate::RegisterSpec,
104{
105    ///Clears the CNRDY flag
106    #[inline(always)]
107    pub fn clear(self) -> &'a mut crate::W<REG> {
108        self.variant(CCNRDYW::Clear)
109    }
110}
111/**Clear anticipated frame synchronization detection flag
112
113Value on reset: 0*/
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum CAFSDETW {
117    ///1: Clears the AFSDET flag
118    Clear = 1,
119}
120impl From<CAFSDETW> for bool {
121    #[inline(always)]
122    fn from(variant: CAFSDETW) -> Self {
123        variant as u8 != 0
124    }
125}
126///Field `CAFSDET` writer - Clear anticipated frame synchronization detection flag
127pub type CAFSDET_W<'a, REG> = crate::BitWriter<'a, REG, CAFSDETW>;
128impl<'a, REG> CAFSDET_W<'a, REG>
129where
130    REG: crate::Writable + crate::RegisterSpec,
131{
132    ///Clears the AFSDET flag
133    #[inline(always)]
134    pub fn clear(self) -> &'a mut crate::W<REG> {
135        self.variant(CAFSDETW::Clear)
136    }
137}
138/**Clear late frame synchronization detection flag
139
140Value on reset: 0*/
141#[cfg_attr(feature = "defmt", derive(defmt::Format))]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143pub enum CLFSDETW {
144    ///1: Clears the LFSDET flag
145    Clear = 1,
146}
147impl From<CLFSDETW> for bool {
148    #[inline(always)]
149    fn from(variant: CLFSDETW) -> Self {
150        variant as u8 != 0
151    }
152}
153///Field `CLFSDET` writer - Clear late frame synchronization detection flag
154pub type CLFSDET_W<'a, REG> = crate::BitWriter<'a, REG, CLFSDETW>;
155impl<'a, REG> CLFSDET_W<'a, REG>
156where
157    REG: crate::Writable + crate::RegisterSpec,
158{
159    ///Clears the LFSDET flag
160    #[inline(always)]
161    pub fn clear(self) -> &'a mut crate::W<REG> {
162        self.variant(CLFSDETW::Clear)
163    }
164}
165impl core::fmt::Debug for crate::generic::Reg<CLRFRrs> {
166    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
167        write!(f, "(not readable)")
168    }
169}
170impl W {
171    ///Bit 0 - Clear overrun / underrun
172    #[inline(always)]
173    pub fn covrudr(&mut self) -> COVRUDR_W<CLRFRrs> {
174        COVRUDR_W::new(self, 0)
175    }
176    ///Bit 1 - Mute detection flag
177    #[inline(always)]
178    pub fn cmutedet(&mut self) -> CMUTEDET_W<CLRFRrs> {
179        CMUTEDET_W::new(self, 1)
180    }
181    ///Bit 2 - Clear wrong clock configuration flag
182    #[inline(always)]
183    pub fn cwckcfg(&mut self) -> CWCKCFG_W<CLRFRrs> {
184        CWCKCFG_W::new(self, 2)
185    }
186    ///Bit 4 - Clear codec not ready flag
187    #[inline(always)]
188    pub fn ccnrdy(&mut self) -> CCNRDY_W<CLRFRrs> {
189        CCNRDY_W::new(self, 4)
190    }
191    ///Bit 5 - Clear anticipated frame synchronization detection flag
192    #[inline(always)]
193    pub fn cafsdet(&mut self) -> CAFSDET_W<CLRFRrs> {
194        CAFSDET_W::new(self, 5)
195    }
196    ///Bit 6 - Clear late frame synchronization detection flag
197    #[inline(always)]
198    pub fn clfsdet(&mut self) -> CLFSDET_W<CLRFRrs> {
199        CLFSDET_W::new(self, 6)
200    }
201}
202/**AClear flag register
203
204You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`clrfr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
205pub struct CLRFRrs;
206impl crate::RegisterSpec for CLRFRrs {
207    type Ux = u32;
208}
209///`write(|w| ..)` method takes [`clrfr::W`](W) writer structure
210impl crate::Writable for CLRFRrs {
211    type Safety = crate::Unsafe;
212}
213///`reset()` method sets CLRFR to value 0
214impl crate::Resettable for CLRFRrs {}