atsamd51p/adc0/
dseqctrl.rs

1#[doc = "Register `DSEQCTRL` reader"]
2pub type R = crate::R<DseqctrlSpec>;
3#[doc = "Register `DSEQCTRL` writer"]
4pub type W = crate::W<DseqctrlSpec>;
5#[doc = "Field `INPUTCTRL` reader - Input Control"]
6pub type InputctrlR = crate::BitReader;
7#[doc = "Field `INPUTCTRL` writer - Input Control"]
8pub type InputctrlW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CTRLB` reader - Control B"]
10pub type CtrlbR = crate::BitReader;
11#[doc = "Field `CTRLB` writer - Control B"]
12pub type CtrlbW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `REFCTRL` reader - Reference Control"]
14pub type RefctrlR = crate::BitReader;
15#[doc = "Field `REFCTRL` writer - Reference Control"]
16pub type RefctrlW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `AVGCTRL` reader - Average Control"]
18pub type AvgctrlR = crate::BitReader;
19#[doc = "Field `AVGCTRL` writer - Average Control"]
20pub type AvgctrlW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SAMPCTRL` reader - Sampling Time Control"]
22pub type SampctrlR = crate::BitReader;
23#[doc = "Field `SAMPCTRL` writer - Sampling Time Control"]
24pub type SampctrlW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `WINLT` reader - Window Monitor Lower Threshold"]
26pub type WinltR = crate::BitReader;
27#[doc = "Field `WINLT` writer - Window Monitor Lower Threshold"]
28pub type WinltW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `WINUT` reader - Window Monitor Upper Threshold"]
30pub type WinutR = crate::BitReader;
31#[doc = "Field `WINUT` writer - Window Monitor Upper Threshold"]
32pub type WinutW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `GAINCORR` reader - Gain Correction"]
34pub type GaincorrR = crate::BitReader;
35#[doc = "Field `GAINCORR` writer - Gain Correction"]
36pub type GaincorrW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `OFFSETCORR` reader - Offset Correction"]
38pub type OffsetcorrR = crate::BitReader;
39#[doc = "Field `OFFSETCORR` writer - Offset Correction"]
40pub type OffsetcorrW<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `AUTOSTART` reader - ADC Auto-Start Conversion"]
42pub type AutostartR = crate::BitReader;
43#[doc = "Field `AUTOSTART` writer - ADC Auto-Start Conversion"]
44pub type AutostartW<'a, REG> = crate::BitWriter<'a, REG>;
45impl R {
46    #[doc = "Bit 0 - Input Control"]
47    #[inline(always)]
48    pub fn inputctrl(&self) -> InputctrlR {
49        InputctrlR::new((self.bits & 1) != 0)
50    }
51    #[doc = "Bit 1 - Control B"]
52    #[inline(always)]
53    pub fn ctrlb(&self) -> CtrlbR {
54        CtrlbR::new(((self.bits >> 1) & 1) != 0)
55    }
56    #[doc = "Bit 2 - Reference Control"]
57    #[inline(always)]
58    pub fn refctrl(&self) -> RefctrlR {
59        RefctrlR::new(((self.bits >> 2) & 1) != 0)
60    }
61    #[doc = "Bit 3 - Average Control"]
62    #[inline(always)]
63    pub fn avgctrl(&self) -> AvgctrlR {
64        AvgctrlR::new(((self.bits >> 3) & 1) != 0)
65    }
66    #[doc = "Bit 4 - Sampling Time Control"]
67    #[inline(always)]
68    pub fn sampctrl(&self) -> SampctrlR {
69        SampctrlR::new(((self.bits >> 4) & 1) != 0)
70    }
71    #[doc = "Bit 5 - Window Monitor Lower Threshold"]
72    #[inline(always)]
73    pub fn winlt(&self) -> WinltR {
74        WinltR::new(((self.bits >> 5) & 1) != 0)
75    }
76    #[doc = "Bit 6 - Window Monitor Upper Threshold"]
77    #[inline(always)]
78    pub fn winut(&self) -> WinutR {
79        WinutR::new(((self.bits >> 6) & 1) != 0)
80    }
81    #[doc = "Bit 7 - Gain Correction"]
82    #[inline(always)]
83    pub fn gaincorr(&self) -> GaincorrR {
84        GaincorrR::new(((self.bits >> 7) & 1) != 0)
85    }
86    #[doc = "Bit 8 - Offset Correction"]
87    #[inline(always)]
88    pub fn offsetcorr(&self) -> OffsetcorrR {
89        OffsetcorrR::new(((self.bits >> 8) & 1) != 0)
90    }
91    #[doc = "Bit 31 - ADC Auto-Start Conversion"]
92    #[inline(always)]
93    pub fn autostart(&self) -> AutostartR {
94        AutostartR::new(((self.bits >> 31) & 1) != 0)
95    }
96}
97impl W {
98    #[doc = "Bit 0 - Input Control"]
99    #[inline(always)]
100    #[must_use]
101    pub fn inputctrl(&mut self) -> InputctrlW<DseqctrlSpec> {
102        InputctrlW::new(self, 0)
103    }
104    #[doc = "Bit 1 - Control B"]
105    #[inline(always)]
106    #[must_use]
107    pub fn ctrlb(&mut self) -> CtrlbW<DseqctrlSpec> {
108        CtrlbW::new(self, 1)
109    }
110    #[doc = "Bit 2 - Reference Control"]
111    #[inline(always)]
112    #[must_use]
113    pub fn refctrl(&mut self) -> RefctrlW<DseqctrlSpec> {
114        RefctrlW::new(self, 2)
115    }
116    #[doc = "Bit 3 - Average Control"]
117    #[inline(always)]
118    #[must_use]
119    pub fn avgctrl(&mut self) -> AvgctrlW<DseqctrlSpec> {
120        AvgctrlW::new(self, 3)
121    }
122    #[doc = "Bit 4 - Sampling Time Control"]
123    #[inline(always)]
124    #[must_use]
125    pub fn sampctrl(&mut self) -> SampctrlW<DseqctrlSpec> {
126        SampctrlW::new(self, 4)
127    }
128    #[doc = "Bit 5 - Window Monitor Lower Threshold"]
129    #[inline(always)]
130    #[must_use]
131    pub fn winlt(&mut self) -> WinltW<DseqctrlSpec> {
132        WinltW::new(self, 5)
133    }
134    #[doc = "Bit 6 - Window Monitor Upper Threshold"]
135    #[inline(always)]
136    #[must_use]
137    pub fn winut(&mut self) -> WinutW<DseqctrlSpec> {
138        WinutW::new(self, 6)
139    }
140    #[doc = "Bit 7 - Gain Correction"]
141    #[inline(always)]
142    #[must_use]
143    pub fn gaincorr(&mut self) -> GaincorrW<DseqctrlSpec> {
144        GaincorrW::new(self, 7)
145    }
146    #[doc = "Bit 8 - Offset Correction"]
147    #[inline(always)]
148    #[must_use]
149    pub fn offsetcorr(&mut self) -> OffsetcorrW<DseqctrlSpec> {
150        OffsetcorrW::new(self, 8)
151    }
152    #[doc = "Bit 31 - ADC Auto-Start Conversion"]
153    #[inline(always)]
154    #[must_use]
155    pub fn autostart(&mut self) -> AutostartW<DseqctrlSpec> {
156        AutostartW::new(self, 31)
157    }
158}
159#[doc = "DMA Sequential Control\n\nYou can [`read`](crate::Reg::read) this register and get [`dseqctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dseqctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
160pub struct DseqctrlSpec;
161impl crate::RegisterSpec for DseqctrlSpec {
162    type Ux = u32;
163}
164#[doc = "`read()` method returns [`dseqctrl::R`](R) reader structure"]
165impl crate::Readable for DseqctrlSpec {}
166#[doc = "`write(|w| ..)` method takes [`dseqctrl::W`](W) writer structure"]
167impl crate::Writable for DseqctrlSpec {
168    type Safety = crate::Unsafe;
169    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
170    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
171}
172#[doc = "`reset()` method sets DSEQCTRL to value 0"]
173impl crate::Resettable for DseqctrlSpec {
174    const RESET_VALUE: u32 = 0;
175}