bl61x_pac/aon/
gpadc_reg_cmd.rs

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