esp32p4/lp_i2s0/
rx_pdm_conf.rs

1#[doc = "Register `RX_PDM_CONF` reader"]
2pub type R = crate::R<RX_PDM_CONF_SPEC>;
3#[doc = "Register `RX_PDM_CONF` writer"]
4pub type W = crate::W<RX_PDM_CONF_SPEC>;
5#[doc = "Field `RX_PDM2PCM_EN` reader - 1: Enable PDM2PCM RX mode. 0: DIsable."]
6pub type RX_PDM2PCM_EN_R = crate::BitReader;
7#[doc = "Field `RX_PDM2PCM_EN` writer - 1: Enable PDM2PCM RX mode. 0: DIsable."]
8pub type RX_PDM2PCM_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `RX_PDM_SINC_DSR_16_EN` reader - Configure the down sampling rate of PDM RX filter group1 module. 1: The down sampling rate is 128. 0: down sampling rate is 64."]
10pub type RX_PDM_SINC_DSR_16_EN_R = crate::BitReader;
11#[doc = "Field `RX_PDM_SINC_DSR_16_EN` writer - Configure the down sampling rate of PDM RX filter group1 module. 1: The down sampling rate is 128. 0: down sampling rate is 64."]
12pub type RX_PDM_SINC_DSR_16_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RX_PDM2PCM_AMPLIFY_NUM` reader - Configure PDM RX amplify number."]
14pub type RX_PDM2PCM_AMPLIFY_NUM_R = crate::FieldReader;
15#[doc = "Field `RX_PDM2PCM_AMPLIFY_NUM` writer - Configure PDM RX amplify number."]
16pub type RX_PDM2PCM_AMPLIFY_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17#[doc = "Field `RX_PDM_HP_BYPASS` reader - I2S PDM RX bypass hp filter or not."]
18pub type RX_PDM_HP_BYPASS_R = crate::BitReader;
19#[doc = "Field `RX_PDM_HP_BYPASS` writer - I2S PDM RX bypass hp filter or not."]
20pub type RX_PDM_HP_BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `RX_IIR_HP_MULT12_5` reader - The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + LP_I2S_RX_IIR_HP_MULT12_5\\[2:0\\])"]
22pub type RX_IIR_HP_MULT12_5_R = crate::FieldReader;
23#[doc = "Field `RX_IIR_HP_MULT12_5` writer - The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + LP_I2S_RX_IIR_HP_MULT12_5\\[2:0\\])"]
24pub type RX_IIR_HP_MULT12_5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
25#[doc = "Field `RX_IIR_HP_MULT12_0` reader - The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + LP_I2S_RX_IIR_HP_MULT12_0\\[2:0\\])"]
26pub type RX_IIR_HP_MULT12_0_R = crate::FieldReader;
27#[doc = "Field `RX_IIR_HP_MULT12_0` writer - The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + LP_I2S_RX_IIR_HP_MULT12_0\\[2:0\\])"]
28pub type RX_IIR_HP_MULT12_0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
29impl R {
30    #[doc = "Bit 19 - 1: Enable PDM2PCM RX mode. 0: DIsable."]
31    #[inline(always)]
32    pub fn rx_pdm2pcm_en(&self) -> RX_PDM2PCM_EN_R {
33        RX_PDM2PCM_EN_R::new(((self.bits >> 19) & 1) != 0)
34    }
35    #[doc = "Bit 20 - Configure the down sampling rate of PDM RX filter group1 module. 1: The down sampling rate is 128. 0: down sampling rate is 64."]
36    #[inline(always)]
37    pub fn rx_pdm_sinc_dsr_16_en(&self) -> RX_PDM_SINC_DSR_16_EN_R {
38        RX_PDM_SINC_DSR_16_EN_R::new(((self.bits >> 20) & 1) != 0)
39    }
40    #[doc = "Bits 21:24 - Configure PDM RX amplify number."]
41    #[inline(always)]
42    pub fn rx_pdm2pcm_amplify_num(&self) -> RX_PDM2PCM_AMPLIFY_NUM_R {
43        RX_PDM2PCM_AMPLIFY_NUM_R::new(((self.bits >> 21) & 0x0f) as u8)
44    }
45    #[doc = "Bit 25 - I2S PDM RX bypass hp filter or not."]
46    #[inline(always)]
47    pub fn rx_pdm_hp_bypass(&self) -> RX_PDM_HP_BYPASS_R {
48        RX_PDM_HP_BYPASS_R::new(((self.bits >> 25) & 1) != 0)
49    }
50    #[doc = "Bits 26:28 - The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + LP_I2S_RX_IIR_HP_MULT12_5\\[2:0\\])"]
51    #[inline(always)]
52    pub fn rx_iir_hp_mult12_5(&self) -> RX_IIR_HP_MULT12_5_R {
53        RX_IIR_HP_MULT12_5_R::new(((self.bits >> 26) & 7) as u8)
54    }
55    #[doc = "Bits 29:31 - The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + LP_I2S_RX_IIR_HP_MULT12_0\\[2:0\\])"]
56    #[inline(always)]
57    pub fn rx_iir_hp_mult12_0(&self) -> RX_IIR_HP_MULT12_0_R {
58        RX_IIR_HP_MULT12_0_R::new(((self.bits >> 29) & 7) as u8)
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("RX_PDM_CONF")
65            .field(
66                "rx_pdm2pcm_en",
67                &format_args!("{}", self.rx_pdm2pcm_en().bit()),
68            )
69            .field(
70                "rx_pdm_sinc_dsr_16_en",
71                &format_args!("{}", self.rx_pdm_sinc_dsr_16_en().bit()),
72            )
73            .field(
74                "rx_pdm2pcm_amplify_num",
75                &format_args!("{}", self.rx_pdm2pcm_amplify_num().bits()),
76            )
77            .field(
78                "rx_pdm_hp_bypass",
79                &format_args!("{}", self.rx_pdm_hp_bypass().bit()),
80            )
81            .field(
82                "rx_iir_hp_mult12_5",
83                &format_args!("{}", self.rx_iir_hp_mult12_5().bits()),
84            )
85            .field(
86                "rx_iir_hp_mult12_0",
87                &format_args!("{}", self.rx_iir_hp_mult12_0().bits()),
88            )
89            .finish()
90    }
91}
92#[cfg(feature = "impl-register-debug")]
93impl core::fmt::Debug for crate::generic::Reg<RX_PDM_CONF_SPEC> {
94    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
95        core::fmt::Debug::fmt(&self.read(), f)
96    }
97}
98impl W {
99    #[doc = "Bit 19 - 1: Enable PDM2PCM RX mode. 0: DIsable."]
100    #[inline(always)]
101    #[must_use]
102    pub fn rx_pdm2pcm_en(&mut self) -> RX_PDM2PCM_EN_W<RX_PDM_CONF_SPEC> {
103        RX_PDM2PCM_EN_W::new(self, 19)
104    }
105    #[doc = "Bit 20 - Configure the down sampling rate of PDM RX filter group1 module. 1: The down sampling rate is 128. 0: down sampling rate is 64."]
106    #[inline(always)]
107    #[must_use]
108    pub fn rx_pdm_sinc_dsr_16_en(&mut self) -> RX_PDM_SINC_DSR_16_EN_W<RX_PDM_CONF_SPEC> {
109        RX_PDM_SINC_DSR_16_EN_W::new(self, 20)
110    }
111    #[doc = "Bits 21:24 - Configure PDM RX amplify number."]
112    #[inline(always)]
113    #[must_use]
114    pub fn rx_pdm2pcm_amplify_num(&mut self) -> RX_PDM2PCM_AMPLIFY_NUM_W<RX_PDM_CONF_SPEC> {
115        RX_PDM2PCM_AMPLIFY_NUM_W::new(self, 21)
116    }
117    #[doc = "Bit 25 - I2S PDM RX bypass hp filter or not."]
118    #[inline(always)]
119    #[must_use]
120    pub fn rx_pdm_hp_bypass(&mut self) -> RX_PDM_HP_BYPASS_W<RX_PDM_CONF_SPEC> {
121        RX_PDM_HP_BYPASS_W::new(self, 25)
122    }
123    #[doc = "Bits 26:28 - The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + LP_I2S_RX_IIR_HP_MULT12_5\\[2:0\\])"]
124    #[inline(always)]
125    #[must_use]
126    pub fn rx_iir_hp_mult12_5(&mut self) -> RX_IIR_HP_MULT12_5_W<RX_PDM_CONF_SPEC> {
127        RX_IIR_HP_MULT12_5_W::new(self, 26)
128    }
129    #[doc = "Bits 29:31 - The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + LP_I2S_RX_IIR_HP_MULT12_0\\[2:0\\])"]
130    #[inline(always)]
131    #[must_use]
132    pub fn rx_iir_hp_mult12_0(&mut self) -> RX_IIR_HP_MULT12_0_W<RX_PDM_CONF_SPEC> {
133        RX_IIR_HP_MULT12_0_W::new(self, 29)
134    }
135}
136#[doc = "I2S RX configure register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_pdm_conf::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rx_pdm_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
137pub struct RX_PDM_CONF_SPEC;
138impl crate::RegisterSpec for RX_PDM_CONF_SPEC {
139    type Ux = u32;
140}
141#[doc = "`read()` method returns [`rx_pdm_conf::R`](R) reader structure"]
142impl crate::Readable for RX_PDM_CONF_SPEC {}
143#[doc = "`write(|w| ..)` method takes [`rx_pdm_conf::W`](W) writer structure"]
144impl crate::Writable for RX_PDM_CONF_SPEC {
145    type Safety = crate::Unsafe;
146    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
147    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
148}
149#[doc = "`reset()` method sets RX_PDM_CONF to value 0xf820_0000"]
150impl crate::Resettable for RX_PDM_CONF_SPEC {
151    const RESET_VALUE: u32 = 0xf820_0000;
152}