1#[doc = "Register `ADPGACR` reader"]
2pub struct R(crate::R<ADPGACR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ADPGACR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ADPGACR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ADPGACR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `ADPGACR` writer"]
17pub struct W(crate::W<ADPGACR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<ADPGACR_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<ADPGACR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<ADPGACR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `P000SEL0` reader - A through amplifier is enable for PGA P000"]
38pub type P000SEL0_R = crate::BitReader<P000SEL0_A>;
39#[doc = "A through amplifier is enable for PGA P000\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum P000SEL0_A {
42 #[doc = "0: Not through the PGA in amplifier"]
43 _0 = 0,
44 #[doc = "1: I will through in the PGA amplifier."]
45 _1 = 1,
46}
47impl From<P000SEL0_A> for bool {
48 #[inline(always)]
49 fn from(variant: P000SEL0_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl P000SEL0_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> P000SEL0_A {
57 match self.bits {
58 false => P000SEL0_A::_0,
59 true => P000SEL0_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == P000SEL0_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == P000SEL0_A::_1
71 }
72}
73#[doc = "Field `P000SEL0` writer - A through amplifier is enable for PGA P000"]
74pub type P000SEL0_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P000SEL0_A, O>;
75impl<'a, const O: u8> P000SEL0_W<'a, O> {
76 #[doc = "Not through the PGA in amplifier"]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(P000SEL0_A::_0)
80 }
81 #[doc = "I will through in the PGA amplifier."]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(P000SEL0_A::_1)
85 }
86}
87#[doc = "Field `P000SEL1` reader - The amplifier passing is enable for PGA P000"]
88pub type P000SEL1_R = crate::BitReader<P000SEL1_A>;
89#[doc = "The amplifier passing is enable for PGA P000\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum P000SEL1_A {
92 #[doc = "0: By way of the amplifier in PGA."]
93 _0 = 0,
94 #[doc = "1: Note 1 that by way of amplifier in PGA"]
95 _1 = 1,
96}
97impl From<P000SEL1_A> for bool {
98 #[inline(always)]
99 fn from(variant: P000SEL1_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl P000SEL1_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> P000SEL1_A {
107 match self.bits {
108 false => P000SEL1_A::_0,
109 true => P000SEL1_A::_1,
110 }
111 }
112 #[doc = "Checks if the value of the field is `_0`"]
113 #[inline(always)]
114 pub fn is_0(&self) -> bool {
115 *self == P000SEL1_A::_0
116 }
117 #[doc = "Checks if the value of the field is `_1`"]
118 #[inline(always)]
119 pub fn is_1(&self) -> bool {
120 *self == P000SEL1_A::_1
121 }
122}
123#[doc = "Field `P000SEL1` writer - The amplifier passing is enable for PGA P000"]
124pub type P000SEL1_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P000SEL1_A, O>;
125impl<'a, const O: u8> P000SEL1_W<'a, O> {
126 #[doc = "By way of the amplifier in PGA."]
127 #[inline(always)]
128 pub fn _0(self) -> &'a mut W {
129 self.variant(P000SEL1_A::_0)
130 }
131 #[doc = "Note 1 that by way of amplifier in PGA"]
132 #[inline(always)]
133 pub fn _1(self) -> &'a mut W {
134 self.variant(P000SEL1_A::_1)
135 }
136}
137#[doc = "Field `P000ENAMP` reader - Amplifier enable bit for PGA P000"]
138pub type P000ENAMP_R = crate::BitReader<P000ENAMP_A>;
139#[doc = "Amplifier enable bit for PGA P000\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum P000ENAMP_A {
142 #[doc = "0: The amplifier in PGA is not used."]
143 _0 = 0,
144 #[doc = "1: The amplifier in PGA is used."]
145 _1 = 1,
146}
147impl From<P000ENAMP_A> for bool {
148 #[inline(always)]
149 fn from(variant: P000ENAMP_A) -> Self {
150 variant as u8 != 0
151 }
152}
153impl P000ENAMP_R {
154 #[doc = "Get enumerated values variant"]
155 #[inline(always)]
156 pub fn variant(&self) -> P000ENAMP_A {
157 match self.bits {
158 false => P000ENAMP_A::_0,
159 true => P000ENAMP_A::_1,
160 }
161 }
162 #[doc = "Checks if the value of the field is `_0`"]
163 #[inline(always)]
164 pub fn is_0(&self) -> bool {
165 *self == P000ENAMP_A::_0
166 }
167 #[doc = "Checks if the value of the field is `_1`"]
168 #[inline(always)]
169 pub fn is_1(&self) -> bool {
170 *self == P000ENAMP_A::_1
171 }
172}
173#[doc = "Field `P000ENAMP` writer - Amplifier enable bit for PGA P000"]
174pub type P000ENAMP_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P000ENAMP_A, O>;
175impl<'a, const O: u8> P000ENAMP_W<'a, O> {
176 #[doc = "The amplifier in PGA is not used."]
177 #[inline(always)]
178 pub fn _0(self) -> &'a mut W {
179 self.variant(P000ENAMP_A::_0)
180 }
181 #[doc = "The amplifier in PGA is used."]
182 #[inline(always)]
183 pub fn _1(self) -> &'a mut W {
184 self.variant(P000ENAMP_A::_1)
185 }
186}
187#[doc = "Field `P000GEN` reader - PGA P000 gain setting and enable bit"]
188pub type P000GEN_R = crate::BitReader<P000GEN_A>;
189#[doc = "PGA P000 gain setting and enable bit\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum P000GEN_A {
192 #[doc = "0: The gain setting is invalidated (AIN is not input in PGA)."]
193 _0 = 0,
194 #[doc = "1: The gain setting is effectively done (AIN is input in PGA)."]
195 _1 = 1,
196}
197impl From<P000GEN_A> for bool {
198 #[inline(always)]
199 fn from(variant: P000GEN_A) -> Self {
200 variant as u8 != 0
201 }
202}
203impl P000GEN_R {
204 #[doc = "Get enumerated values variant"]
205 #[inline(always)]
206 pub fn variant(&self) -> P000GEN_A {
207 match self.bits {
208 false => P000GEN_A::_0,
209 true => P000GEN_A::_1,
210 }
211 }
212 #[doc = "Checks if the value of the field is `_0`"]
213 #[inline(always)]
214 pub fn is_0(&self) -> bool {
215 *self == P000GEN_A::_0
216 }
217 #[doc = "Checks if the value of the field is `_1`"]
218 #[inline(always)]
219 pub fn is_1(&self) -> bool {
220 *self == P000GEN_A::_1
221 }
222}
223#[doc = "Field `P000GEN` writer - PGA P000 gain setting and enable bit"]
224pub type P000GEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P000GEN_A, O>;
225impl<'a, const O: u8> P000GEN_W<'a, O> {
226 #[doc = "The gain setting is invalidated (AIN is not input in PGA)."]
227 #[inline(always)]
228 pub fn _0(self) -> &'a mut W {
229 self.variant(P000GEN_A::_0)
230 }
231 #[doc = "The gain setting is effectively done (AIN is input in PGA)."]
232 #[inline(always)]
233 pub fn _1(self) -> &'a mut W {
234 self.variant(P000GEN_A::_1)
235 }
236}
237#[doc = "Field `P001SEL0` reader - A through amplifier is enable for PGA P001"]
238pub type P001SEL0_R = crate::BitReader<P001SEL0_A>;
239#[doc = "A through amplifier is enable for PGA P001\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
241pub enum P001SEL0_A {
242 #[doc = "0: Not through the PGA in amplifier"]
243 _0 = 0,
244 #[doc = "1: I will through in the PGA amplifier."]
245 _1 = 1,
246}
247impl From<P001SEL0_A> for bool {
248 #[inline(always)]
249 fn from(variant: P001SEL0_A) -> Self {
250 variant as u8 != 0
251 }
252}
253impl P001SEL0_R {
254 #[doc = "Get enumerated values variant"]
255 #[inline(always)]
256 pub fn variant(&self) -> P001SEL0_A {
257 match self.bits {
258 false => P001SEL0_A::_0,
259 true => P001SEL0_A::_1,
260 }
261 }
262 #[doc = "Checks if the value of the field is `_0`"]
263 #[inline(always)]
264 pub fn is_0(&self) -> bool {
265 *self == P001SEL0_A::_0
266 }
267 #[doc = "Checks if the value of the field is `_1`"]
268 #[inline(always)]
269 pub fn is_1(&self) -> bool {
270 *self == P001SEL0_A::_1
271 }
272}
273#[doc = "Field `P001SEL0` writer - A through amplifier is enable for PGA P001"]
274pub type P001SEL0_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P001SEL0_A, O>;
275impl<'a, const O: u8> P001SEL0_W<'a, O> {
276 #[doc = "Not through the PGA in amplifier"]
277 #[inline(always)]
278 pub fn _0(self) -> &'a mut W {
279 self.variant(P001SEL0_A::_0)
280 }
281 #[doc = "I will through in the PGA amplifier."]
282 #[inline(always)]
283 pub fn _1(self) -> &'a mut W {
284 self.variant(P001SEL0_A::_1)
285 }
286}
287#[doc = "Field `P001SEL1` reader - The amplifier passing is enable for PGA P001"]
288pub type P001SEL1_R = crate::BitReader<P001SEL1_A>;
289#[doc = "The amplifier passing is enable for PGA P001\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq, Eq)]
291pub enum P001SEL1_A {
292 #[doc = "0: By way of the amplifier in PGA."]
293 _0 = 0,
294 #[doc = "1: Note 1 that by way of amplifier in PGA"]
295 _1 = 1,
296}
297impl From<P001SEL1_A> for bool {
298 #[inline(always)]
299 fn from(variant: P001SEL1_A) -> Self {
300 variant as u8 != 0
301 }
302}
303impl P001SEL1_R {
304 #[doc = "Get enumerated values variant"]
305 #[inline(always)]
306 pub fn variant(&self) -> P001SEL1_A {
307 match self.bits {
308 false => P001SEL1_A::_0,
309 true => P001SEL1_A::_1,
310 }
311 }
312 #[doc = "Checks if the value of the field is `_0`"]
313 #[inline(always)]
314 pub fn is_0(&self) -> bool {
315 *self == P001SEL1_A::_0
316 }
317 #[doc = "Checks if the value of the field is `_1`"]
318 #[inline(always)]
319 pub fn is_1(&self) -> bool {
320 *self == P001SEL1_A::_1
321 }
322}
323#[doc = "Field `P001SEL1` writer - The amplifier passing is enable for PGA P001"]
324pub type P001SEL1_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P001SEL1_A, O>;
325impl<'a, const O: u8> P001SEL1_W<'a, O> {
326 #[doc = "By way of the amplifier in PGA."]
327 #[inline(always)]
328 pub fn _0(self) -> &'a mut W {
329 self.variant(P001SEL1_A::_0)
330 }
331 #[doc = "Note 1 that by way of amplifier in PGA"]
332 #[inline(always)]
333 pub fn _1(self) -> &'a mut W {
334 self.variant(P001SEL1_A::_1)
335 }
336}
337#[doc = "Field `P001ENAMP` reader - Amplifier enable bit for PGA P001"]
338pub type P001ENAMP_R = crate::BitReader<P001ENAMP_A>;
339#[doc = "Amplifier enable bit for PGA P001\n\nValue on reset: 0"]
340#[derive(Clone, Copy, Debug, PartialEq, Eq)]
341pub enum P001ENAMP_A {
342 #[doc = "0: The amplifier in PGA is not used."]
343 _0 = 0,
344 #[doc = "1: The amplifier in PGA is used."]
345 _1 = 1,
346}
347impl From<P001ENAMP_A> for bool {
348 #[inline(always)]
349 fn from(variant: P001ENAMP_A) -> Self {
350 variant as u8 != 0
351 }
352}
353impl P001ENAMP_R {
354 #[doc = "Get enumerated values variant"]
355 #[inline(always)]
356 pub fn variant(&self) -> P001ENAMP_A {
357 match self.bits {
358 false => P001ENAMP_A::_0,
359 true => P001ENAMP_A::_1,
360 }
361 }
362 #[doc = "Checks if the value of the field is `_0`"]
363 #[inline(always)]
364 pub fn is_0(&self) -> bool {
365 *self == P001ENAMP_A::_0
366 }
367 #[doc = "Checks if the value of the field is `_1`"]
368 #[inline(always)]
369 pub fn is_1(&self) -> bool {
370 *self == P001ENAMP_A::_1
371 }
372}
373#[doc = "Field `P001ENAMP` writer - Amplifier enable bit for PGA P001"]
374pub type P001ENAMP_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P001ENAMP_A, O>;
375impl<'a, const O: u8> P001ENAMP_W<'a, O> {
376 #[doc = "The amplifier in PGA is not used."]
377 #[inline(always)]
378 pub fn _0(self) -> &'a mut W {
379 self.variant(P001ENAMP_A::_0)
380 }
381 #[doc = "The amplifier in PGA is used."]
382 #[inline(always)]
383 pub fn _1(self) -> &'a mut W {
384 self.variant(P001ENAMP_A::_1)
385 }
386}
387#[doc = "Field `P001GEN` reader - PGA P001 gain setting and enable bit"]
388pub type P001GEN_R = crate::BitReader<P001GEN_A>;
389#[doc = "PGA P001 gain setting and enable bit\n\nValue on reset: 0"]
390#[derive(Clone, Copy, Debug, PartialEq, Eq)]
391pub enum P001GEN_A {
392 #[doc = "0: The gain setting is invalidated (AIN is not input in PGA)."]
393 _0 = 0,
394 #[doc = "1: The gain setting is effectively done (AIN is input in PGA)."]
395 _1 = 1,
396}
397impl From<P001GEN_A> for bool {
398 #[inline(always)]
399 fn from(variant: P001GEN_A) -> Self {
400 variant as u8 != 0
401 }
402}
403impl P001GEN_R {
404 #[doc = "Get enumerated values variant"]
405 #[inline(always)]
406 pub fn variant(&self) -> P001GEN_A {
407 match self.bits {
408 false => P001GEN_A::_0,
409 true => P001GEN_A::_1,
410 }
411 }
412 #[doc = "Checks if the value of the field is `_0`"]
413 #[inline(always)]
414 pub fn is_0(&self) -> bool {
415 *self == P001GEN_A::_0
416 }
417 #[doc = "Checks if the value of the field is `_1`"]
418 #[inline(always)]
419 pub fn is_1(&self) -> bool {
420 *self == P001GEN_A::_1
421 }
422}
423#[doc = "Field `P001GEN` writer - PGA P001 gain setting and enable bit"]
424pub type P001GEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P001GEN_A, O>;
425impl<'a, const O: u8> P001GEN_W<'a, O> {
426 #[doc = "The gain setting is invalidated (AIN is not input in PGA)."]
427 #[inline(always)]
428 pub fn _0(self) -> &'a mut W {
429 self.variant(P001GEN_A::_0)
430 }
431 #[doc = "The gain setting is effectively done (AIN is input in PGA)."]
432 #[inline(always)]
433 pub fn _1(self) -> &'a mut W {
434 self.variant(P001GEN_A::_1)
435 }
436}
437#[doc = "Field `P002SEL0` reader - A through amplifier is enable for PGA P002"]
438pub type P002SEL0_R = crate::BitReader<P002SEL0_A>;
439#[doc = "A through amplifier is enable for PGA P002\n\nValue on reset: 0"]
440#[derive(Clone, Copy, Debug, PartialEq, Eq)]
441pub enum P002SEL0_A {
442 #[doc = "0: Not through the PGA in amplifier"]
443 _0 = 0,
444 #[doc = "1: I will through in the PGA amplifier."]
445 _1 = 1,
446}
447impl From<P002SEL0_A> for bool {
448 #[inline(always)]
449 fn from(variant: P002SEL0_A) -> Self {
450 variant as u8 != 0
451 }
452}
453impl P002SEL0_R {
454 #[doc = "Get enumerated values variant"]
455 #[inline(always)]
456 pub fn variant(&self) -> P002SEL0_A {
457 match self.bits {
458 false => P002SEL0_A::_0,
459 true => P002SEL0_A::_1,
460 }
461 }
462 #[doc = "Checks if the value of the field is `_0`"]
463 #[inline(always)]
464 pub fn is_0(&self) -> bool {
465 *self == P002SEL0_A::_0
466 }
467 #[doc = "Checks if the value of the field is `_1`"]
468 #[inline(always)]
469 pub fn is_1(&self) -> bool {
470 *self == P002SEL0_A::_1
471 }
472}
473#[doc = "Field `P002SEL0` writer - A through amplifier is enable for PGA P002"]
474pub type P002SEL0_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P002SEL0_A, O>;
475impl<'a, const O: u8> P002SEL0_W<'a, O> {
476 #[doc = "Not through the PGA in amplifier"]
477 #[inline(always)]
478 pub fn _0(self) -> &'a mut W {
479 self.variant(P002SEL0_A::_0)
480 }
481 #[doc = "I will through in the PGA amplifier."]
482 #[inline(always)]
483 pub fn _1(self) -> &'a mut W {
484 self.variant(P002SEL0_A::_1)
485 }
486}
487#[doc = "Field `P002SEL1` reader - The amplifier passing is enable for PGA P002"]
488pub type P002SEL1_R = crate::BitReader<P002SEL1_A>;
489#[doc = "The amplifier passing is enable for PGA P002\n\nValue on reset: 0"]
490#[derive(Clone, Copy, Debug, PartialEq, Eq)]
491pub enum P002SEL1_A {
492 #[doc = "0: By way of the amplifier in PGA."]
493 _0 = 0,
494 #[doc = "1: Note 1 that by way of amplifier in PGA"]
495 _1 = 1,
496}
497impl From<P002SEL1_A> for bool {
498 #[inline(always)]
499 fn from(variant: P002SEL1_A) -> Self {
500 variant as u8 != 0
501 }
502}
503impl P002SEL1_R {
504 #[doc = "Get enumerated values variant"]
505 #[inline(always)]
506 pub fn variant(&self) -> P002SEL1_A {
507 match self.bits {
508 false => P002SEL1_A::_0,
509 true => P002SEL1_A::_1,
510 }
511 }
512 #[doc = "Checks if the value of the field is `_0`"]
513 #[inline(always)]
514 pub fn is_0(&self) -> bool {
515 *self == P002SEL1_A::_0
516 }
517 #[doc = "Checks if the value of the field is `_1`"]
518 #[inline(always)]
519 pub fn is_1(&self) -> bool {
520 *self == P002SEL1_A::_1
521 }
522}
523#[doc = "Field `P002SEL1` writer - The amplifier passing is enable for PGA P002"]
524pub type P002SEL1_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P002SEL1_A, O>;
525impl<'a, const O: u8> P002SEL1_W<'a, O> {
526 #[doc = "By way of the amplifier in PGA."]
527 #[inline(always)]
528 pub fn _0(self) -> &'a mut W {
529 self.variant(P002SEL1_A::_0)
530 }
531 #[doc = "Note 1 that by way of amplifier in PGA"]
532 #[inline(always)]
533 pub fn _1(self) -> &'a mut W {
534 self.variant(P002SEL1_A::_1)
535 }
536}
537#[doc = "Field `P002ENAMP` reader - Amplifier enable bit for PGA P002"]
538pub type P002ENAMP_R = crate::BitReader<P002ENAMP_A>;
539#[doc = "Amplifier enable bit for PGA P002\n\nValue on reset: 0"]
540#[derive(Clone, Copy, Debug, PartialEq, Eq)]
541pub enum P002ENAMP_A {
542 #[doc = "0: The amplifier in PGA is not used."]
543 _0 = 0,
544 #[doc = "1: The amplifier in PGA is used."]
545 _1 = 1,
546}
547impl From<P002ENAMP_A> for bool {
548 #[inline(always)]
549 fn from(variant: P002ENAMP_A) -> Self {
550 variant as u8 != 0
551 }
552}
553impl P002ENAMP_R {
554 #[doc = "Get enumerated values variant"]
555 #[inline(always)]
556 pub fn variant(&self) -> P002ENAMP_A {
557 match self.bits {
558 false => P002ENAMP_A::_0,
559 true => P002ENAMP_A::_1,
560 }
561 }
562 #[doc = "Checks if the value of the field is `_0`"]
563 #[inline(always)]
564 pub fn is_0(&self) -> bool {
565 *self == P002ENAMP_A::_0
566 }
567 #[doc = "Checks if the value of the field is `_1`"]
568 #[inline(always)]
569 pub fn is_1(&self) -> bool {
570 *self == P002ENAMP_A::_1
571 }
572}
573#[doc = "Field `P002ENAMP` writer - Amplifier enable bit for PGA P002"]
574pub type P002ENAMP_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P002ENAMP_A, O>;
575impl<'a, const O: u8> P002ENAMP_W<'a, O> {
576 #[doc = "The amplifier in PGA is not used."]
577 #[inline(always)]
578 pub fn _0(self) -> &'a mut W {
579 self.variant(P002ENAMP_A::_0)
580 }
581 #[doc = "The amplifier in PGA is used."]
582 #[inline(always)]
583 pub fn _1(self) -> &'a mut W {
584 self.variant(P002ENAMP_A::_1)
585 }
586}
587#[doc = "Field `P002GEN` reader - PGA P002 gain setting and enable bit"]
588pub type P002GEN_R = crate::BitReader<P002GEN_A>;
589#[doc = "PGA P002 gain setting and enable bit\n\nValue on reset: 0"]
590#[derive(Clone, Copy, Debug, PartialEq, Eq)]
591pub enum P002GEN_A {
592 #[doc = "0: The gain setting is invalidated (AIN is not input in PGA)."]
593 _0 = 0,
594 #[doc = "1: The gain setting is effectively done (AIN is input in PGA)."]
595 _1 = 1,
596}
597impl From<P002GEN_A> for bool {
598 #[inline(always)]
599 fn from(variant: P002GEN_A) -> Self {
600 variant as u8 != 0
601 }
602}
603impl P002GEN_R {
604 #[doc = "Get enumerated values variant"]
605 #[inline(always)]
606 pub fn variant(&self) -> P002GEN_A {
607 match self.bits {
608 false => P002GEN_A::_0,
609 true => P002GEN_A::_1,
610 }
611 }
612 #[doc = "Checks if the value of the field is `_0`"]
613 #[inline(always)]
614 pub fn is_0(&self) -> bool {
615 *self == P002GEN_A::_0
616 }
617 #[doc = "Checks if the value of the field is `_1`"]
618 #[inline(always)]
619 pub fn is_1(&self) -> bool {
620 *self == P002GEN_A::_1
621 }
622}
623#[doc = "Field `P002GEN` writer - PGA P002 gain setting and enable bit"]
624pub type P002GEN_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADPGACR_SPEC, P002GEN_A, O>;
625impl<'a, const O: u8> P002GEN_W<'a, O> {
626 #[doc = "The gain setting is invalidated (AIN is not input in PGA)."]
627 #[inline(always)]
628 pub fn _0(self) -> &'a mut W {
629 self.variant(P002GEN_A::_0)
630 }
631 #[doc = "The gain setting is effectively done (AIN is input in PGA)."]
632 #[inline(always)]
633 pub fn _1(self) -> &'a mut W {
634 self.variant(P002GEN_A::_1)
635 }
636}
637impl R {
638 #[doc = "Bit 0 - A through amplifier is enable for PGA P000"]
639 #[inline(always)]
640 pub fn p000sel0(&self) -> P000SEL0_R {
641 P000SEL0_R::new((self.bits & 1) != 0)
642 }
643 #[doc = "Bit 1 - The amplifier passing is enable for PGA P000"]
644 #[inline(always)]
645 pub fn p000sel1(&self) -> P000SEL1_R {
646 P000SEL1_R::new(((self.bits >> 1) & 1) != 0)
647 }
648 #[doc = "Bit 2 - Amplifier enable bit for PGA P000"]
649 #[inline(always)]
650 pub fn p000enamp(&self) -> P000ENAMP_R {
651 P000ENAMP_R::new(((self.bits >> 2) & 1) != 0)
652 }
653 #[doc = "Bit 3 - PGA P000 gain setting and enable bit"]
654 #[inline(always)]
655 pub fn p000gen(&self) -> P000GEN_R {
656 P000GEN_R::new(((self.bits >> 3) & 1) != 0)
657 }
658 #[doc = "Bit 4 - A through amplifier is enable for PGA P001"]
659 #[inline(always)]
660 pub fn p001sel0(&self) -> P001SEL0_R {
661 P001SEL0_R::new(((self.bits >> 4) & 1) != 0)
662 }
663 #[doc = "Bit 5 - The amplifier passing is enable for PGA P001"]
664 #[inline(always)]
665 pub fn p001sel1(&self) -> P001SEL1_R {
666 P001SEL1_R::new(((self.bits >> 5) & 1) != 0)
667 }
668 #[doc = "Bit 6 - Amplifier enable bit for PGA P001"]
669 #[inline(always)]
670 pub fn p001enamp(&self) -> P001ENAMP_R {
671 P001ENAMP_R::new(((self.bits >> 6) & 1) != 0)
672 }
673 #[doc = "Bit 7 - PGA P001 gain setting and enable bit"]
674 #[inline(always)]
675 pub fn p001gen(&self) -> P001GEN_R {
676 P001GEN_R::new(((self.bits >> 7) & 1) != 0)
677 }
678 #[doc = "Bit 8 - A through amplifier is enable for PGA P002"]
679 #[inline(always)]
680 pub fn p002sel0(&self) -> P002SEL0_R {
681 P002SEL0_R::new(((self.bits >> 8) & 1) != 0)
682 }
683 #[doc = "Bit 9 - The amplifier passing is enable for PGA P002"]
684 #[inline(always)]
685 pub fn p002sel1(&self) -> P002SEL1_R {
686 P002SEL1_R::new(((self.bits >> 9) & 1) != 0)
687 }
688 #[doc = "Bit 10 - Amplifier enable bit for PGA P002"]
689 #[inline(always)]
690 pub fn p002enamp(&self) -> P002ENAMP_R {
691 P002ENAMP_R::new(((self.bits >> 10) & 1) != 0)
692 }
693 #[doc = "Bit 11 - PGA P002 gain setting and enable bit"]
694 #[inline(always)]
695 pub fn p002gen(&self) -> P002GEN_R {
696 P002GEN_R::new(((self.bits >> 11) & 1) != 0)
697 }
698}
699impl W {
700 #[doc = "Bit 0 - A through amplifier is enable for PGA P000"]
701 #[inline(always)]
702 #[must_use]
703 pub fn p000sel0(&mut self) -> P000SEL0_W<0> {
704 P000SEL0_W::new(self)
705 }
706 #[doc = "Bit 1 - The amplifier passing is enable for PGA P000"]
707 #[inline(always)]
708 #[must_use]
709 pub fn p000sel1(&mut self) -> P000SEL1_W<1> {
710 P000SEL1_W::new(self)
711 }
712 #[doc = "Bit 2 - Amplifier enable bit for PGA P000"]
713 #[inline(always)]
714 #[must_use]
715 pub fn p000enamp(&mut self) -> P000ENAMP_W<2> {
716 P000ENAMP_W::new(self)
717 }
718 #[doc = "Bit 3 - PGA P000 gain setting and enable bit"]
719 #[inline(always)]
720 #[must_use]
721 pub fn p000gen(&mut self) -> P000GEN_W<3> {
722 P000GEN_W::new(self)
723 }
724 #[doc = "Bit 4 - A through amplifier is enable for PGA P001"]
725 #[inline(always)]
726 #[must_use]
727 pub fn p001sel0(&mut self) -> P001SEL0_W<4> {
728 P001SEL0_W::new(self)
729 }
730 #[doc = "Bit 5 - The amplifier passing is enable for PGA P001"]
731 #[inline(always)]
732 #[must_use]
733 pub fn p001sel1(&mut self) -> P001SEL1_W<5> {
734 P001SEL1_W::new(self)
735 }
736 #[doc = "Bit 6 - Amplifier enable bit for PGA P001"]
737 #[inline(always)]
738 #[must_use]
739 pub fn p001enamp(&mut self) -> P001ENAMP_W<6> {
740 P001ENAMP_W::new(self)
741 }
742 #[doc = "Bit 7 - PGA P001 gain setting and enable bit"]
743 #[inline(always)]
744 #[must_use]
745 pub fn p001gen(&mut self) -> P001GEN_W<7> {
746 P001GEN_W::new(self)
747 }
748 #[doc = "Bit 8 - A through amplifier is enable for PGA P002"]
749 #[inline(always)]
750 #[must_use]
751 pub fn p002sel0(&mut self) -> P002SEL0_W<8> {
752 P002SEL0_W::new(self)
753 }
754 #[doc = "Bit 9 - The amplifier passing is enable for PGA P002"]
755 #[inline(always)]
756 #[must_use]
757 pub fn p002sel1(&mut self) -> P002SEL1_W<9> {
758 P002SEL1_W::new(self)
759 }
760 #[doc = "Bit 10 - Amplifier enable bit for PGA P002"]
761 #[inline(always)]
762 #[must_use]
763 pub fn p002enamp(&mut self) -> P002ENAMP_W<10> {
764 P002ENAMP_W::new(self)
765 }
766 #[doc = "Bit 11 - PGA P002 gain setting and enable bit"]
767 #[inline(always)]
768 #[must_use]
769 pub fn p002gen(&mut self) -> P002GEN_W<11> {
770 P002GEN_W::new(self)
771 }
772 #[doc = "Writes raw bits to the register."]
773 #[inline(always)]
774 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
775 self.0.bits(bits);
776 self
777 }
778}
779#[doc = "A/D Programmable Gain Amplifier Control Register\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 [adpgacr](index.html) module"]
780pub struct ADPGACR_SPEC;
781impl crate::RegisterSpec for ADPGACR_SPEC {
782 type Ux = u16;
783}
784#[doc = "`read()` method returns [adpgacr::R](R) reader structure"]
785impl crate::Readable for ADPGACR_SPEC {
786 type Reader = R;
787}
788#[doc = "`write(|w| ..)` method takes [adpgacr::W](W) writer structure"]
789impl crate::Writable for ADPGACR_SPEC {
790 type Writer = W;
791 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
792 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
793}
794#[doc = "`reset()` method sets ADPGACR to value 0"]
795impl crate::Resettable for ADPGACR_SPEC {
796 const RESET_VALUE: Self::Ux = 0;
797}