esp8266/slc/
slc_conf0.rs

1#[doc = "Register `SLC_CONF0` reader"]
2pub struct R(crate::R<SLC_CONF0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SLC_CONF0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SLC_CONF0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SLC_CONF0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SLC_CONF0` writer"]
17pub struct W(crate::W<SLC_CONF0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SLC_CONF0_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<SLC_CONF0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SLC_CONF0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SLC_MODE` reader - "]
38pub struct SLC_MODE_R(crate::FieldReader<u8, u8>);
39impl SLC_MODE_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        SLC_MODE_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for SLC_MODE_R {
46    type Target = crate::FieldReader<u8, u8>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `SLC_MODE` writer - "]
53pub struct SLC_MODE_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> SLC_MODE_W<'a> {
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u8) -> &'a mut W {
60        self.w.bits = (self.w.bits & !(3 << 12)) | ((value as u32 & 3) << 12);
61        self.w
62    }
63}
64#[doc = "Field `SLC_DATA_BURST_EN` reader - "]
65pub struct SLC_DATA_BURST_EN_R(crate::FieldReader<bool, bool>);
66impl SLC_DATA_BURST_EN_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: bool) -> Self {
69        SLC_DATA_BURST_EN_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for SLC_DATA_BURST_EN_R {
73    type Target = crate::FieldReader<bool, bool>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `SLC_DATA_BURST_EN` writer - "]
80pub struct SLC_DATA_BURST_EN_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> SLC_DATA_BURST_EN_W<'a> {
84    #[doc = r"Sets the field bit"]
85    #[inline(always)]
86    pub fn set_bit(self) -> &'a mut W {
87        self.bit(true)
88    }
89    #[doc = r"Clears the field bit"]
90    #[inline(always)]
91    pub fn clear_bit(self) -> &'a mut W {
92        self.bit(false)
93    }
94    #[doc = r"Writes raw bits to the field"]
95    #[inline(always)]
96    pub fn bit(self, value: bool) -> &'a mut W {
97        self.w.bits = (self.w.bits & !(1 << 9)) | ((value as u32 & 1) << 9);
98        self.w
99    }
100}
101#[doc = "Field `SLC_DSCR_BURST_EN` reader - "]
102pub struct SLC_DSCR_BURST_EN_R(crate::FieldReader<bool, bool>);
103impl SLC_DSCR_BURST_EN_R {
104    #[inline(always)]
105    pub(crate) fn new(bits: bool) -> Self {
106        SLC_DSCR_BURST_EN_R(crate::FieldReader::new(bits))
107    }
108}
109impl core::ops::Deref for SLC_DSCR_BURST_EN_R {
110    type Target = crate::FieldReader<bool, bool>;
111    #[inline(always)]
112    fn deref(&self) -> &Self::Target {
113        &self.0
114    }
115}
116#[doc = "Field `SLC_DSCR_BURST_EN` writer - "]
117pub struct SLC_DSCR_BURST_EN_W<'a> {
118    w: &'a mut W,
119}
120impl<'a> SLC_DSCR_BURST_EN_W<'a> {
121    #[doc = r"Sets the field bit"]
122    #[inline(always)]
123    pub fn set_bit(self) -> &'a mut W {
124        self.bit(true)
125    }
126    #[doc = r"Clears the field bit"]
127    #[inline(always)]
128    pub fn clear_bit(self) -> &'a mut W {
129        self.bit(false)
130    }
131    #[doc = r"Writes raw bits to the field"]
132    #[inline(always)]
133    pub fn bit(self, value: bool) -> &'a mut W {
134        self.w.bits = (self.w.bits & !(1 << 8)) | ((value as u32 & 1) << 8);
135        self.w
136    }
137}
138#[doc = "Field `SLC_RX_NO_RESTART_CLR` reader - "]
139pub struct SLC_RX_NO_RESTART_CLR_R(crate::FieldReader<bool, bool>);
140impl SLC_RX_NO_RESTART_CLR_R {
141    #[inline(always)]
142    pub(crate) fn new(bits: bool) -> Self {
143        SLC_RX_NO_RESTART_CLR_R(crate::FieldReader::new(bits))
144    }
145}
146impl core::ops::Deref for SLC_RX_NO_RESTART_CLR_R {
147    type Target = crate::FieldReader<bool, bool>;
148    #[inline(always)]
149    fn deref(&self) -> &Self::Target {
150        &self.0
151    }
152}
153#[doc = "Field `SLC_RX_NO_RESTART_CLR` writer - "]
154pub struct SLC_RX_NO_RESTART_CLR_W<'a> {
155    w: &'a mut W,
156}
157impl<'a> SLC_RX_NO_RESTART_CLR_W<'a> {
158    #[doc = r"Sets the field bit"]
159    #[inline(always)]
160    pub fn set_bit(self) -> &'a mut W {
161        self.bit(true)
162    }
163    #[doc = r"Clears the field bit"]
164    #[inline(always)]
165    pub fn clear_bit(self) -> &'a mut W {
166        self.bit(false)
167    }
168    #[doc = r"Writes raw bits to the field"]
169    #[inline(always)]
170    pub fn bit(self, value: bool) -> &'a mut W {
171        self.w.bits = (self.w.bits & !(1 << 7)) | ((value as u32 & 1) << 7);
172        self.w
173    }
174}
175#[doc = "Field `SLC_RX_AUTO_WRBACK` reader - "]
176pub struct SLC_RX_AUTO_WRBACK_R(crate::FieldReader<bool, bool>);
177impl SLC_RX_AUTO_WRBACK_R {
178    #[inline(always)]
179    pub(crate) fn new(bits: bool) -> Self {
180        SLC_RX_AUTO_WRBACK_R(crate::FieldReader::new(bits))
181    }
182}
183impl core::ops::Deref for SLC_RX_AUTO_WRBACK_R {
184    type Target = crate::FieldReader<bool, bool>;
185    #[inline(always)]
186    fn deref(&self) -> &Self::Target {
187        &self.0
188    }
189}
190#[doc = "Field `SLC_RX_AUTO_WRBACK` writer - "]
191pub struct SLC_RX_AUTO_WRBACK_W<'a> {
192    w: &'a mut W,
193}
194impl<'a> SLC_RX_AUTO_WRBACK_W<'a> {
195    #[doc = r"Sets the field bit"]
196    #[inline(always)]
197    pub fn set_bit(self) -> &'a mut W {
198        self.bit(true)
199    }
200    #[doc = r"Clears the field bit"]
201    #[inline(always)]
202    pub fn clear_bit(self) -> &'a mut W {
203        self.bit(false)
204    }
205    #[doc = r"Writes raw bits to the field"]
206    #[inline(always)]
207    pub fn bit(self, value: bool) -> &'a mut W {
208        self.w.bits = (self.w.bits & !(1 << 6)) | ((value as u32 & 1) << 6);
209        self.w
210    }
211}
212#[doc = "Field `SLC_RX_LOOP_TEST` reader - "]
213pub struct SLC_RX_LOOP_TEST_R(crate::FieldReader<bool, bool>);
214impl SLC_RX_LOOP_TEST_R {
215    #[inline(always)]
216    pub(crate) fn new(bits: bool) -> Self {
217        SLC_RX_LOOP_TEST_R(crate::FieldReader::new(bits))
218    }
219}
220impl core::ops::Deref for SLC_RX_LOOP_TEST_R {
221    type Target = crate::FieldReader<bool, bool>;
222    #[inline(always)]
223    fn deref(&self) -> &Self::Target {
224        &self.0
225    }
226}
227#[doc = "Field `SLC_RX_LOOP_TEST` writer - "]
228pub struct SLC_RX_LOOP_TEST_W<'a> {
229    w: &'a mut W,
230}
231impl<'a> SLC_RX_LOOP_TEST_W<'a> {
232    #[doc = r"Sets the field bit"]
233    #[inline(always)]
234    pub fn set_bit(self) -> &'a mut W {
235        self.bit(true)
236    }
237    #[doc = r"Clears the field bit"]
238    #[inline(always)]
239    pub fn clear_bit(self) -> &'a mut W {
240        self.bit(false)
241    }
242    #[doc = r"Writes raw bits to the field"]
243    #[inline(always)]
244    pub fn bit(self, value: bool) -> &'a mut W {
245        self.w.bits = (self.w.bits & !(1 << 5)) | ((value as u32 & 1) << 5);
246        self.w
247    }
248}
249#[doc = "Field `SLC_TX_LOOP_TEST` reader - "]
250pub struct SLC_TX_LOOP_TEST_R(crate::FieldReader<bool, bool>);
251impl SLC_TX_LOOP_TEST_R {
252    #[inline(always)]
253    pub(crate) fn new(bits: bool) -> Self {
254        SLC_TX_LOOP_TEST_R(crate::FieldReader::new(bits))
255    }
256}
257impl core::ops::Deref for SLC_TX_LOOP_TEST_R {
258    type Target = crate::FieldReader<bool, bool>;
259    #[inline(always)]
260    fn deref(&self) -> &Self::Target {
261        &self.0
262    }
263}
264#[doc = "Field `SLC_TX_LOOP_TEST` writer - "]
265pub struct SLC_TX_LOOP_TEST_W<'a> {
266    w: &'a mut W,
267}
268impl<'a> SLC_TX_LOOP_TEST_W<'a> {
269    #[doc = r"Sets the field bit"]
270    #[inline(always)]
271    pub fn set_bit(self) -> &'a mut W {
272        self.bit(true)
273    }
274    #[doc = r"Clears the field bit"]
275    #[inline(always)]
276    pub fn clear_bit(self) -> &'a mut W {
277        self.bit(false)
278    }
279    #[doc = r"Writes raw bits to the field"]
280    #[inline(always)]
281    pub fn bit(self, value: bool) -> &'a mut W {
282        self.w.bits = (self.w.bits & !(1 << 4)) | ((value as u32 & 1) << 4);
283        self.w
284    }
285}
286#[doc = "Field `SLC_AHBM_RST` reader - "]
287pub struct SLC_AHBM_RST_R(crate::FieldReader<bool, bool>);
288impl SLC_AHBM_RST_R {
289    #[inline(always)]
290    pub(crate) fn new(bits: bool) -> Self {
291        SLC_AHBM_RST_R(crate::FieldReader::new(bits))
292    }
293}
294impl core::ops::Deref for SLC_AHBM_RST_R {
295    type Target = crate::FieldReader<bool, bool>;
296    #[inline(always)]
297    fn deref(&self) -> &Self::Target {
298        &self.0
299    }
300}
301#[doc = "Field `SLC_AHBM_RST` writer - "]
302pub struct SLC_AHBM_RST_W<'a> {
303    w: &'a mut W,
304}
305impl<'a> SLC_AHBM_RST_W<'a> {
306    #[doc = r"Sets the field bit"]
307    #[inline(always)]
308    pub fn set_bit(self) -> &'a mut W {
309        self.bit(true)
310    }
311    #[doc = r"Clears the field bit"]
312    #[inline(always)]
313    pub fn clear_bit(self) -> &'a mut W {
314        self.bit(false)
315    }
316    #[doc = r"Writes raw bits to the field"]
317    #[inline(always)]
318    pub fn bit(self, value: bool) -> &'a mut W {
319        self.w.bits = (self.w.bits & !(1 << 3)) | ((value as u32 & 1) << 3);
320        self.w
321    }
322}
323#[doc = "Field `SLC_AHBM_FIFO_RST` reader - "]
324pub struct SLC_AHBM_FIFO_RST_R(crate::FieldReader<bool, bool>);
325impl SLC_AHBM_FIFO_RST_R {
326    #[inline(always)]
327    pub(crate) fn new(bits: bool) -> Self {
328        SLC_AHBM_FIFO_RST_R(crate::FieldReader::new(bits))
329    }
330}
331impl core::ops::Deref for SLC_AHBM_FIFO_RST_R {
332    type Target = crate::FieldReader<bool, bool>;
333    #[inline(always)]
334    fn deref(&self) -> &Self::Target {
335        &self.0
336    }
337}
338#[doc = "Field `SLC_AHBM_FIFO_RST` writer - "]
339pub struct SLC_AHBM_FIFO_RST_W<'a> {
340    w: &'a mut W,
341}
342impl<'a> SLC_AHBM_FIFO_RST_W<'a> {
343    #[doc = r"Sets the field bit"]
344    #[inline(always)]
345    pub fn set_bit(self) -> &'a mut W {
346        self.bit(true)
347    }
348    #[doc = r"Clears the field bit"]
349    #[inline(always)]
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(always)]
355    pub fn bit(self, value: bool) -> &'a mut W {
356        self.w.bits = (self.w.bits & !(1 << 2)) | ((value as u32 & 1) << 2);
357        self.w
358    }
359}
360#[doc = "Field `SLC_RXLINK_RST` reader - "]
361pub struct SLC_RXLINK_RST_R(crate::FieldReader<bool, bool>);
362impl SLC_RXLINK_RST_R {
363    #[inline(always)]
364    pub(crate) fn new(bits: bool) -> Self {
365        SLC_RXLINK_RST_R(crate::FieldReader::new(bits))
366    }
367}
368impl core::ops::Deref for SLC_RXLINK_RST_R {
369    type Target = crate::FieldReader<bool, bool>;
370    #[inline(always)]
371    fn deref(&self) -> &Self::Target {
372        &self.0
373    }
374}
375#[doc = "Field `SLC_RXLINK_RST` writer - "]
376pub struct SLC_RXLINK_RST_W<'a> {
377    w: &'a mut W,
378}
379impl<'a> SLC_RXLINK_RST_W<'a> {
380    #[doc = r"Sets the field bit"]
381    #[inline(always)]
382    pub fn set_bit(self) -> &'a mut W {
383        self.bit(true)
384    }
385    #[doc = r"Clears the field bit"]
386    #[inline(always)]
387    pub fn clear_bit(self) -> &'a mut W {
388        self.bit(false)
389    }
390    #[doc = r"Writes raw bits to the field"]
391    #[inline(always)]
392    pub fn bit(self, value: bool) -> &'a mut W {
393        self.w.bits = (self.w.bits & !(1 << 1)) | ((value as u32 & 1) << 1);
394        self.w
395    }
396}
397#[doc = "Field `SLC_TXLINK_RST` reader - "]
398pub struct SLC_TXLINK_RST_R(crate::FieldReader<bool, bool>);
399impl SLC_TXLINK_RST_R {
400    #[inline(always)]
401    pub(crate) fn new(bits: bool) -> Self {
402        SLC_TXLINK_RST_R(crate::FieldReader::new(bits))
403    }
404}
405impl core::ops::Deref for SLC_TXLINK_RST_R {
406    type Target = crate::FieldReader<bool, bool>;
407    #[inline(always)]
408    fn deref(&self) -> &Self::Target {
409        &self.0
410    }
411}
412#[doc = "Field `SLC_TXLINK_RST` writer - "]
413pub struct SLC_TXLINK_RST_W<'a> {
414    w: &'a mut W,
415}
416impl<'a> SLC_TXLINK_RST_W<'a> {
417    #[doc = r"Sets the field bit"]
418    #[inline(always)]
419    pub fn set_bit(self) -> &'a mut W {
420        self.bit(true)
421    }
422    #[doc = r"Clears the field bit"]
423    #[inline(always)]
424    pub fn clear_bit(self) -> &'a mut W {
425        self.bit(false)
426    }
427    #[doc = r"Writes raw bits to the field"]
428    #[inline(always)]
429    pub fn bit(self, value: bool) -> &'a mut W {
430        self.w.bits = (self.w.bits & !1) | (value as u32 & 1);
431        self.w
432    }
433}
434impl R {
435    #[doc = "Bits 12:13"]
436    #[inline(always)]
437    pub fn slc_mode(&self) -> SLC_MODE_R {
438        SLC_MODE_R::new(((self.bits >> 12) & 3) as u8)
439    }
440    #[doc = "Bit 9"]
441    #[inline(always)]
442    pub fn slc_data_burst_en(&self) -> SLC_DATA_BURST_EN_R {
443        SLC_DATA_BURST_EN_R::new(((self.bits >> 9) & 1) != 0)
444    }
445    #[doc = "Bit 8"]
446    #[inline(always)]
447    pub fn slc_dscr_burst_en(&self) -> SLC_DSCR_BURST_EN_R {
448        SLC_DSCR_BURST_EN_R::new(((self.bits >> 8) & 1) != 0)
449    }
450    #[doc = "Bit 7"]
451    #[inline(always)]
452    pub fn slc_rx_no_restart_clr(&self) -> SLC_RX_NO_RESTART_CLR_R {
453        SLC_RX_NO_RESTART_CLR_R::new(((self.bits >> 7) & 1) != 0)
454    }
455    #[doc = "Bit 6"]
456    #[inline(always)]
457    pub fn slc_rx_auto_wrback(&self) -> SLC_RX_AUTO_WRBACK_R {
458        SLC_RX_AUTO_WRBACK_R::new(((self.bits >> 6) & 1) != 0)
459    }
460    #[doc = "Bit 5"]
461    #[inline(always)]
462    pub fn slc_rx_loop_test(&self) -> SLC_RX_LOOP_TEST_R {
463        SLC_RX_LOOP_TEST_R::new(((self.bits >> 5) & 1) != 0)
464    }
465    #[doc = "Bit 4"]
466    #[inline(always)]
467    pub fn slc_tx_loop_test(&self) -> SLC_TX_LOOP_TEST_R {
468        SLC_TX_LOOP_TEST_R::new(((self.bits >> 4) & 1) != 0)
469    }
470    #[doc = "Bit 3"]
471    #[inline(always)]
472    pub fn slc_ahbm_rst(&self) -> SLC_AHBM_RST_R {
473        SLC_AHBM_RST_R::new(((self.bits >> 3) & 1) != 0)
474    }
475    #[doc = "Bit 2"]
476    #[inline(always)]
477    pub fn slc_ahbm_fifo_rst(&self) -> SLC_AHBM_FIFO_RST_R {
478        SLC_AHBM_FIFO_RST_R::new(((self.bits >> 2) & 1) != 0)
479    }
480    #[doc = "Bit 1"]
481    #[inline(always)]
482    pub fn slc_rxlink_rst(&self) -> SLC_RXLINK_RST_R {
483        SLC_RXLINK_RST_R::new(((self.bits >> 1) & 1) != 0)
484    }
485    #[doc = "Bit 0"]
486    #[inline(always)]
487    pub fn slc_txlink_rst(&self) -> SLC_TXLINK_RST_R {
488        SLC_TXLINK_RST_R::new((self.bits & 1) != 0)
489    }
490}
491impl W {
492    #[doc = "Bits 12:13"]
493    #[inline(always)]
494    pub fn slc_mode(&mut self) -> SLC_MODE_W {
495        SLC_MODE_W { w: self }
496    }
497    #[doc = "Bit 9"]
498    #[inline(always)]
499    pub fn slc_data_burst_en(&mut self) -> SLC_DATA_BURST_EN_W {
500        SLC_DATA_BURST_EN_W { w: self }
501    }
502    #[doc = "Bit 8"]
503    #[inline(always)]
504    pub fn slc_dscr_burst_en(&mut self) -> SLC_DSCR_BURST_EN_W {
505        SLC_DSCR_BURST_EN_W { w: self }
506    }
507    #[doc = "Bit 7"]
508    #[inline(always)]
509    pub fn slc_rx_no_restart_clr(&mut self) -> SLC_RX_NO_RESTART_CLR_W {
510        SLC_RX_NO_RESTART_CLR_W { w: self }
511    }
512    #[doc = "Bit 6"]
513    #[inline(always)]
514    pub fn slc_rx_auto_wrback(&mut self) -> SLC_RX_AUTO_WRBACK_W {
515        SLC_RX_AUTO_WRBACK_W { w: self }
516    }
517    #[doc = "Bit 5"]
518    #[inline(always)]
519    pub fn slc_rx_loop_test(&mut self) -> SLC_RX_LOOP_TEST_W {
520        SLC_RX_LOOP_TEST_W { w: self }
521    }
522    #[doc = "Bit 4"]
523    #[inline(always)]
524    pub fn slc_tx_loop_test(&mut self) -> SLC_TX_LOOP_TEST_W {
525        SLC_TX_LOOP_TEST_W { w: self }
526    }
527    #[doc = "Bit 3"]
528    #[inline(always)]
529    pub fn slc_ahbm_rst(&mut self) -> SLC_AHBM_RST_W {
530        SLC_AHBM_RST_W { w: self }
531    }
532    #[doc = "Bit 2"]
533    #[inline(always)]
534    pub fn slc_ahbm_fifo_rst(&mut self) -> SLC_AHBM_FIFO_RST_W {
535        SLC_AHBM_FIFO_RST_W { w: self }
536    }
537    #[doc = "Bit 1"]
538    #[inline(always)]
539    pub fn slc_rxlink_rst(&mut self) -> SLC_RXLINK_RST_W {
540        SLC_RXLINK_RST_W { w: self }
541    }
542    #[doc = "Bit 0"]
543    #[inline(always)]
544    pub fn slc_txlink_rst(&mut self) -> SLC_TXLINK_RST_W {
545        SLC_TXLINK_RST_W { w: self }
546    }
547    #[doc = "Writes raw bits to the register."]
548    #[inline(always)]
549    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
550        self.0.bits(bits);
551        self
552    }
553}
554#[doc = "SLC_CONF0\n\nThis register you can [`read`]
555(crate::generic::Reg::read), [`write_with_zero`]
556(crate::generic::Reg::write_with_zero), [`reset`]
557(crate::generic::Reg::reset), [`write`]
558(crate::generic::Reg::write), [`modify`]
559(crate::generic::Reg::modify). See [API]
560(https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [slc_conf0]
561(index.html) module"]
562pub struct SLC_CONF0_SPEC;
563impl crate::RegisterSpec for SLC_CONF0_SPEC {
564    type Ux = u32;
565}
566#[doc = "`read()` method returns [slc_conf0::R]
567(R) reader structure"]
568impl crate::Readable for SLC_CONF0_SPEC {
569    type Reader = R;
570}
571#[doc = "`write(|w| ..)` method takes [slc_conf0::W]
572(W) writer structure"]
573impl crate::Writable for SLC_CONF0_SPEC {
574    type Writer = W;
575}
576#[doc = "`reset()` method sets SLC_CONF0 to value 0"]
577impl crate::Resettable for SLC_CONF0_SPEC {
578    #[inline(always)]
579    fn reset_value() -> Self::Ux {
580        0
581    }
582}