bl702_pac/i2s/
i2s_config.rs

1#[doc = "Register `i2s_config` reader"]
2pub struct R(crate::R<I2S_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<I2S_CONFIG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<I2S_CONFIG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<I2S_CONFIG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `i2s_config` writer"]
17pub struct W(crate::W<I2S_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<I2S_CONFIG_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<I2S_CONFIG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<I2S_CONFIG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `cr_i2s_m_en` reader - "]
38pub type CR_I2S_M_EN_R = crate::BitReader<bool>;
39#[doc = "Field `cr_i2s_m_en` writer - "]
40pub type CR_I2S_M_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
41#[doc = "Field `cr_i2s_s_en` reader - "]
42pub type CR_I2S_S_EN_R = crate::BitReader<bool>;
43#[doc = "Field `cr_i2s_s_en` writer - "]
44pub type CR_I2S_S_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
45#[doc = "Field `cr_i2s_txd_en` reader - "]
46pub type CR_I2S_TXD_EN_R = crate::BitReader<bool>;
47#[doc = "Field `cr_i2s_txd_en` writer - "]
48pub type CR_I2S_TXD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
49#[doc = "Field `cr_i2s_rxd_en` reader - "]
50pub type CR_I2S_RXD_EN_R = crate::BitReader<bool>;
51#[doc = "Field `cr_i2s_rxd_en` writer - "]
52pub type CR_I2S_RXD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
53#[doc = "Field `cr_mono_mode` reader - "]
54pub type CR_MONO_MODE_R = crate::BitReader<bool>;
55#[doc = "Field `cr_mono_mode` writer - "]
56pub type CR_MONO_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
57#[doc = "Field `cr_mute_mode` reader - "]
58pub type CR_MUTE_MODE_R = crate::BitReader<bool>;
59#[doc = "Field `cr_mute_mode` writer - "]
60pub type CR_MUTE_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
61#[doc = "Field `cr_fs_1t_mode` reader - "]
62pub type CR_FS_1T_MODE_R = crate::BitReader<bool>;
63#[doc = "Field `cr_fs_1t_mode` writer - "]
64pub type CR_FS_1T_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
65#[doc = "Field `cr_fs_4ch_mode` reader - "]
66pub type CR_FS_4CH_MODE_R = crate::BitReader<bool>;
67#[doc = "Field `cr_fs_4ch_mode` writer - "]
68pub type CR_FS_4CH_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
69#[doc = "Field `cr_fs_3ch_mode` reader - "]
70pub type CR_FS_3CH_MODE_R = crate::BitReader<bool>;
71#[doc = "Field `cr_fs_3ch_mode` writer - "]
72pub type CR_FS_3CH_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
73#[doc = "Field `cr_frame_size` reader - "]
74pub type CR_FRAME_SIZE_R = crate::FieldReader<u8, u8>;
75#[doc = "Field `cr_frame_size` writer - "]
76pub type CR_FRAME_SIZE_W<'a, const O: u8> =
77    crate::FieldWriter<'a, u32, I2S_CONFIG_SPEC, u8, u8, 2, O>;
78#[doc = "Field `cr_data_size` reader - "]
79pub type CR_DATA_SIZE_R = crate::FieldReader<u8, u8>;
80#[doc = "Field `cr_data_size` writer - "]
81pub type CR_DATA_SIZE_W<'a, const O: u8> =
82    crate::FieldWriter<'a, u32, I2S_CONFIG_SPEC, u8, u8, 2, O>;
83#[doc = "Field `cr_i2s_mode` reader - "]
84pub type CR_I2S_MODE_R = crate::FieldReader<u8, u8>;
85#[doc = "Field `cr_i2s_mode` writer - "]
86pub type CR_I2S_MODE_W<'a, const O: u8> =
87    crate::FieldWriter<'a, u32, I2S_CONFIG_SPEC, u8, u8, 2, O>;
88#[doc = "Field `cr_endian` reader - "]
89pub type CR_ENDIAN_R = crate::BitReader<bool>;
90#[doc = "Field `cr_endian` writer - "]
91pub type CR_ENDIAN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
92#[doc = "Field `cr_mono_rx_ch` reader - "]
93pub type CR_MONO_RX_CH_R = crate::BitReader<bool>;
94#[doc = "Field `cr_mono_rx_ch` writer - "]
95pub type CR_MONO_RX_CH_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
96#[doc = "Field `cr_ofs_cnt` reader - "]
97pub type CR_OFS_CNT_R = crate::FieldReader<u8, u8>;
98#[doc = "Field `cr_ofs_cnt` writer - "]
99pub type CR_OFS_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, I2S_CONFIG_SPEC, u8, u8, 5, O>;
100#[doc = "Field `cr_ofs_en` reader - "]
101pub type CR_OFS_EN_R = crate::BitReader<bool>;
102#[doc = "Field `cr_ofs_en` writer - "]
103pub type CR_OFS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_CONFIG_SPEC, bool, O>;
104impl R {
105    #[doc = "Bit 0"]
106    #[inline(always)]
107    pub fn cr_i2s_m_en(&self) -> CR_I2S_M_EN_R {
108        CR_I2S_M_EN_R::new((self.bits & 1) != 0)
109    }
110    #[doc = "Bit 1"]
111    #[inline(always)]
112    pub fn cr_i2s_s_en(&self) -> CR_I2S_S_EN_R {
113        CR_I2S_S_EN_R::new(((self.bits >> 1) & 1) != 0)
114    }
115    #[doc = "Bit 2"]
116    #[inline(always)]
117    pub fn cr_i2s_txd_en(&self) -> CR_I2S_TXD_EN_R {
118        CR_I2S_TXD_EN_R::new(((self.bits >> 2) & 1) != 0)
119    }
120    #[doc = "Bit 3"]
121    #[inline(always)]
122    pub fn cr_i2s_rxd_en(&self) -> CR_I2S_RXD_EN_R {
123        CR_I2S_RXD_EN_R::new(((self.bits >> 3) & 1) != 0)
124    }
125    #[doc = "Bit 4"]
126    #[inline(always)]
127    pub fn cr_mono_mode(&self) -> CR_MONO_MODE_R {
128        CR_MONO_MODE_R::new(((self.bits >> 4) & 1) != 0)
129    }
130    #[doc = "Bit 5"]
131    #[inline(always)]
132    pub fn cr_mute_mode(&self) -> CR_MUTE_MODE_R {
133        CR_MUTE_MODE_R::new(((self.bits >> 5) & 1) != 0)
134    }
135    #[doc = "Bit 6"]
136    #[inline(always)]
137    pub fn cr_fs_1t_mode(&self) -> CR_FS_1T_MODE_R {
138        CR_FS_1T_MODE_R::new(((self.bits >> 6) & 1) != 0)
139    }
140    #[doc = "Bit 7"]
141    #[inline(always)]
142    pub fn cr_fs_4ch_mode(&self) -> CR_FS_4CH_MODE_R {
143        CR_FS_4CH_MODE_R::new(((self.bits >> 7) & 1) != 0)
144    }
145    #[doc = "Bit 8"]
146    #[inline(always)]
147    pub fn cr_fs_3ch_mode(&self) -> CR_FS_3CH_MODE_R {
148        CR_FS_3CH_MODE_R::new(((self.bits >> 8) & 1) != 0)
149    }
150    #[doc = "Bits 12:13"]
151    #[inline(always)]
152    pub fn cr_frame_size(&self) -> CR_FRAME_SIZE_R {
153        CR_FRAME_SIZE_R::new(((self.bits >> 12) & 3) as u8)
154    }
155    #[doc = "Bits 14:15"]
156    #[inline(always)]
157    pub fn cr_data_size(&self) -> CR_DATA_SIZE_R {
158        CR_DATA_SIZE_R::new(((self.bits >> 14) & 3) as u8)
159    }
160    #[doc = "Bits 16:17"]
161    #[inline(always)]
162    pub fn cr_i2s_mode(&self) -> CR_I2S_MODE_R {
163        CR_I2S_MODE_R::new(((self.bits >> 16) & 3) as u8)
164    }
165    #[doc = "Bit 18"]
166    #[inline(always)]
167    pub fn cr_endian(&self) -> CR_ENDIAN_R {
168        CR_ENDIAN_R::new(((self.bits >> 18) & 1) != 0)
169    }
170    #[doc = "Bit 19"]
171    #[inline(always)]
172    pub fn cr_mono_rx_ch(&self) -> CR_MONO_RX_CH_R {
173        CR_MONO_RX_CH_R::new(((self.bits >> 19) & 1) != 0)
174    }
175    #[doc = "Bits 20:24"]
176    #[inline(always)]
177    pub fn cr_ofs_cnt(&self) -> CR_OFS_CNT_R {
178        CR_OFS_CNT_R::new(((self.bits >> 20) & 0x1f) as u8)
179    }
180    #[doc = "Bit 25"]
181    #[inline(always)]
182    pub fn cr_ofs_en(&self) -> CR_OFS_EN_R {
183        CR_OFS_EN_R::new(((self.bits >> 25) & 1) != 0)
184    }
185}
186impl W {
187    #[doc = "Bit 0"]
188    #[inline(always)]
189    #[must_use]
190    pub fn cr_i2s_m_en(&mut self) -> CR_I2S_M_EN_W<0> {
191        CR_I2S_M_EN_W::new(self)
192    }
193    #[doc = "Bit 1"]
194    #[inline(always)]
195    #[must_use]
196    pub fn cr_i2s_s_en(&mut self) -> CR_I2S_S_EN_W<1> {
197        CR_I2S_S_EN_W::new(self)
198    }
199    #[doc = "Bit 2"]
200    #[inline(always)]
201    #[must_use]
202    pub fn cr_i2s_txd_en(&mut self) -> CR_I2S_TXD_EN_W<2> {
203        CR_I2S_TXD_EN_W::new(self)
204    }
205    #[doc = "Bit 3"]
206    #[inline(always)]
207    #[must_use]
208    pub fn cr_i2s_rxd_en(&mut self) -> CR_I2S_RXD_EN_W<3> {
209        CR_I2S_RXD_EN_W::new(self)
210    }
211    #[doc = "Bit 4"]
212    #[inline(always)]
213    #[must_use]
214    pub fn cr_mono_mode(&mut self) -> CR_MONO_MODE_W<4> {
215        CR_MONO_MODE_W::new(self)
216    }
217    #[doc = "Bit 5"]
218    #[inline(always)]
219    #[must_use]
220    pub fn cr_mute_mode(&mut self) -> CR_MUTE_MODE_W<5> {
221        CR_MUTE_MODE_W::new(self)
222    }
223    #[doc = "Bit 6"]
224    #[inline(always)]
225    #[must_use]
226    pub fn cr_fs_1t_mode(&mut self) -> CR_FS_1T_MODE_W<6> {
227        CR_FS_1T_MODE_W::new(self)
228    }
229    #[doc = "Bit 7"]
230    #[inline(always)]
231    #[must_use]
232    pub fn cr_fs_4ch_mode(&mut self) -> CR_FS_4CH_MODE_W<7> {
233        CR_FS_4CH_MODE_W::new(self)
234    }
235    #[doc = "Bit 8"]
236    #[inline(always)]
237    #[must_use]
238    pub fn cr_fs_3ch_mode(&mut self) -> CR_FS_3CH_MODE_W<8> {
239        CR_FS_3CH_MODE_W::new(self)
240    }
241    #[doc = "Bits 12:13"]
242    #[inline(always)]
243    #[must_use]
244    pub fn cr_frame_size(&mut self) -> CR_FRAME_SIZE_W<12> {
245        CR_FRAME_SIZE_W::new(self)
246    }
247    #[doc = "Bits 14:15"]
248    #[inline(always)]
249    #[must_use]
250    pub fn cr_data_size(&mut self) -> CR_DATA_SIZE_W<14> {
251        CR_DATA_SIZE_W::new(self)
252    }
253    #[doc = "Bits 16:17"]
254    #[inline(always)]
255    #[must_use]
256    pub fn cr_i2s_mode(&mut self) -> CR_I2S_MODE_W<16> {
257        CR_I2S_MODE_W::new(self)
258    }
259    #[doc = "Bit 18"]
260    #[inline(always)]
261    #[must_use]
262    pub fn cr_endian(&mut self) -> CR_ENDIAN_W<18> {
263        CR_ENDIAN_W::new(self)
264    }
265    #[doc = "Bit 19"]
266    #[inline(always)]
267    #[must_use]
268    pub fn cr_mono_rx_ch(&mut self) -> CR_MONO_RX_CH_W<19> {
269        CR_MONO_RX_CH_W::new(self)
270    }
271    #[doc = "Bits 20:24"]
272    #[inline(always)]
273    #[must_use]
274    pub fn cr_ofs_cnt(&mut self) -> CR_OFS_CNT_W<20> {
275        CR_OFS_CNT_W::new(self)
276    }
277    #[doc = "Bit 25"]
278    #[inline(always)]
279    #[must_use]
280    pub fn cr_ofs_en(&mut self) -> CR_OFS_EN_W<25> {
281        CR_OFS_EN_W::new(self)
282    }
283    #[doc = "Writes raw bits to the register."]
284    #[inline(always)]
285    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
286        self.0.bits(bits);
287        self
288    }
289}
290#[doc = "i2s_config.\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 [i2s_config](index.html) module"]
291pub struct I2S_CONFIG_SPEC;
292impl crate::RegisterSpec for I2S_CONFIG_SPEC {
293    type Ux = u32;
294}
295#[doc = "`read()` method returns [i2s_config::R](R) reader structure"]
296impl crate::Readable for I2S_CONFIG_SPEC {
297    type Reader = R;
298}
299#[doc = "`write(|w| ..)` method takes [i2s_config::W](W) writer structure"]
300impl crate::Writable for I2S_CONFIG_SPEC {
301    type Writer = W;
302    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
303    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
304}
305#[doc = "`reset()` method sets i2s_config to value 0"]
306impl crate::Resettable for I2S_CONFIG_SPEC {
307    const RESET_VALUE: Self::Ux = 0;
308}