d1_pac/audio_codec/
ac_dac_dap_ctr.rs

1#[doc = "Register `ac_dac_dap_ctr` reader"]
2pub type R = crate::R<AC_DAC_DAP_CTR_SPEC>;
3#[doc = "Register `ac_dac_dap_ctr` writer"]
4pub type W = crate::W<AC_DAC_DAP_CTR_SPEC>;
5#[doc = "Field `ddap_hpf_en` reader - HPF enable control"]
6pub type DDAP_HPF_EN_R = crate::BitReader<DDAP_HPF_EN_A>;
7#[doc = "HPF enable control\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum DDAP_HPF_EN_A {
10    #[doc = "0: Disabled"]
11    DISABLED = 0,
12    #[doc = "1: Enabled"]
13    ENABLED = 1,
14}
15impl From<DDAP_HPF_EN_A> for bool {
16    #[inline(always)]
17    fn from(variant: DDAP_HPF_EN_A) -> Self {
18        variant as u8 != 0
19    }
20}
21impl DDAP_HPF_EN_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> DDAP_HPF_EN_A {
25        match self.bits {
26            false => DDAP_HPF_EN_A::DISABLED,
27            true => DDAP_HPF_EN_A::ENABLED,
28        }
29    }
30    #[doc = "Disabled"]
31    #[inline(always)]
32    pub fn is_disabled(&self) -> bool {
33        *self == DDAP_HPF_EN_A::DISABLED
34    }
35    #[doc = "Enabled"]
36    #[inline(always)]
37    pub fn is_enabled(&self) -> bool {
38        *self == DDAP_HPF_EN_A::ENABLED
39    }
40}
41#[doc = "Field `ddap_hpf_en` writer - HPF enable control"]
42pub type DDAP_HPF_EN_W<'a, REG> = crate::BitWriter<'a, REG, DDAP_HPF_EN_A>;
43impl<'a, REG> DDAP_HPF_EN_W<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "Disabled"]
48    #[inline(always)]
49    pub fn disabled(self) -> &'a mut crate::W<REG> {
50        self.variant(DDAP_HPF_EN_A::DISABLED)
51    }
52    #[doc = "Enabled"]
53    #[inline(always)]
54    pub fn enabled(self) -> &'a mut crate::W<REG> {
55        self.variant(DDAP_HPF_EN_A::ENABLED)
56    }
57}
58#[doc = "Field `ddap_drc_en` reader - DRC enable control"]
59pub type DDAP_DRC_EN_R = crate::BitReader<DDAP_DRC_EN_A>;
60#[doc = "DRC enable control\n\nValue on reset: 0"]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum DDAP_DRC_EN_A {
63    #[doc = "0: Disabled"]
64    DISABLED = 0,
65    #[doc = "1: Enabled"]
66    ENABLED = 1,
67}
68impl From<DDAP_DRC_EN_A> for bool {
69    #[inline(always)]
70    fn from(variant: DDAP_DRC_EN_A) -> Self {
71        variant as u8 != 0
72    }
73}
74impl DDAP_DRC_EN_R {
75    #[doc = "Get enumerated values variant"]
76    #[inline(always)]
77    pub const fn variant(&self) -> DDAP_DRC_EN_A {
78        match self.bits {
79            false => DDAP_DRC_EN_A::DISABLED,
80            true => DDAP_DRC_EN_A::ENABLED,
81        }
82    }
83    #[doc = "Disabled"]
84    #[inline(always)]
85    pub fn is_disabled(&self) -> bool {
86        *self == DDAP_DRC_EN_A::DISABLED
87    }
88    #[doc = "Enabled"]
89    #[inline(always)]
90    pub fn is_enabled(&self) -> bool {
91        *self == DDAP_DRC_EN_A::ENABLED
92    }
93}
94#[doc = "Field `ddap_drc_en` writer - DRC enable control"]
95pub type DDAP_DRC_EN_W<'a, REG> = crate::BitWriter<'a, REG, DDAP_DRC_EN_A>;
96impl<'a, REG> DDAP_DRC_EN_W<'a, REG>
97where
98    REG: crate::Writable + crate::RegisterSpec,
99{
100    #[doc = "Disabled"]
101    #[inline(always)]
102    pub fn disabled(self) -> &'a mut crate::W<REG> {
103        self.variant(DDAP_DRC_EN_A::DISABLED)
104    }
105    #[doc = "Enabled"]
106    #[inline(always)]
107    pub fn enabled(self) -> &'a mut crate::W<REG> {
108        self.variant(DDAP_DRC_EN_A::ENABLED)
109    }
110}
111#[doc = "Field `ddap_en` reader - DAP for DRC enable"]
112pub type DDAP_EN_R = crate::BitReader<DDAP_EN_A>;
113#[doc = "DAP for DRC enable\n\nValue on reset: 0"]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum DDAP_EN_A {
116    #[doc = "0: Bypassed"]
117    BYPASSED = 0,
118    #[doc = "1: Enabled"]
119    ENABLED = 1,
120}
121impl From<DDAP_EN_A> for bool {
122    #[inline(always)]
123    fn from(variant: DDAP_EN_A) -> Self {
124        variant as u8 != 0
125    }
126}
127impl DDAP_EN_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> DDAP_EN_A {
131        match self.bits {
132            false => DDAP_EN_A::BYPASSED,
133            true => DDAP_EN_A::ENABLED,
134        }
135    }
136    #[doc = "Bypassed"]
137    #[inline(always)]
138    pub fn is_bypassed(&self) -> bool {
139        *self == DDAP_EN_A::BYPASSED
140    }
141    #[doc = "Enabled"]
142    #[inline(always)]
143    pub fn is_enabled(&self) -> bool {
144        *self == DDAP_EN_A::ENABLED
145    }
146}
147#[doc = "Field `ddap_en` writer - DAP for DRC enable"]
148pub type DDAP_EN_W<'a, REG> = crate::BitWriter<'a, REG, DDAP_EN_A>;
149impl<'a, REG> DDAP_EN_W<'a, REG>
150where
151    REG: crate::Writable + crate::RegisterSpec,
152{
153    #[doc = "Bypassed"]
154    #[inline(always)]
155    pub fn bypassed(self) -> &'a mut crate::W<REG> {
156        self.variant(DDAP_EN_A::BYPASSED)
157    }
158    #[doc = "Enabled"]
159    #[inline(always)]
160    pub fn enabled(self) -> &'a mut crate::W<REG> {
161        self.variant(DDAP_EN_A::ENABLED)
162    }
163}
164impl R {
165    #[doc = "Bit 28 - HPF enable control"]
166    #[inline(always)]
167    pub fn ddap_hpf_en(&self) -> DDAP_HPF_EN_R {
168        DDAP_HPF_EN_R::new(((self.bits >> 28) & 1) != 0)
169    }
170    #[doc = "Bit 29 - DRC enable control"]
171    #[inline(always)]
172    pub fn ddap_drc_en(&self) -> DDAP_DRC_EN_R {
173        DDAP_DRC_EN_R::new(((self.bits >> 29) & 1) != 0)
174    }
175    #[doc = "Bit 31 - DAP for DRC enable"]
176    #[inline(always)]
177    pub fn ddap_en(&self) -> DDAP_EN_R {
178        DDAP_EN_R::new(((self.bits >> 31) & 1) != 0)
179    }
180}
181impl W {
182    #[doc = "Bit 28 - HPF enable control"]
183    #[inline(always)]
184    #[must_use]
185    pub fn ddap_hpf_en(&mut self) -> DDAP_HPF_EN_W<AC_DAC_DAP_CTR_SPEC> {
186        DDAP_HPF_EN_W::new(self, 28)
187    }
188    #[doc = "Bit 29 - DRC enable control"]
189    #[inline(always)]
190    #[must_use]
191    pub fn ddap_drc_en(&mut self) -> DDAP_DRC_EN_W<AC_DAC_DAP_CTR_SPEC> {
192        DDAP_DRC_EN_W::new(self, 29)
193    }
194    #[doc = "Bit 31 - DAP for DRC enable"]
195    #[inline(always)]
196    #[must_use]
197    pub fn ddap_en(&mut self) -> DDAP_EN_W<AC_DAC_DAP_CTR_SPEC> {
198        DDAP_EN_W::new(self, 31)
199    }
200    #[doc = r" Writes raw bits to the register."]
201    #[doc = r""]
202    #[doc = r" # Safety"]
203    #[doc = r""]
204    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
205    #[inline(always)]
206    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
207        self.bits = bits;
208        self
209    }
210}
211#[doc = "DAC DAP Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ac_dac_dap_ctr::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 [`ac_dac_dap_ctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
212pub struct AC_DAC_DAP_CTR_SPEC;
213impl crate::RegisterSpec for AC_DAC_DAP_CTR_SPEC {
214    type Ux = u32;
215}
216#[doc = "`read()` method returns [`ac_dac_dap_ctr::R`](R) reader structure"]
217impl crate::Readable for AC_DAC_DAP_CTR_SPEC {}
218#[doc = "`write(|w| ..)` method takes [`ac_dac_dap_ctr::W`](W) writer structure"]
219impl crate::Writable for AC_DAC_DAP_CTR_SPEC {
220    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
221    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
222}
223#[doc = "`reset()` method sets ac_dac_dap_ctr to value 0"]
224impl crate::Resettable for AC_DAC_DAP_CTR_SPEC {
225    const RESET_VALUE: Self::Ux = 0;
226}