1#[doc = "Register `GCR` reader"]
2pub type R = crate::R<GcrSpec>;
3#[doc = "Register `GCR` writer"]
4pub type W = crate::W<GcrSpec>;
5#[doc = "DAC Enable\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Dacen {
9 #[doc = "0: Disables"]
10 Disabled = 0,
11 #[doc = "1: Enables"]
12 Enabled = 1,
13}
14impl From<Dacen> for bool {
15 #[inline(always)]
16 fn from(variant: Dacen) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `DACEN` reader - DAC Enable"]
21pub type DacenR = crate::BitReader<Dacen>;
22impl DacenR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> Dacen {
26 match self.bits {
27 false => Dacen::Disabled,
28 true => Dacen::Enabled,
29 }
30 }
31 #[doc = "Disables"]
32 #[inline(always)]
33 pub fn is_disabled(&self) -> bool {
34 *self == Dacen::Disabled
35 }
36 #[doc = "Enables"]
37 #[inline(always)]
38 pub fn is_enabled(&self) -> bool {
39 *self == Dacen::Enabled
40 }
41}
42#[doc = "Field `DACEN` writer - DAC Enable"]
43pub type DacenW<'a, REG> = crate::BitWriter<'a, REG, Dacen>;
44impl<'a, REG> DacenW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "Disables"]
49 #[inline(always)]
50 pub fn disabled(self) -> &'a mut crate::W<REG> {
51 self.variant(Dacen::Disabled)
52 }
53 #[doc = "Enables"]
54 #[inline(always)]
55 pub fn enabled(self) -> &'a mut crate::W<REG> {
56 self.variant(Dacen::Enabled)
57 }
58}
59#[doc = "DAC Reference Select\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62#[repr(u8)]
63pub enum Dacrfs {
64 #[doc = "0: Selects VREFH0 as the reference voltage."]
65 Vrefh0 = 0,
66 #[doc = "1: Selects VREFH1 as the reference voltage."]
67 Vrefh1 = 1,
68 #[doc = "2: Selects VREFH2 as the reference voltage."]
69 Vrefh2 = 2,
70}
71impl From<Dacrfs> for u8 {
72 #[inline(always)]
73 fn from(variant: Dacrfs) -> Self {
74 variant as _
75 }
76}
77impl crate::FieldSpec for Dacrfs {
78 type Ux = u8;
79}
80impl crate::IsEnum for Dacrfs {}
81#[doc = "Field `DACRFS` reader - DAC Reference Select"]
82pub type DacrfsR = crate::FieldReader<Dacrfs>;
83impl DacrfsR {
84 #[doc = "Get enumerated values variant"]
85 #[inline(always)]
86 pub const fn variant(&self) -> Option<Dacrfs> {
87 match self.bits {
88 0 => Some(Dacrfs::Vrefh0),
89 1 => Some(Dacrfs::Vrefh1),
90 2 => Some(Dacrfs::Vrefh2),
91 _ => None,
92 }
93 }
94 #[doc = "Selects VREFH0 as the reference voltage."]
95 #[inline(always)]
96 pub fn is_vrefh0(&self) -> bool {
97 *self == Dacrfs::Vrefh0
98 }
99 #[doc = "Selects VREFH1 as the reference voltage."]
100 #[inline(always)]
101 pub fn is_vrefh1(&self) -> bool {
102 *self == Dacrfs::Vrefh1
103 }
104 #[doc = "Selects VREFH2 as the reference voltage."]
105 #[inline(always)]
106 pub fn is_vrefh2(&self) -> bool {
107 *self == Dacrfs::Vrefh2
108 }
109}
110#[doc = "Field `DACRFS` writer - DAC Reference Select"]
111pub type DacrfsW<'a, REG> = crate::FieldWriter<'a, REG, 2, Dacrfs>;
112impl<'a, REG> DacrfsW<'a, REG>
113where
114 REG: crate::Writable + crate::RegisterSpec,
115 REG::Ux: From<u8>,
116{
117 #[doc = "Selects VREFH0 as the reference voltage."]
118 #[inline(always)]
119 pub fn vrefh0(self) -> &'a mut crate::W<REG> {
120 self.variant(Dacrfs::Vrefh0)
121 }
122 #[doc = "Selects VREFH1 as the reference voltage."]
123 #[inline(always)]
124 pub fn vrefh1(self) -> &'a mut crate::W<REG> {
125 self.variant(Dacrfs::Vrefh1)
126 }
127 #[doc = "Selects VREFH2 as the reference voltage."]
128 #[inline(always)]
129 pub fn vrefh2(self) -> &'a mut crate::W<REG> {
130 self.variant(Dacrfs::Vrefh2)
131 }
132}
133#[doc = "FIFO Enable\n\nValue on reset: 0"]
134#[cfg_attr(feature = "defmt", derive(defmt::Format))]
135#[derive(Clone, Copy, Debug, PartialEq, Eq)]
136pub enum Fifoen {
137 #[doc = "0: Disables FIFO mode and enables Buffer mode. Any data written to DATA\\[DATA\\] goes to buffer then goes to conversion."]
138 BufferMode = 0,
139 #[doc = "1: Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion."]
140 FifoMode = 1,
141}
142impl From<Fifoen> for bool {
143 #[inline(always)]
144 fn from(variant: Fifoen) -> Self {
145 variant as u8 != 0
146 }
147}
148#[doc = "Field `FIFOEN` reader - FIFO Enable"]
149pub type FifoenR = crate::BitReader<Fifoen>;
150impl FifoenR {
151 #[doc = "Get enumerated values variant"]
152 #[inline(always)]
153 pub const fn variant(&self) -> Fifoen {
154 match self.bits {
155 false => Fifoen::BufferMode,
156 true => Fifoen::FifoMode,
157 }
158 }
159 #[doc = "Disables FIFO mode and enables Buffer mode. Any data written to DATA\\[DATA\\] goes to buffer then goes to conversion."]
160 #[inline(always)]
161 pub fn is_buffer_mode(&self) -> bool {
162 *self == Fifoen::BufferMode
163 }
164 #[doc = "Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion."]
165 #[inline(always)]
166 pub fn is_fifo_mode(&self) -> bool {
167 *self == Fifoen::FifoMode
168 }
169}
170#[doc = "Field `FIFOEN` writer - FIFO Enable"]
171pub type FifoenW<'a, REG> = crate::BitWriter<'a, REG, Fifoen>;
172impl<'a, REG> FifoenW<'a, REG>
173where
174 REG: crate::Writable + crate::RegisterSpec,
175{
176 #[doc = "Disables FIFO mode and enables Buffer mode. Any data written to DATA\\[DATA\\] goes to buffer then goes to conversion."]
177 #[inline(always)]
178 pub fn buffer_mode(self) -> &'a mut crate::W<REG> {
179 self.variant(Fifoen::BufferMode)
180 }
181 #[doc = "Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion."]
182 #[inline(always)]
183 pub fn fifo_mode(self) -> &'a mut crate::W<REG> {
184 self.variant(Fifoen::FifoMode)
185 }
186}
187#[doc = "Swing Back Mode\n\nValue on reset: 0"]
188#[cfg_attr(feature = "defmt", derive(defmt::Format))]
189#[derive(Clone, Copy, Debug, PartialEq, Eq)]
190pub enum Swmd {
191 #[doc = "0: Disables"]
192 Disable = 0,
193 #[doc = "1: Enables"]
194 Enable = 1,
195}
196impl From<Swmd> for bool {
197 #[inline(always)]
198 fn from(variant: Swmd) -> Self {
199 variant as u8 != 0
200 }
201}
202#[doc = "Field `SWMD` reader - Swing Back Mode"]
203pub type SwmdR = crate::BitReader<Swmd>;
204impl SwmdR {
205 #[doc = "Get enumerated values variant"]
206 #[inline(always)]
207 pub const fn variant(&self) -> Swmd {
208 match self.bits {
209 false => Swmd::Disable,
210 true => Swmd::Enable,
211 }
212 }
213 #[doc = "Disables"]
214 #[inline(always)]
215 pub fn is_disable(&self) -> bool {
216 *self == Swmd::Disable
217 }
218 #[doc = "Enables"]
219 #[inline(always)]
220 pub fn is_enable(&self) -> bool {
221 *self == Swmd::Enable
222 }
223}
224#[doc = "Field `SWMD` writer - Swing Back Mode"]
225pub type SwmdW<'a, REG> = crate::BitWriter<'a, REG, Swmd>;
226impl<'a, REG> SwmdW<'a, REG>
227where
228 REG: crate::Writable + crate::RegisterSpec,
229{
230 #[doc = "Disables"]
231 #[inline(always)]
232 pub fn disable(self) -> &'a mut crate::W<REG> {
233 self.variant(Swmd::Disable)
234 }
235 #[doc = "Enables"]
236 #[inline(always)]
237 pub fn enable(self) -> &'a mut crate::W<REG> {
238 self.variant(Swmd::Enable)
239 }
240}
241#[doc = "DAC Trigger Select\n\nValue on reset: 0"]
242#[cfg_attr(feature = "defmt", derive(defmt::Format))]
243#[derive(Clone, Copy, Debug, PartialEq, Eq)]
244pub enum Trgsel {
245 #[doc = "0: Hardware trigger"]
246 Hardware = 0,
247 #[doc = "1: Software trigger"]
248 Software = 1,
249}
250impl From<Trgsel> for bool {
251 #[inline(always)]
252 fn from(variant: Trgsel) -> Self {
253 variant as u8 != 0
254 }
255}
256#[doc = "Field `TRGSEL` reader - DAC Trigger Select"]
257pub type TrgselR = crate::BitReader<Trgsel>;
258impl TrgselR {
259 #[doc = "Get enumerated values variant"]
260 #[inline(always)]
261 pub const fn variant(&self) -> Trgsel {
262 match self.bits {
263 false => Trgsel::Hardware,
264 true => Trgsel::Software,
265 }
266 }
267 #[doc = "Hardware trigger"]
268 #[inline(always)]
269 pub fn is_hardware(&self) -> bool {
270 *self == Trgsel::Hardware
271 }
272 #[doc = "Software trigger"]
273 #[inline(always)]
274 pub fn is_software(&self) -> bool {
275 *self == Trgsel::Software
276 }
277}
278#[doc = "Field `TRGSEL` writer - DAC Trigger Select"]
279pub type TrgselW<'a, REG> = crate::BitWriter<'a, REG, Trgsel>;
280impl<'a, REG> TrgselW<'a, REG>
281where
282 REG: crate::Writable + crate::RegisterSpec,
283{
284 #[doc = "Hardware trigger"]
285 #[inline(always)]
286 pub fn hardware(self) -> &'a mut crate::W<REG> {
287 self.variant(Trgsel::Hardware)
288 }
289 #[doc = "Software trigger"]
290 #[inline(always)]
291 pub fn software(self) -> &'a mut crate::W<REG> {
292 self.variant(Trgsel::Software)
293 }
294}
295#[doc = "DAC Periodic Trigger Mode Enable\n\nValue on reset: 0"]
296#[cfg_attr(feature = "defmt", derive(defmt::Format))]
297#[derive(Clone, Copy, Debug, PartialEq, Eq)]
298pub enum Ptgen {
299 #[doc = "0: Disables"]
300 Disabled = 0,
301 #[doc = "1: Enables"]
302 Enabled = 1,
303}
304impl From<Ptgen> for bool {
305 #[inline(always)]
306 fn from(variant: Ptgen) -> Self {
307 variant as u8 != 0
308 }
309}
310#[doc = "Field `PTGEN` reader - DAC Periodic Trigger Mode Enable"]
311pub type PtgenR = crate::BitReader<Ptgen>;
312impl PtgenR {
313 #[doc = "Get enumerated values variant"]
314 #[inline(always)]
315 pub const fn variant(&self) -> Ptgen {
316 match self.bits {
317 false => Ptgen::Disabled,
318 true => Ptgen::Enabled,
319 }
320 }
321 #[doc = "Disables"]
322 #[inline(always)]
323 pub fn is_disabled(&self) -> bool {
324 *self == Ptgen::Disabled
325 }
326 #[doc = "Enables"]
327 #[inline(always)]
328 pub fn is_enabled(&self) -> bool {
329 *self == Ptgen::Enabled
330 }
331}
332#[doc = "Field `PTGEN` writer - DAC Periodic Trigger Mode Enable"]
333pub type PtgenW<'a, REG> = crate::BitWriter<'a, REG, Ptgen>;
334impl<'a, REG> PtgenW<'a, REG>
335where
336 REG: crate::Writable + crate::RegisterSpec,
337{
338 #[doc = "Disables"]
339 #[inline(always)]
340 pub fn disabled(self) -> &'a mut crate::W<REG> {
341 self.variant(Ptgen::Disabled)
342 }
343 #[doc = "Enables"]
344 #[inline(always)]
345 pub fn enabled(self) -> &'a mut crate::W<REG> {
346 self.variant(Ptgen::Enabled)
347 }
348}
349#[doc = "Field `LATCH_CYC` reader - RCLK Cycles Before Data Latch"]
350pub type LatchCycR = crate::FieldReader;
351#[doc = "Field `LATCH_CYC` writer - RCLK Cycles Before Data Latch"]
352pub type LatchCycW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
353#[doc = "Buffer Enable\n\nValue on reset: 0"]
354#[cfg_attr(feature = "defmt", derive(defmt::Format))]
355#[derive(Clone, Copy, Debug, PartialEq, Eq)]
356pub enum BufEn {
357 #[doc = "0: Not used"]
358 UseBuf = 0,
359 #[doc = "1: Used"]
360 NoUseBuf = 1,
361}
362impl From<BufEn> for bool {
363 #[inline(always)]
364 fn from(variant: BufEn) -> Self {
365 variant as u8 != 0
366 }
367}
368#[doc = "Field `BUF_EN` reader - Buffer Enable"]
369pub type BufEnR = crate::BitReader<BufEn>;
370impl BufEnR {
371 #[doc = "Get enumerated values variant"]
372 #[inline(always)]
373 pub const fn variant(&self) -> BufEn {
374 match self.bits {
375 false => BufEn::UseBuf,
376 true => BufEn::NoUseBuf,
377 }
378 }
379 #[doc = "Not used"]
380 #[inline(always)]
381 pub fn is_use_buf(&self) -> bool {
382 *self == BufEn::UseBuf
383 }
384 #[doc = "Used"]
385 #[inline(always)]
386 pub fn is_no_use_buf(&self) -> bool {
387 *self == BufEn::NoUseBuf
388 }
389}
390#[doc = "Field `BUF_EN` writer - Buffer Enable"]
391pub type BufEnW<'a, REG> = crate::BitWriter<'a, REG, BufEn>;
392impl<'a, REG> BufEnW<'a, REG>
393where
394 REG: crate::Writable + crate::RegisterSpec,
395{
396 #[doc = "Not used"]
397 #[inline(always)]
398 pub fn use_buf(self) -> &'a mut crate::W<REG> {
399 self.variant(BufEn::UseBuf)
400 }
401 #[doc = "Used"]
402 #[inline(always)]
403 pub fn no_use_buf(self) -> &'a mut crate::W<REG> {
404 self.variant(BufEn::NoUseBuf)
405 }
406}
407#[doc = "External On-Chip PTAT Current Reference Select\n\nValue on reset: 0"]
408#[cfg_attr(feature = "defmt", derive(defmt::Format))]
409#[derive(Clone, Copy, Debug, PartialEq, Eq)]
410pub enum IrefPtatExtSel {
411 #[doc = "0: Not selected"]
412 NotSelected = 0,
413 #[doc = "1: Selected"]
414 Selected = 1,
415}
416impl From<IrefPtatExtSel> for bool {
417 #[inline(always)]
418 fn from(variant: IrefPtatExtSel) -> Self {
419 variant as u8 != 0
420 }
421}
422#[doc = "Field `IREF_PTAT_EXT_SEL` reader - External On-Chip PTAT Current Reference Select"]
423pub type IrefPtatExtSelR = crate::BitReader<IrefPtatExtSel>;
424impl IrefPtatExtSelR {
425 #[doc = "Get enumerated values variant"]
426 #[inline(always)]
427 pub const fn variant(&self) -> IrefPtatExtSel {
428 match self.bits {
429 false => IrefPtatExtSel::NotSelected,
430 true => IrefPtatExtSel::Selected,
431 }
432 }
433 #[doc = "Not selected"]
434 #[inline(always)]
435 pub fn is_not_selected(&self) -> bool {
436 *self == IrefPtatExtSel::NotSelected
437 }
438 #[doc = "Selected"]
439 #[inline(always)]
440 pub fn is_selected(&self) -> bool {
441 *self == IrefPtatExtSel::Selected
442 }
443}
444#[doc = "Field `IREF_PTAT_EXT_SEL` writer - External On-Chip PTAT Current Reference Select"]
445pub type IrefPtatExtSelW<'a, REG> = crate::BitWriter<'a, REG, IrefPtatExtSel>;
446impl<'a, REG> IrefPtatExtSelW<'a, REG>
447where
448 REG: crate::Writable + crate::RegisterSpec,
449{
450 #[doc = "Not selected"]
451 #[inline(always)]
452 pub fn not_selected(self) -> &'a mut crate::W<REG> {
453 self.variant(IrefPtatExtSel::NotSelected)
454 }
455 #[doc = "Selected"]
456 #[inline(always)]
457 pub fn selected(self) -> &'a mut crate::W<REG> {
458 self.variant(IrefPtatExtSel::Selected)
459 }
460}
461#[doc = "External On-Chip ZTC Current Reference Select\n\nValue on reset: 0"]
462#[cfg_attr(feature = "defmt", derive(defmt::Format))]
463#[derive(Clone, Copy, Debug, PartialEq, Eq)]
464pub enum IrefZtcExtSel {
465 #[doc = "0: Not selected"]
466 NotSelected = 0,
467 #[doc = "1: Selected"]
468 Selected = 1,
469}
470impl From<IrefZtcExtSel> for bool {
471 #[inline(always)]
472 fn from(variant: IrefZtcExtSel) -> Self {
473 variant as u8 != 0
474 }
475}
476#[doc = "Field `IREF_ZTC_EXT_SEL` reader - External On-Chip ZTC Current Reference Select"]
477pub type IrefZtcExtSelR = crate::BitReader<IrefZtcExtSel>;
478impl IrefZtcExtSelR {
479 #[doc = "Get enumerated values variant"]
480 #[inline(always)]
481 pub const fn variant(&self) -> IrefZtcExtSel {
482 match self.bits {
483 false => IrefZtcExtSel::NotSelected,
484 true => IrefZtcExtSel::Selected,
485 }
486 }
487 #[doc = "Not selected"]
488 #[inline(always)]
489 pub fn is_not_selected(&self) -> bool {
490 *self == IrefZtcExtSel::NotSelected
491 }
492 #[doc = "Selected"]
493 #[inline(always)]
494 pub fn is_selected(&self) -> bool {
495 *self == IrefZtcExtSel::Selected
496 }
497}
498#[doc = "Field `IREF_ZTC_EXT_SEL` writer - External On-Chip ZTC Current Reference Select"]
499pub type IrefZtcExtSelW<'a, REG> = crate::BitWriter<'a, REG, IrefZtcExtSel>;
500impl<'a, REG> IrefZtcExtSelW<'a, REG>
501where
502 REG: crate::Writable + crate::RegisterSpec,
503{
504 #[doc = "Not selected"]
505 #[inline(always)]
506 pub fn not_selected(self) -> &'a mut crate::W<REG> {
507 self.variant(IrefZtcExtSel::NotSelected)
508 }
509 #[doc = "Selected"]
510 #[inline(always)]
511 pub fn selected(self) -> &'a mut crate::W<REG> {
512 self.variant(IrefZtcExtSel::Selected)
513 }
514}
515#[doc = "OPAMP as Buffer, Speed Control Signal\n\nValue on reset: 0"]
516#[cfg_attr(feature = "defmt", derive(defmt::Format))]
517#[derive(Clone, Copy, Debug, PartialEq, Eq)]
518pub enum BufSpdCtrl {
519 #[doc = "0: Lower Low-Power mode"]
520 LlpMode = 0,
521 #[doc = "1: Low-Power mode"]
522 LpMode = 1,
523}
524impl From<BufSpdCtrl> for bool {
525 #[inline(always)]
526 fn from(variant: BufSpdCtrl) -> Self {
527 variant as u8 != 0
528 }
529}
530#[doc = "Field `BUF_SPD_CTRL` reader - OPAMP as Buffer, Speed Control Signal"]
531pub type BufSpdCtrlR = crate::BitReader<BufSpdCtrl>;
532impl BufSpdCtrlR {
533 #[doc = "Get enumerated values variant"]
534 #[inline(always)]
535 pub const fn variant(&self) -> BufSpdCtrl {
536 match self.bits {
537 false => BufSpdCtrl::LlpMode,
538 true => BufSpdCtrl::LpMode,
539 }
540 }
541 #[doc = "Lower Low-Power mode"]
542 #[inline(always)]
543 pub fn is_llp_mode(&self) -> bool {
544 *self == BufSpdCtrl::LlpMode
545 }
546 #[doc = "Low-Power mode"]
547 #[inline(always)]
548 pub fn is_lp_mode(&self) -> bool {
549 *self == BufSpdCtrl::LpMode
550 }
551}
552#[doc = "Field `BUF_SPD_CTRL` writer - OPAMP as Buffer, Speed Control Signal"]
553pub type BufSpdCtrlW<'a, REG> = crate::BitWriter<'a, REG, BufSpdCtrl>;
554impl<'a, REG> BufSpdCtrlW<'a, REG>
555where
556 REG: crate::Writable + crate::RegisterSpec,
557{
558 #[doc = "Lower Low-Power mode"]
559 #[inline(always)]
560 pub fn llp_mode(self) -> &'a mut crate::W<REG> {
561 self.variant(BufSpdCtrl::LlpMode)
562 }
563 #[doc = "Low-Power mode"]
564 #[inline(always)]
565 pub fn lp_mode(self) -> &'a mut crate::W<REG> {
566 self.variant(BufSpdCtrl::LpMode)
567 }
568}
569impl R {
570 #[doc = "Bit 0 - DAC Enable"]
571 #[inline(always)]
572 pub fn dacen(&self) -> DacenR {
573 DacenR::new((self.bits & 1) != 0)
574 }
575 #[doc = "Bits 1:2 - DAC Reference Select"]
576 #[inline(always)]
577 pub fn dacrfs(&self) -> DacrfsR {
578 DacrfsR::new(((self.bits >> 1) & 3) as u8)
579 }
580 #[doc = "Bit 3 - FIFO Enable"]
581 #[inline(always)]
582 pub fn fifoen(&self) -> FifoenR {
583 FifoenR::new(((self.bits >> 3) & 1) != 0)
584 }
585 #[doc = "Bit 4 - Swing Back Mode"]
586 #[inline(always)]
587 pub fn swmd(&self) -> SwmdR {
588 SwmdR::new(((self.bits >> 4) & 1) != 0)
589 }
590 #[doc = "Bit 5 - DAC Trigger Select"]
591 #[inline(always)]
592 pub fn trgsel(&self) -> TrgselR {
593 TrgselR::new(((self.bits >> 5) & 1) != 0)
594 }
595 #[doc = "Bit 6 - DAC Periodic Trigger Mode Enable"]
596 #[inline(always)]
597 pub fn ptgen(&self) -> PtgenR {
598 PtgenR::new(((self.bits >> 6) & 1) != 0)
599 }
600 #[doc = "Bits 8:11 - RCLK Cycles Before Data Latch"]
601 #[inline(always)]
602 pub fn latch_cyc(&self) -> LatchCycR {
603 LatchCycR::new(((self.bits >> 8) & 0x0f) as u8)
604 }
605 #[doc = "Bit 17 - Buffer Enable"]
606 #[inline(always)]
607 pub fn buf_en(&self) -> BufEnR {
608 BufEnR::new(((self.bits >> 17) & 1) != 0)
609 }
610 #[doc = "Bit 20 - External On-Chip PTAT Current Reference Select"]
611 #[inline(always)]
612 pub fn iref_ptat_ext_sel(&self) -> IrefPtatExtSelR {
613 IrefPtatExtSelR::new(((self.bits >> 20) & 1) != 0)
614 }
615 #[doc = "Bit 21 - External On-Chip ZTC Current Reference Select"]
616 #[inline(always)]
617 pub fn iref_ztc_ext_sel(&self) -> IrefZtcExtSelR {
618 IrefZtcExtSelR::new(((self.bits >> 21) & 1) != 0)
619 }
620 #[doc = "Bit 23 - OPAMP as Buffer, Speed Control Signal"]
621 #[inline(always)]
622 pub fn buf_spd_ctrl(&self) -> BufSpdCtrlR {
623 BufSpdCtrlR::new(((self.bits >> 23) & 1) != 0)
624 }
625}
626#[cfg(feature = "debug")]
627impl core::fmt::Debug for R {
628 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
629 f.debug_struct("GCR")
630 .field("dacen", &self.dacen())
631 .field("dacrfs", &self.dacrfs())
632 .field("fifoen", &self.fifoen())
633 .field("swmd", &self.swmd())
634 .field("trgsel", &self.trgsel())
635 .field("ptgen", &self.ptgen())
636 .field("latch_cyc", &self.latch_cyc())
637 .field("buf_en", &self.buf_en())
638 .field("iref_ptat_ext_sel", &self.iref_ptat_ext_sel())
639 .field("iref_ztc_ext_sel", &self.iref_ztc_ext_sel())
640 .field("buf_spd_ctrl", &self.buf_spd_ctrl())
641 .finish()
642 }
643}
644impl W {
645 #[doc = "Bit 0 - DAC Enable"]
646 #[inline(always)]
647 pub fn dacen(&mut self) -> DacenW<'_, GcrSpec> {
648 DacenW::new(self, 0)
649 }
650 #[doc = "Bits 1:2 - DAC Reference Select"]
651 #[inline(always)]
652 pub fn dacrfs(&mut self) -> DacrfsW<'_, GcrSpec> {
653 DacrfsW::new(self, 1)
654 }
655 #[doc = "Bit 3 - FIFO Enable"]
656 #[inline(always)]
657 pub fn fifoen(&mut self) -> FifoenW<'_, GcrSpec> {
658 FifoenW::new(self, 3)
659 }
660 #[doc = "Bit 4 - Swing Back Mode"]
661 #[inline(always)]
662 pub fn swmd(&mut self) -> SwmdW<'_, GcrSpec> {
663 SwmdW::new(self, 4)
664 }
665 #[doc = "Bit 5 - DAC Trigger Select"]
666 #[inline(always)]
667 pub fn trgsel(&mut self) -> TrgselW<'_, GcrSpec> {
668 TrgselW::new(self, 5)
669 }
670 #[doc = "Bit 6 - DAC Periodic Trigger Mode Enable"]
671 #[inline(always)]
672 pub fn ptgen(&mut self) -> PtgenW<'_, GcrSpec> {
673 PtgenW::new(self, 6)
674 }
675 #[doc = "Bits 8:11 - RCLK Cycles Before Data Latch"]
676 #[inline(always)]
677 pub fn latch_cyc(&mut self) -> LatchCycW<'_, GcrSpec> {
678 LatchCycW::new(self, 8)
679 }
680 #[doc = "Bit 17 - Buffer Enable"]
681 #[inline(always)]
682 pub fn buf_en(&mut self) -> BufEnW<'_, GcrSpec> {
683 BufEnW::new(self, 17)
684 }
685 #[doc = "Bit 20 - External On-Chip PTAT Current Reference Select"]
686 #[inline(always)]
687 pub fn iref_ptat_ext_sel(&mut self) -> IrefPtatExtSelW<'_, GcrSpec> {
688 IrefPtatExtSelW::new(self, 20)
689 }
690 #[doc = "Bit 21 - External On-Chip ZTC Current Reference Select"]
691 #[inline(always)]
692 pub fn iref_ztc_ext_sel(&mut self) -> IrefZtcExtSelW<'_, GcrSpec> {
693 IrefZtcExtSelW::new(self, 21)
694 }
695 #[doc = "Bit 23 - OPAMP as Buffer, Speed Control Signal"]
696 #[inline(always)]
697 pub fn buf_spd_ctrl(&mut self) -> BufSpdCtrlW<'_, GcrSpec> {
698 BufSpdCtrlW::new(self, 23)
699 }
700}
701#[doc = "Global Control\n\nYou can [`read`](crate::Reg::read) this register and get [`gcr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gcr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
702pub struct GcrSpec;
703impl crate::RegisterSpec for GcrSpec {
704 type Ux = u32;
705}
706#[doc = "`read()` method returns [`gcr::R`](R) reader structure"]
707impl crate::Readable for GcrSpec {}
708#[doc = "`write(|w| ..)` method takes [`gcr::W`](W) writer structure"]
709impl crate::Writable for GcrSpec {
710 type Safety = crate::Unsafe;
711}
712#[doc = "`reset()` method sets GCR to value 0x0100"]
713impl crate::Resettable for GcrSpec {
714 const RESET_VALUE: u32 = 0x0100;
715}