efm32tg_pac/efm32tg842/adc0/
singlectrl.rs1#[doc = "Register `SINGLECTRL` reader"]
2pub struct R(crate::R<SINGLECTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SINGLECTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SINGLECTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SINGLECTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SINGLECTRL` writer"]
17pub struct W(crate::W<SINGLECTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SINGLECTRL_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<SINGLECTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SINGLECTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `REP` reader - Single Sample Repetitive Mode"]
38pub type REP_R = crate::BitReader<bool>;
39#[doc = "Field `REP` writer - Single Sample Repetitive Mode"]
40pub type REP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
41#[doc = "Field `DIFF` reader - Single Sample Differential Mode"]
42pub type DIFF_R = crate::BitReader<bool>;
43#[doc = "Field `DIFF` writer - Single Sample Differential Mode"]
44pub type DIFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
45#[doc = "Field `ADJ` reader - Single Sample Result Adjustment"]
46pub type ADJ_R = crate::BitReader<bool>;
47#[doc = "Field `ADJ` writer - Single Sample Result Adjustment"]
48pub type ADJ_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
49#[doc = "Field `RES` reader - Single Sample Resolution Select"]
50pub type RES_R = crate::FieldReader<u8, RES_A>;
51#[doc = "Single Sample Resolution Select\n\nValue on reset: 0"]
52#[derive(Clone, Copy, Debug, PartialEq, Eq)]
53#[repr(u8)]
54pub enum RES_A {
55 #[doc = "0: 12-bit resolution"]
56 _12BIT = 0,
57 #[doc = "1: 8-bit resolution"]
58 _8BIT = 1,
59 #[doc = "2: 6-bit resolution"]
60 _6BIT = 2,
61 #[doc = "3: Oversampling enabled. Oversampling rate is set in OVSRSEL"]
62 OVS = 3,
63}
64impl From<RES_A> for u8 {
65 #[inline(always)]
66 fn from(variant: RES_A) -> Self {
67 variant as _
68 }
69}
70impl RES_R {
71 #[doc = "Get enumerated values variant"]
72 #[inline(always)]
73 pub fn variant(&self) -> RES_A {
74 match self.bits {
75 0 => RES_A::_12BIT,
76 1 => RES_A::_8BIT,
77 2 => RES_A::_6BIT,
78 3 => RES_A::OVS,
79 _ => unreachable!(),
80 }
81 }
82 #[doc = "Checks if the value of the field is `_12BIT`"]
83 #[inline(always)]
84 pub fn is_12bit(&self) -> bool {
85 *self == RES_A::_12BIT
86 }
87 #[doc = "Checks if the value of the field is `_8BIT`"]
88 #[inline(always)]
89 pub fn is_8bit(&self) -> bool {
90 *self == RES_A::_8BIT
91 }
92 #[doc = "Checks if the value of the field is `_6BIT`"]
93 #[inline(always)]
94 pub fn is_6bit(&self) -> bool {
95 *self == RES_A::_6BIT
96 }
97 #[doc = "Checks if the value of the field is `OVS`"]
98 #[inline(always)]
99 pub fn is_ovs(&self) -> bool {
100 *self == RES_A::OVS
101 }
102}
103#[doc = "Field `RES` writer - Single Sample Resolution Select"]
104pub type RES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SINGLECTRL_SPEC, u8, RES_A, 2, O>;
105impl<'a, const O: u8> RES_W<'a, O> {
106 #[doc = "12-bit resolution"]
107 #[inline(always)]
108 pub fn _12bit(self) -> &'a mut W {
109 self.variant(RES_A::_12BIT)
110 }
111 #[doc = "8-bit resolution"]
112 #[inline(always)]
113 pub fn _8bit(self) -> &'a mut W {
114 self.variant(RES_A::_8BIT)
115 }
116 #[doc = "6-bit resolution"]
117 #[inline(always)]
118 pub fn _6bit(self) -> &'a mut W {
119 self.variant(RES_A::_6BIT)
120 }
121 #[doc = "Oversampling enabled. Oversampling rate is set in OVSRSEL"]
122 #[inline(always)]
123 pub fn ovs(self) -> &'a mut W {
124 self.variant(RES_A::OVS)
125 }
126}
127#[doc = "Field `INPUTSEL` reader - Single Sample Input Selection"]
128pub type INPUTSEL_R = crate::FieldReader<u8, u8>;
129#[doc = "Field `INPUTSEL` writer - Single Sample Input Selection"]
130pub type INPUTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, u8, 4, O>;
131#[doc = "Field `REF` reader - Single Sample Reference Selection"]
132pub type REF_R = crate::FieldReader<u8, REF_A>;
133#[doc = "Single Sample Reference Selection\n\nValue on reset: 0"]
134#[derive(Clone, Copy, Debug, PartialEq, Eq)]
135#[repr(u8)]
136pub enum REF_A {
137 #[doc = "0: Internal 1.25 V reference"]
138 _1V25 = 0,
139 #[doc = "1: Internal 2.5 V reference"]
140 _2V5 = 1,
141 #[doc = "2: Buffered VDD"]
142 VDD = 2,
143 #[doc = "3: Internal differential 5 V reference"]
144 _5VDIFF = 3,
145 #[doc = "4: Single ended external reference from ADCn_CH6"]
146 EXTSINGLE = 4,
147 #[doc = "5: Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
148 _2XEXTDIFF = 5,
149 #[doc = "6: Unbuffered 2xVDD"]
150 _2XVDD = 6,
151}
152impl From<REF_A> for u8 {
153 #[inline(always)]
154 fn from(variant: REF_A) -> Self {
155 variant as _
156 }
157}
158impl REF_R {
159 #[doc = "Get enumerated values variant"]
160 #[inline(always)]
161 pub fn variant(&self) -> Option<REF_A> {
162 match self.bits {
163 0 => Some(REF_A::_1V25),
164 1 => Some(REF_A::_2V5),
165 2 => Some(REF_A::VDD),
166 3 => Some(REF_A::_5VDIFF),
167 4 => Some(REF_A::EXTSINGLE),
168 5 => Some(REF_A::_2XEXTDIFF),
169 6 => Some(REF_A::_2XVDD),
170 _ => None,
171 }
172 }
173 #[doc = "Checks if the value of the field is `_1V25`"]
174 #[inline(always)]
175 pub fn is_1v25(&self) -> bool {
176 *self == REF_A::_1V25
177 }
178 #[doc = "Checks if the value of the field is `_2V5`"]
179 #[inline(always)]
180 pub fn is_2v5(&self) -> bool {
181 *self == REF_A::_2V5
182 }
183 #[doc = "Checks if the value of the field is `VDD`"]
184 #[inline(always)]
185 pub fn is_vdd(&self) -> bool {
186 *self == REF_A::VDD
187 }
188 #[doc = "Checks if the value of the field is `_5VDIFF`"]
189 #[inline(always)]
190 pub fn is_5vdiff(&self) -> bool {
191 *self == REF_A::_5VDIFF
192 }
193 #[doc = "Checks if the value of the field is `EXTSINGLE`"]
194 #[inline(always)]
195 pub fn is_extsingle(&self) -> bool {
196 *self == REF_A::EXTSINGLE
197 }
198 #[doc = "Checks if the value of the field is `_2XEXTDIFF`"]
199 #[inline(always)]
200 pub fn is_2xextdiff(&self) -> bool {
201 *self == REF_A::_2XEXTDIFF
202 }
203 #[doc = "Checks if the value of the field is `_2XVDD`"]
204 #[inline(always)]
205 pub fn is_2xvdd(&self) -> bool {
206 *self == REF_A::_2XVDD
207 }
208}
209#[doc = "Field `REF` writer - Single Sample Reference Selection"]
210pub type REF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, REF_A, 3, O>;
211impl<'a, const O: u8> REF_W<'a, O> {
212 #[doc = "Internal 1.25 V reference"]
213 #[inline(always)]
214 pub fn _1v25(self) -> &'a mut W {
215 self.variant(REF_A::_1V25)
216 }
217 #[doc = "Internal 2.5 V reference"]
218 #[inline(always)]
219 pub fn _2v5(self) -> &'a mut W {
220 self.variant(REF_A::_2V5)
221 }
222 #[doc = "Buffered VDD"]
223 #[inline(always)]
224 pub fn vdd(self) -> &'a mut W {
225 self.variant(REF_A::VDD)
226 }
227 #[doc = "Internal differential 5 V reference"]
228 #[inline(always)]
229 pub fn _5vdiff(self) -> &'a mut W {
230 self.variant(REF_A::_5VDIFF)
231 }
232 #[doc = "Single ended external reference from ADCn_CH6"]
233 #[inline(always)]
234 pub fn extsingle(self) -> &'a mut W {
235 self.variant(REF_A::EXTSINGLE)
236 }
237 #[doc = "Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
238 #[inline(always)]
239 pub fn _2xextdiff(self) -> &'a mut W {
240 self.variant(REF_A::_2XEXTDIFF)
241 }
242 #[doc = "Unbuffered 2xVDD"]
243 #[inline(always)]
244 pub fn _2xvdd(self) -> &'a mut W {
245 self.variant(REF_A::_2XVDD)
246 }
247}
248#[doc = "Field `AT` reader - Single Sample Acquisition Time"]
249pub type AT_R = crate::FieldReader<u8, AT_A>;
250#[doc = "Single Sample Acquisition Time\n\nValue on reset: 0"]
251#[derive(Clone, Copy, Debug, PartialEq, Eq)]
252#[repr(u8)]
253pub enum AT_A {
254 #[doc = "0: 1 ADC_CLK cycle acquisition time for single sample"]
255 _1CYCLE = 0,
256 #[doc = "1: 2 ADC_CLK cycles acquisition time for single sample"]
257 _2CYCLES = 1,
258 #[doc = "2: 4 ADC_CLK cycles acquisition time for single sample"]
259 _4CYCLES = 2,
260 #[doc = "3: 8 ADC_CLK cycles acquisition time for single sample"]
261 _8CYCLES = 3,
262 #[doc = "4: 16 ADC_CLK cycles acquisition time for single sample"]
263 _16CYCLES = 4,
264 #[doc = "5: 32 ADC_CLK cycles acquisition time for single sample"]
265 _32CYCLES = 5,
266 #[doc = "6: 64 ADC_CLK cycles acquisition time for single sample"]
267 _64CYCLES = 6,
268 #[doc = "7: 128 ADC_CLK cycles acquisition time for single sample"]
269 _128CYCLES = 7,
270 #[doc = "8: 256 ADC_CLK cycles acquisition time for single sample"]
271 _256CYCLES = 8,
272}
273impl From<AT_A> for u8 {
274 #[inline(always)]
275 fn from(variant: AT_A) -> Self {
276 variant as _
277 }
278}
279impl AT_R {
280 #[doc = "Get enumerated values variant"]
281 #[inline(always)]
282 pub fn variant(&self) -> Option<AT_A> {
283 match self.bits {
284 0 => Some(AT_A::_1CYCLE),
285 1 => Some(AT_A::_2CYCLES),
286 2 => Some(AT_A::_4CYCLES),
287 3 => Some(AT_A::_8CYCLES),
288 4 => Some(AT_A::_16CYCLES),
289 5 => Some(AT_A::_32CYCLES),
290 6 => Some(AT_A::_64CYCLES),
291 7 => Some(AT_A::_128CYCLES),
292 8 => Some(AT_A::_256CYCLES),
293 _ => None,
294 }
295 }
296 #[doc = "Checks if the value of the field is `_1CYCLE`"]
297 #[inline(always)]
298 pub fn is_1cycle(&self) -> bool {
299 *self == AT_A::_1CYCLE
300 }
301 #[doc = "Checks if the value of the field is `_2CYCLES`"]
302 #[inline(always)]
303 pub fn is_2cycles(&self) -> bool {
304 *self == AT_A::_2CYCLES
305 }
306 #[doc = "Checks if the value of the field is `_4CYCLES`"]
307 #[inline(always)]
308 pub fn is_4cycles(&self) -> bool {
309 *self == AT_A::_4CYCLES
310 }
311 #[doc = "Checks if the value of the field is `_8CYCLES`"]
312 #[inline(always)]
313 pub fn is_8cycles(&self) -> bool {
314 *self == AT_A::_8CYCLES
315 }
316 #[doc = "Checks if the value of the field is `_16CYCLES`"]
317 #[inline(always)]
318 pub fn is_16cycles(&self) -> bool {
319 *self == AT_A::_16CYCLES
320 }
321 #[doc = "Checks if the value of the field is `_32CYCLES`"]
322 #[inline(always)]
323 pub fn is_32cycles(&self) -> bool {
324 *self == AT_A::_32CYCLES
325 }
326 #[doc = "Checks if the value of the field is `_64CYCLES`"]
327 #[inline(always)]
328 pub fn is_64cycles(&self) -> bool {
329 *self == AT_A::_64CYCLES
330 }
331 #[doc = "Checks if the value of the field is `_128CYCLES`"]
332 #[inline(always)]
333 pub fn is_128cycles(&self) -> bool {
334 *self == AT_A::_128CYCLES
335 }
336 #[doc = "Checks if the value of the field is `_256CYCLES`"]
337 #[inline(always)]
338 pub fn is_256cycles(&self) -> bool {
339 *self == AT_A::_256CYCLES
340 }
341}
342#[doc = "Field `AT` writer - Single Sample Acquisition Time"]
343pub type AT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, AT_A, 4, O>;
344impl<'a, const O: u8> AT_W<'a, O> {
345 #[doc = "1 ADC_CLK cycle acquisition time for single sample"]
346 #[inline(always)]
347 pub fn _1cycle(self) -> &'a mut W {
348 self.variant(AT_A::_1CYCLE)
349 }
350 #[doc = "2 ADC_CLK cycles acquisition time for single sample"]
351 #[inline(always)]
352 pub fn _2cycles(self) -> &'a mut W {
353 self.variant(AT_A::_2CYCLES)
354 }
355 #[doc = "4 ADC_CLK cycles acquisition time for single sample"]
356 #[inline(always)]
357 pub fn _4cycles(self) -> &'a mut W {
358 self.variant(AT_A::_4CYCLES)
359 }
360 #[doc = "8 ADC_CLK cycles acquisition time for single sample"]
361 #[inline(always)]
362 pub fn _8cycles(self) -> &'a mut W {
363 self.variant(AT_A::_8CYCLES)
364 }
365 #[doc = "16 ADC_CLK cycles acquisition time for single sample"]
366 #[inline(always)]
367 pub fn _16cycles(self) -> &'a mut W {
368 self.variant(AT_A::_16CYCLES)
369 }
370 #[doc = "32 ADC_CLK cycles acquisition time for single sample"]
371 #[inline(always)]
372 pub fn _32cycles(self) -> &'a mut W {
373 self.variant(AT_A::_32CYCLES)
374 }
375 #[doc = "64 ADC_CLK cycles acquisition time for single sample"]
376 #[inline(always)]
377 pub fn _64cycles(self) -> &'a mut W {
378 self.variant(AT_A::_64CYCLES)
379 }
380 #[doc = "128 ADC_CLK cycles acquisition time for single sample"]
381 #[inline(always)]
382 pub fn _128cycles(self) -> &'a mut W {
383 self.variant(AT_A::_128CYCLES)
384 }
385 #[doc = "256 ADC_CLK cycles acquisition time for single sample"]
386 #[inline(always)]
387 pub fn _256cycles(self) -> &'a mut W {
388 self.variant(AT_A::_256CYCLES)
389 }
390}
391#[doc = "Field `PRSEN` reader - Single Sample PRS Trigger Enable"]
392pub type PRSEN_R = crate::BitReader<bool>;
393#[doc = "Field `PRSEN` writer - Single Sample PRS Trigger Enable"]
394pub type PRSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
395#[doc = "Field `PRSSEL` reader - Single Sample PRS Trigger Select"]
396pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
397#[doc = "Single Sample PRS Trigger Select\n\nValue on reset: 0"]
398#[derive(Clone, Copy, Debug, PartialEq, Eq)]
399#[repr(u8)]
400pub enum PRSSEL_A {
401 #[doc = "0: PRS ch 0 triggers single sample"]
402 PRSCH0 = 0,
403 #[doc = "1: PRS ch 1 triggers single sample"]
404 PRSCH1 = 1,
405 #[doc = "2: PRS ch 2 triggers single sample"]
406 PRSCH2 = 2,
407 #[doc = "3: PRS ch 3 triggers single sample"]
408 PRSCH3 = 3,
409 #[doc = "4: PRS ch 4 triggers single sample"]
410 PRSCH4 = 4,
411 #[doc = "5: PRS ch 5 triggers single sample"]
412 PRSCH5 = 5,
413 #[doc = "6: PRS ch 6 triggers single sample"]
414 PRSCH6 = 6,
415 #[doc = "7: PRS ch 7 triggers single sample"]
416 PRSCH7 = 7,
417}
418impl From<PRSSEL_A> for u8 {
419 #[inline(always)]
420 fn from(variant: PRSSEL_A) -> Self {
421 variant as _
422 }
423}
424impl PRSSEL_R {
425 #[doc = "Get enumerated values variant"]
426 #[inline(always)]
427 pub fn variant(&self) -> PRSSEL_A {
428 match self.bits {
429 0 => PRSSEL_A::PRSCH0,
430 1 => PRSSEL_A::PRSCH1,
431 2 => PRSSEL_A::PRSCH2,
432 3 => PRSSEL_A::PRSCH3,
433 4 => PRSSEL_A::PRSCH4,
434 5 => PRSSEL_A::PRSCH5,
435 6 => PRSSEL_A::PRSCH6,
436 7 => PRSSEL_A::PRSCH7,
437 _ => unreachable!(),
438 }
439 }
440 #[doc = "Checks if the value of the field is `PRSCH0`"]
441 #[inline(always)]
442 pub fn is_prsch0(&self) -> bool {
443 *self == PRSSEL_A::PRSCH0
444 }
445 #[doc = "Checks if the value of the field is `PRSCH1`"]
446 #[inline(always)]
447 pub fn is_prsch1(&self) -> bool {
448 *self == PRSSEL_A::PRSCH1
449 }
450 #[doc = "Checks if the value of the field is `PRSCH2`"]
451 #[inline(always)]
452 pub fn is_prsch2(&self) -> bool {
453 *self == PRSSEL_A::PRSCH2
454 }
455 #[doc = "Checks if the value of the field is `PRSCH3`"]
456 #[inline(always)]
457 pub fn is_prsch3(&self) -> bool {
458 *self == PRSSEL_A::PRSCH3
459 }
460 #[doc = "Checks if the value of the field is `PRSCH4`"]
461 #[inline(always)]
462 pub fn is_prsch4(&self) -> bool {
463 *self == PRSSEL_A::PRSCH4
464 }
465 #[doc = "Checks if the value of the field is `PRSCH5`"]
466 #[inline(always)]
467 pub fn is_prsch5(&self) -> bool {
468 *self == PRSSEL_A::PRSCH5
469 }
470 #[doc = "Checks if the value of the field is `PRSCH6`"]
471 #[inline(always)]
472 pub fn is_prsch6(&self) -> bool {
473 *self == PRSSEL_A::PRSCH6
474 }
475 #[doc = "Checks if the value of the field is `PRSCH7`"]
476 #[inline(always)]
477 pub fn is_prsch7(&self) -> bool {
478 *self == PRSSEL_A::PRSCH7
479 }
480}
481#[doc = "Field `PRSSEL` writer - Single Sample PRS Trigger Select"]
482pub type PRSSEL_W<'a, const O: u8> =
483 crate::FieldWriterSafe<'a, u32, SINGLECTRL_SPEC, u8, PRSSEL_A, 3, O>;
484impl<'a, const O: u8> PRSSEL_W<'a, O> {
485 #[doc = "PRS ch 0 triggers single sample"]
486 #[inline(always)]
487 pub fn prsch0(self) -> &'a mut W {
488 self.variant(PRSSEL_A::PRSCH0)
489 }
490 #[doc = "PRS ch 1 triggers single sample"]
491 #[inline(always)]
492 pub fn prsch1(self) -> &'a mut W {
493 self.variant(PRSSEL_A::PRSCH1)
494 }
495 #[doc = "PRS ch 2 triggers single sample"]
496 #[inline(always)]
497 pub fn prsch2(self) -> &'a mut W {
498 self.variant(PRSSEL_A::PRSCH2)
499 }
500 #[doc = "PRS ch 3 triggers single sample"]
501 #[inline(always)]
502 pub fn prsch3(self) -> &'a mut W {
503 self.variant(PRSSEL_A::PRSCH3)
504 }
505 #[doc = "PRS ch 4 triggers single sample"]
506 #[inline(always)]
507 pub fn prsch4(self) -> &'a mut W {
508 self.variant(PRSSEL_A::PRSCH4)
509 }
510 #[doc = "PRS ch 5 triggers single sample"]
511 #[inline(always)]
512 pub fn prsch5(self) -> &'a mut W {
513 self.variant(PRSSEL_A::PRSCH5)
514 }
515 #[doc = "PRS ch 6 triggers single sample"]
516 #[inline(always)]
517 pub fn prsch6(self) -> &'a mut W {
518 self.variant(PRSSEL_A::PRSCH6)
519 }
520 #[doc = "PRS ch 7 triggers single sample"]
521 #[inline(always)]
522 pub fn prsch7(self) -> &'a mut W {
523 self.variant(PRSSEL_A::PRSCH7)
524 }
525}
526impl R {
527 #[doc = "Bit 0 - Single Sample Repetitive Mode"]
528 #[inline(always)]
529 pub fn rep(&self) -> REP_R {
530 REP_R::new((self.bits & 1) != 0)
531 }
532 #[doc = "Bit 1 - Single Sample Differential Mode"]
533 #[inline(always)]
534 pub fn diff(&self) -> DIFF_R {
535 DIFF_R::new(((self.bits >> 1) & 1) != 0)
536 }
537 #[doc = "Bit 2 - Single Sample Result Adjustment"]
538 #[inline(always)]
539 pub fn adj(&self) -> ADJ_R {
540 ADJ_R::new(((self.bits >> 2) & 1) != 0)
541 }
542 #[doc = "Bits 4:5 - Single Sample Resolution Select"]
543 #[inline(always)]
544 pub fn res(&self) -> RES_R {
545 RES_R::new(((self.bits >> 4) & 3) as u8)
546 }
547 #[doc = "Bits 8:11 - Single Sample Input Selection"]
548 #[inline(always)]
549 pub fn inputsel(&self) -> INPUTSEL_R {
550 INPUTSEL_R::new(((self.bits >> 8) & 0x0f) as u8)
551 }
552 #[doc = "Bits 16:18 - Single Sample Reference Selection"]
553 #[inline(always)]
554 pub fn ref_(&self) -> REF_R {
555 REF_R::new(((self.bits >> 16) & 7) as u8)
556 }
557 #[doc = "Bits 20:23 - Single Sample Acquisition Time"]
558 #[inline(always)]
559 pub fn at(&self) -> AT_R {
560 AT_R::new(((self.bits >> 20) & 0x0f) as u8)
561 }
562 #[doc = "Bit 24 - Single Sample PRS Trigger Enable"]
563 #[inline(always)]
564 pub fn prsen(&self) -> PRSEN_R {
565 PRSEN_R::new(((self.bits >> 24) & 1) != 0)
566 }
567 #[doc = "Bits 28:30 - Single Sample PRS Trigger Select"]
568 #[inline(always)]
569 pub fn prssel(&self) -> PRSSEL_R {
570 PRSSEL_R::new(((self.bits >> 28) & 7) as u8)
571 }
572}
573impl W {
574 #[doc = "Bit 0 - Single Sample Repetitive Mode"]
575 #[inline(always)]
576 #[must_use]
577 pub fn rep(&mut self) -> REP_W<0> {
578 REP_W::new(self)
579 }
580 #[doc = "Bit 1 - Single Sample Differential Mode"]
581 #[inline(always)]
582 #[must_use]
583 pub fn diff(&mut self) -> DIFF_W<1> {
584 DIFF_W::new(self)
585 }
586 #[doc = "Bit 2 - Single Sample Result Adjustment"]
587 #[inline(always)]
588 #[must_use]
589 pub fn adj(&mut self) -> ADJ_W<2> {
590 ADJ_W::new(self)
591 }
592 #[doc = "Bits 4:5 - Single Sample Resolution Select"]
593 #[inline(always)]
594 #[must_use]
595 pub fn res(&mut self) -> RES_W<4> {
596 RES_W::new(self)
597 }
598 #[doc = "Bits 8:11 - Single Sample Input Selection"]
599 #[inline(always)]
600 #[must_use]
601 pub fn inputsel(&mut self) -> INPUTSEL_W<8> {
602 INPUTSEL_W::new(self)
603 }
604 #[doc = "Bits 16:18 - Single Sample Reference Selection"]
605 #[inline(always)]
606 #[must_use]
607 pub fn ref_(&mut self) -> REF_W<16> {
608 REF_W::new(self)
609 }
610 #[doc = "Bits 20:23 - Single Sample Acquisition Time"]
611 #[inline(always)]
612 #[must_use]
613 pub fn at(&mut self) -> AT_W<20> {
614 AT_W::new(self)
615 }
616 #[doc = "Bit 24 - Single Sample PRS Trigger Enable"]
617 #[inline(always)]
618 #[must_use]
619 pub fn prsen(&mut self) -> PRSEN_W<24> {
620 PRSEN_W::new(self)
621 }
622 #[doc = "Bits 28:30 - Single Sample PRS Trigger Select"]
623 #[inline(always)]
624 #[must_use]
625 pub fn prssel(&mut self) -> PRSSEL_W<28> {
626 PRSSEL_W::new(self)
627 }
628 #[doc = "Writes raw bits to the register."]
629 #[inline(always)]
630 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
631 self.0.bits(bits);
632 self
633 }
634}
635#[doc = "Single Sample 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 [singlectrl](index.html) module"]
636pub struct SINGLECTRL_SPEC;
637impl crate::RegisterSpec for SINGLECTRL_SPEC {
638 type Ux = u32;
639}
640#[doc = "`read()` method returns [singlectrl::R](R) reader structure"]
641impl crate::Readable for SINGLECTRL_SPEC {
642 type Reader = R;
643}
644#[doc = "`write(|w| ..)` method takes [singlectrl::W](W) writer structure"]
645impl crate::Writable for SINGLECTRL_SPEC {
646 type Writer = W;
647 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
648 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
649}
650#[doc = "`reset()` method sets SINGLECTRL to value 0"]
651impl crate::Resettable for SINGLECTRL_SPEC {
652 const RESET_VALUE: Self::Ux = 0;
653}