1#[doc = "Register `CONF1` reader"]
2pub type R = crate::R<CONF1_SPEC>;
3#[doc = "Register `CONF1` writer"]
4pub type W = crate::W<CONF1_SPEC>;
5#[doc = "Field `TX_PCM_CONF` reader - Compress/Decompress module configuration bits. 0: decompress transmitted data 1:compress transmitted data"]
6pub type TX_PCM_CONF_R = crate::FieldReader;
7#[doc = "Field `TX_PCM_CONF` writer - Compress/Decompress module configuration bits. 0: decompress transmitted data 1:compress transmitted data"]
8pub type TX_PCM_CONF_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `TX_PCM_BYPASS` reader - Set this bit to bypass Compress/Decompress module for transmitted data."]
10pub type TX_PCM_BYPASS_R = crate::BitReader;
11#[doc = "Field `TX_PCM_BYPASS` writer - Set this bit to bypass Compress/Decompress module for transmitted data."]
12pub type TX_PCM_BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RX_PCM_CONF` reader - Compress/Decompress module configuration bits. 0: decompress received data 1:compress received data"]
14pub type RX_PCM_CONF_R = crate::FieldReader;
15#[doc = "Field `RX_PCM_CONF` writer - Compress/Decompress module configuration bits. 0: decompress received data 1:compress received data"]
16pub type RX_PCM_CONF_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
17#[doc = "Field `RX_PCM_BYPASS` reader - Set this bit to bypass Compress/Decompress module for received data."]
18pub type RX_PCM_BYPASS_R = crate::BitReader;
19#[doc = "Field `RX_PCM_BYPASS` writer - Set this bit to bypass Compress/Decompress module for received data."]
20pub type RX_PCM_BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TX_STOP_EN` reader - Set this bit to stop the output of BCK signal and WS signal when TX FIFO is empty."]
22pub type TX_STOP_EN_R = crate::BitReader;
23#[doc = "Field `TX_STOP_EN` writer - Set this bit to stop the output of BCK signal and WS signal when TX FIFO is empty."]
24pub type TX_STOP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `TX_ZEROS_RM_EN` reader - Reserved."]
26pub type TX_ZEROS_RM_EN_R = crate::BitReader;
27#[doc = "Field `TX_ZEROS_RM_EN` writer - Reserved."]
28pub type TX_ZEROS_RM_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bits 0:2 - Compress/Decompress module configuration bits. 0: decompress transmitted data 1:compress transmitted data"]
31 #[inline(always)]
32 pub fn tx_pcm_conf(&self) -> TX_PCM_CONF_R {
33 TX_PCM_CONF_R::new((self.bits & 7) as u8)
34 }
35 #[doc = "Bit 3 - Set this bit to bypass Compress/Decompress module for transmitted data."]
36 #[inline(always)]
37 pub fn tx_pcm_bypass(&self) -> TX_PCM_BYPASS_R {
38 TX_PCM_BYPASS_R::new(((self.bits >> 3) & 1) != 0)
39 }
40 #[doc = "Bits 4:6 - Compress/Decompress module configuration bits. 0: decompress received data 1:compress received data"]
41 #[inline(always)]
42 pub fn rx_pcm_conf(&self) -> RX_PCM_CONF_R {
43 RX_PCM_CONF_R::new(((self.bits >> 4) & 7) as u8)
44 }
45 #[doc = "Bit 7 - Set this bit to bypass Compress/Decompress module for received data."]
46 #[inline(always)]
47 pub fn rx_pcm_bypass(&self) -> RX_PCM_BYPASS_R {
48 RX_PCM_BYPASS_R::new(((self.bits >> 7) & 1) != 0)
49 }
50 #[doc = "Bit 8 - Set this bit to stop the output of BCK signal and WS signal when TX FIFO is empty."]
51 #[inline(always)]
52 pub fn tx_stop_en(&self) -> TX_STOP_EN_R {
53 TX_STOP_EN_R::new(((self.bits >> 8) & 1) != 0)
54 }
55 #[doc = "Bit 9 - Reserved."]
56 #[inline(always)]
57 pub fn tx_zeros_rm_en(&self) -> TX_ZEROS_RM_EN_R {
58 TX_ZEROS_RM_EN_R::new(((self.bits >> 9) & 1) != 0)
59 }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64 f.debug_struct("CONF1")
65 .field("tx_pcm_conf", &self.tx_pcm_conf())
66 .field("tx_pcm_bypass", &self.tx_pcm_bypass())
67 .field("rx_pcm_conf", &self.rx_pcm_conf())
68 .field("rx_pcm_bypass", &self.rx_pcm_bypass())
69 .field("tx_stop_en", &self.tx_stop_en())
70 .field("tx_zeros_rm_en", &self.tx_zeros_rm_en())
71 .finish()
72 }
73}
74impl W {
75 #[doc = "Bits 0:2 - Compress/Decompress module configuration bits. 0: decompress transmitted data 1:compress transmitted data"]
76 #[inline(always)]
77 pub fn tx_pcm_conf(&mut self) -> TX_PCM_CONF_W<CONF1_SPEC> {
78 TX_PCM_CONF_W::new(self, 0)
79 }
80 #[doc = "Bit 3 - Set this bit to bypass Compress/Decompress module for transmitted data."]
81 #[inline(always)]
82 pub fn tx_pcm_bypass(&mut self) -> TX_PCM_BYPASS_W<CONF1_SPEC> {
83 TX_PCM_BYPASS_W::new(self, 3)
84 }
85 #[doc = "Bits 4:6 - Compress/Decompress module configuration bits. 0: decompress received data 1:compress received data"]
86 #[inline(always)]
87 pub fn rx_pcm_conf(&mut self) -> RX_PCM_CONF_W<CONF1_SPEC> {
88 RX_PCM_CONF_W::new(self, 4)
89 }
90 #[doc = "Bit 7 - Set this bit to bypass Compress/Decompress module for received data."]
91 #[inline(always)]
92 pub fn rx_pcm_bypass(&mut self) -> RX_PCM_BYPASS_W<CONF1_SPEC> {
93 RX_PCM_BYPASS_W::new(self, 7)
94 }
95 #[doc = "Bit 8 - Set this bit to stop the output of BCK signal and WS signal when TX FIFO is empty."]
96 #[inline(always)]
97 pub fn tx_stop_en(&mut self) -> TX_STOP_EN_W<CONF1_SPEC> {
98 TX_STOP_EN_W::new(self, 8)
99 }
100 #[doc = "Bit 9 - Reserved."]
101 #[inline(always)]
102 pub fn tx_zeros_rm_en(&mut self) -> TX_ZEROS_RM_EN_W<CONF1_SPEC> {
103 TX_ZEROS_RM_EN_W::new(self, 9)
104 }
105}
106#[doc = "I2S configuration register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`conf1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`conf1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
107pub struct CONF1_SPEC;
108impl crate::RegisterSpec for CONF1_SPEC {
109 type Ux = u32;
110}
111#[doc = "`read()` method returns [`conf1::R`](R) reader structure"]
112impl crate::Readable for CONF1_SPEC {}
113#[doc = "`write(|w| ..)` method takes [`conf1::W`](W) writer structure"]
114impl crate::Writable for CONF1_SPEC {
115 type Safety = crate::Unsafe;
116 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
117 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
118}
119#[doc = "`reset()` method sets CONF1 to value 0x89"]
120impl crate::Resettable for CONF1_SPEC {
121 const RESET_VALUE: u32 = 0x89;
122}