bl702_pac/aon/
gpadc_reg_cmd.rs

1#[doc = "Register `gpadc_reg_cmd` reader"]
2pub struct R(crate::R<GPADC_REG_CMD_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<GPADC_REG_CMD_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<GPADC_REG_CMD_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<GPADC_REG_CMD_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `gpadc_reg_cmd` writer"]
17pub struct W(crate::W<GPADC_REG_CMD_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<GPADC_REG_CMD_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<GPADC_REG_CMD_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<GPADC_REG_CMD_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `gpadc_global_en` reader - "]
38pub type GPADC_GLOBAL_EN_R = crate::BitReader<bool>;
39#[doc = "Field `gpadc_global_en` writer - "]
40pub type GPADC_GLOBAL_EN_W<'a, const O: u8> =
41    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
42#[doc = "Field `gpadc_conv_start` reader - "]
43pub type GPADC_CONV_START_R = crate::BitReader<bool>;
44#[doc = "Field `gpadc_conv_start` writer - "]
45pub type GPADC_CONV_START_W<'a, const O: u8> =
46    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
47#[doc = "Field `gpadc_soft_rst` reader - "]
48pub type GPADC_SOFT_RST_R = crate::BitReader<bool>;
49#[doc = "Field `gpadc_soft_rst` writer - "]
50pub type GPADC_SOFT_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
51#[doc = "Field `gpadc_neg_sel` reader - "]
52pub type GPADC_NEG_SEL_R = crate::FieldReader<u8, u8>;
53#[doc = "Field `gpadc_neg_sel` writer - "]
54pub type GPADC_NEG_SEL_W<'a, const O: u8> =
55    crate::FieldWriter<'a, u32, GPADC_REG_CMD_SPEC, u8, u8, 5, O>;
56#[doc = "Field `gpadc_pos_sel` reader - "]
57pub type GPADC_POS_SEL_R = crate::FieldReader<u8, u8>;
58#[doc = "Field `gpadc_pos_sel` writer - "]
59pub type GPADC_POS_SEL_W<'a, const O: u8> =
60    crate::FieldWriter<'a, u32, GPADC_REG_CMD_SPEC, u8, u8, 5, O>;
61#[doc = "Field `gpadc_neg_gnd` reader - "]
62pub type GPADC_NEG_GND_R = crate::BitReader<bool>;
63#[doc = "Field `gpadc_neg_gnd` writer - "]
64pub type GPADC_NEG_GND_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
65#[doc = "Field `gpadc_micbias_en` reader - "]
66pub type GPADC_MICBIAS_EN_R = crate::BitReader<bool>;
67#[doc = "Field `gpadc_micbias_en` writer - "]
68pub type GPADC_MICBIAS_EN_W<'a, const O: u8> =
69    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
70#[doc = "Field `gpadc_micpga_en` reader - "]
71pub type GPADC_MICPGA_EN_R = crate::BitReader<bool>;
72#[doc = "Field `gpadc_micpga_en` writer - "]
73pub type GPADC_MICPGA_EN_W<'a, const O: u8> =
74    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
75#[doc = "Field `gpadc_byp_micboost` reader - "]
76pub type GPADC_BYP_MICBOOST_R = crate::BitReader<bool>;
77#[doc = "Field `gpadc_byp_micboost` writer - "]
78pub type GPADC_BYP_MICBOOST_W<'a, const O: u8> =
79    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
80#[doc = "Field `gpadc_dwa_en` reader - "]
81pub type GPADC_DWA_EN_R = crate::BitReader<bool>;
82#[doc = "Field `gpadc_dwa_en` writer - "]
83pub type GPADC_DWA_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
84#[doc = "Field `gpadc_mic2_diff` reader - "]
85pub type GPADC_MIC2_DIFF_R = crate::BitReader<bool>;
86#[doc = "Field `gpadc_mic2_diff` writer - "]
87pub type GPADC_MIC2_DIFF_W<'a, const O: u8> =
88    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
89#[doc = "Field `gpadc_mic1_diff` reader - "]
90pub type GPADC_MIC1_DIFF_R = crate::BitReader<bool>;
91#[doc = "Field `gpadc_mic1_diff` writer - "]
92pub type GPADC_MIC1_DIFF_W<'a, const O: u8> =
93    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
94#[doc = "Field `gpadc_mic_pga2_gain` reader - "]
95pub type GPADC_MIC_PGA2_GAIN_R = crate::FieldReader<u8, u8>;
96#[doc = "Field `gpadc_mic_pga2_gain` writer - "]
97pub type GPADC_MIC_PGA2_GAIN_W<'a, const O: u8> =
98    crate::FieldWriter<'a, u32, GPADC_REG_CMD_SPEC, u8, u8, 2, O>;
99#[doc = "Field `gpadc_micboost_32db_en` reader - "]
100pub type GPADC_MICBOOST_32DB_EN_R = crate::BitReader<bool>;
101#[doc = "Field `gpadc_micboost_32db_en` writer - "]
102pub type GPADC_MICBOOST_32DB_EN_W<'a, const O: u8> =
103    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
104#[doc = "Field `gpadc_chip_sen_pu` reader - "]
105pub type GPADC_CHIP_SEN_PU_R = crate::BitReader<bool>;
106#[doc = "Field `gpadc_chip_sen_pu` writer - "]
107pub type GPADC_CHIP_SEN_PU_W<'a, const O: u8> =
108    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
109#[doc = "Field `gpadc_sen_sel` reader - "]
110pub type GPADC_SEN_SEL_R = crate::FieldReader<u8, u8>;
111#[doc = "Field `gpadc_sen_sel` writer - "]
112pub type GPADC_SEN_SEL_W<'a, const O: u8> =
113    crate::FieldWriter<'a, u32, GPADC_REG_CMD_SPEC, u8, u8, 2, O>;
114#[doc = "Field `gpadc_sen_test_en` reader - "]
115pub type GPADC_SEN_TEST_EN_R = crate::BitReader<bool>;
116#[doc = "Field `gpadc_sen_test_en` writer - "]
117pub type GPADC_SEN_TEST_EN_W<'a, const O: u8> =
118    crate::BitWriter<'a, u32, GPADC_REG_CMD_SPEC, bool, O>;
119impl R {
120    #[doc = "Bit 0"]
121    #[inline(always)]
122    pub fn gpadc_global_en(&self) -> GPADC_GLOBAL_EN_R {
123        GPADC_GLOBAL_EN_R::new((self.bits & 1) != 0)
124    }
125    #[doc = "Bit 1"]
126    #[inline(always)]
127    pub fn gpadc_conv_start(&self) -> GPADC_CONV_START_R {
128        GPADC_CONV_START_R::new(((self.bits >> 1) & 1) != 0)
129    }
130    #[doc = "Bit 2"]
131    #[inline(always)]
132    pub fn gpadc_soft_rst(&self) -> GPADC_SOFT_RST_R {
133        GPADC_SOFT_RST_R::new(((self.bits >> 2) & 1) != 0)
134    }
135    #[doc = "Bits 3:7"]
136    #[inline(always)]
137    pub fn gpadc_neg_sel(&self) -> GPADC_NEG_SEL_R {
138        GPADC_NEG_SEL_R::new(((self.bits >> 3) & 0x1f) as u8)
139    }
140    #[doc = "Bits 8:12"]
141    #[inline(always)]
142    pub fn gpadc_pos_sel(&self) -> GPADC_POS_SEL_R {
143        GPADC_POS_SEL_R::new(((self.bits >> 8) & 0x1f) as u8)
144    }
145    #[doc = "Bit 13"]
146    #[inline(always)]
147    pub fn gpadc_neg_gnd(&self) -> GPADC_NEG_GND_R {
148        GPADC_NEG_GND_R::new(((self.bits >> 13) & 1) != 0)
149    }
150    #[doc = "Bit 14"]
151    #[inline(always)]
152    pub fn gpadc_micbias_en(&self) -> GPADC_MICBIAS_EN_R {
153        GPADC_MICBIAS_EN_R::new(((self.bits >> 14) & 1) != 0)
154    }
155    #[doc = "Bit 15"]
156    #[inline(always)]
157    pub fn gpadc_micpga_en(&self) -> GPADC_MICPGA_EN_R {
158        GPADC_MICPGA_EN_R::new(((self.bits >> 15) & 1) != 0)
159    }
160    #[doc = "Bit 16"]
161    #[inline(always)]
162    pub fn gpadc_byp_micboost(&self) -> GPADC_BYP_MICBOOST_R {
163        GPADC_BYP_MICBOOST_R::new(((self.bits >> 16) & 1) != 0)
164    }
165    #[doc = "Bit 18"]
166    #[inline(always)]
167    pub fn gpadc_dwa_en(&self) -> GPADC_DWA_EN_R {
168        GPADC_DWA_EN_R::new(((self.bits >> 18) & 1) != 0)
169    }
170    #[doc = "Bit 19"]
171    #[inline(always)]
172    pub fn gpadc_mic2_diff(&self) -> GPADC_MIC2_DIFF_R {
173        GPADC_MIC2_DIFF_R::new(((self.bits >> 19) & 1) != 0)
174    }
175    #[doc = "Bit 20"]
176    #[inline(always)]
177    pub fn gpadc_mic1_diff(&self) -> GPADC_MIC1_DIFF_R {
178        GPADC_MIC1_DIFF_R::new(((self.bits >> 20) & 1) != 0)
179    }
180    #[doc = "Bits 21:22"]
181    #[inline(always)]
182    pub fn gpadc_mic_pga2_gain(&self) -> GPADC_MIC_PGA2_GAIN_R {
183        GPADC_MIC_PGA2_GAIN_R::new(((self.bits >> 21) & 3) as u8)
184    }
185    #[doc = "Bit 23"]
186    #[inline(always)]
187    pub fn gpadc_micboost_32db_en(&self) -> GPADC_MICBOOST_32DB_EN_R {
188        GPADC_MICBOOST_32DB_EN_R::new(((self.bits >> 23) & 1) != 0)
189    }
190    #[doc = "Bit 27"]
191    #[inline(always)]
192    pub fn gpadc_chip_sen_pu(&self) -> GPADC_CHIP_SEN_PU_R {
193        GPADC_CHIP_SEN_PU_R::new(((self.bits >> 27) & 1) != 0)
194    }
195    #[doc = "Bits 28:29"]
196    #[inline(always)]
197    pub fn gpadc_sen_sel(&self) -> GPADC_SEN_SEL_R {
198        GPADC_SEN_SEL_R::new(((self.bits >> 28) & 3) as u8)
199    }
200    #[doc = "Bit 30"]
201    #[inline(always)]
202    pub fn gpadc_sen_test_en(&self) -> GPADC_SEN_TEST_EN_R {
203        GPADC_SEN_TEST_EN_R::new(((self.bits >> 30) & 1) != 0)
204    }
205}
206impl W {
207    #[doc = "Bit 0"]
208    #[inline(always)]
209    #[must_use]
210    pub fn gpadc_global_en(&mut self) -> GPADC_GLOBAL_EN_W<0> {
211        GPADC_GLOBAL_EN_W::new(self)
212    }
213    #[doc = "Bit 1"]
214    #[inline(always)]
215    #[must_use]
216    pub fn gpadc_conv_start(&mut self) -> GPADC_CONV_START_W<1> {
217        GPADC_CONV_START_W::new(self)
218    }
219    #[doc = "Bit 2"]
220    #[inline(always)]
221    #[must_use]
222    pub fn gpadc_soft_rst(&mut self) -> GPADC_SOFT_RST_W<2> {
223        GPADC_SOFT_RST_W::new(self)
224    }
225    #[doc = "Bits 3:7"]
226    #[inline(always)]
227    #[must_use]
228    pub fn gpadc_neg_sel(&mut self) -> GPADC_NEG_SEL_W<3> {
229        GPADC_NEG_SEL_W::new(self)
230    }
231    #[doc = "Bits 8:12"]
232    #[inline(always)]
233    #[must_use]
234    pub fn gpadc_pos_sel(&mut self) -> GPADC_POS_SEL_W<8> {
235        GPADC_POS_SEL_W::new(self)
236    }
237    #[doc = "Bit 13"]
238    #[inline(always)]
239    #[must_use]
240    pub fn gpadc_neg_gnd(&mut self) -> GPADC_NEG_GND_W<13> {
241        GPADC_NEG_GND_W::new(self)
242    }
243    #[doc = "Bit 14"]
244    #[inline(always)]
245    #[must_use]
246    pub fn gpadc_micbias_en(&mut self) -> GPADC_MICBIAS_EN_W<14> {
247        GPADC_MICBIAS_EN_W::new(self)
248    }
249    #[doc = "Bit 15"]
250    #[inline(always)]
251    #[must_use]
252    pub fn gpadc_micpga_en(&mut self) -> GPADC_MICPGA_EN_W<15> {
253        GPADC_MICPGA_EN_W::new(self)
254    }
255    #[doc = "Bit 16"]
256    #[inline(always)]
257    #[must_use]
258    pub fn gpadc_byp_micboost(&mut self) -> GPADC_BYP_MICBOOST_W<16> {
259        GPADC_BYP_MICBOOST_W::new(self)
260    }
261    #[doc = "Bit 18"]
262    #[inline(always)]
263    #[must_use]
264    pub fn gpadc_dwa_en(&mut self) -> GPADC_DWA_EN_W<18> {
265        GPADC_DWA_EN_W::new(self)
266    }
267    #[doc = "Bit 19"]
268    #[inline(always)]
269    #[must_use]
270    pub fn gpadc_mic2_diff(&mut self) -> GPADC_MIC2_DIFF_W<19> {
271        GPADC_MIC2_DIFF_W::new(self)
272    }
273    #[doc = "Bit 20"]
274    #[inline(always)]
275    #[must_use]
276    pub fn gpadc_mic1_diff(&mut self) -> GPADC_MIC1_DIFF_W<20> {
277        GPADC_MIC1_DIFF_W::new(self)
278    }
279    #[doc = "Bits 21:22"]
280    #[inline(always)]
281    #[must_use]
282    pub fn gpadc_mic_pga2_gain(&mut self) -> GPADC_MIC_PGA2_GAIN_W<21> {
283        GPADC_MIC_PGA2_GAIN_W::new(self)
284    }
285    #[doc = "Bit 23"]
286    #[inline(always)]
287    #[must_use]
288    pub fn gpadc_micboost_32db_en(&mut self) -> GPADC_MICBOOST_32DB_EN_W<23> {
289        GPADC_MICBOOST_32DB_EN_W::new(self)
290    }
291    #[doc = "Bit 27"]
292    #[inline(always)]
293    #[must_use]
294    pub fn gpadc_chip_sen_pu(&mut self) -> GPADC_CHIP_SEN_PU_W<27> {
295        GPADC_CHIP_SEN_PU_W::new(self)
296    }
297    #[doc = "Bits 28:29"]
298    #[inline(always)]
299    #[must_use]
300    pub fn gpadc_sen_sel(&mut self) -> GPADC_SEN_SEL_W<28> {
301        GPADC_SEN_SEL_W::new(self)
302    }
303    #[doc = "Bit 30"]
304    #[inline(always)]
305    #[must_use]
306    pub fn gpadc_sen_test_en(&mut self) -> GPADC_SEN_TEST_EN_W<30> {
307        GPADC_SEN_TEST_EN_W::new(self)
308    }
309    #[doc = "Writes raw bits to the register."]
310    #[inline(always)]
311    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
312        self.0.bits(bits);
313        self
314    }
315}
316#[doc = "gpadc_reg_cmd.\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 [gpadc_reg_cmd](index.html) module"]
317pub struct GPADC_REG_CMD_SPEC;
318impl crate::RegisterSpec for GPADC_REG_CMD_SPEC {
319    type Ux = u32;
320}
321#[doc = "`read()` method returns [gpadc_reg_cmd::R](R) reader structure"]
322impl crate::Readable for GPADC_REG_CMD_SPEC {
323    type Reader = R;
324}
325#[doc = "`write(|w| ..)` method takes [gpadc_reg_cmd::W](W) writer structure"]
326impl crate::Writable for GPADC_REG_CMD_SPEC {
327    type Writer = W;
328    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
329    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
330}
331#[doc = "`reset()` method sets gpadc_reg_cmd to value 0"]
332impl crate::Resettable for GPADC_REG_CMD_SPEC {
333    const RESET_VALUE: Self::Ux = 0;
334}