atsam4e8c_pac/afec0/
cdor.rs

1#[doc = "Register `CDOR` reader"]
2pub struct R(crate::R<CDOR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CDOR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CDOR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CDOR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CDOR` writer"]
17pub struct W(crate::W<CDOR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CDOR_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<CDOR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CDOR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `OFF0` reader - Offset for Channel 0, used in Automatic Calibration Procedure"]
38pub type OFF0_R = crate::BitReader<bool>;
39#[doc = "Field `OFF0` writer - Offset for Channel 0, used in Automatic Calibration Procedure"]
40pub type OFF0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
41#[doc = "Field `OFF1` reader - Offset for Channel 1, used in Automatic Calibration Procedure"]
42pub type OFF1_R = crate::BitReader<bool>;
43#[doc = "Field `OFF1` writer - Offset for Channel 1, used in Automatic Calibration Procedure"]
44pub type OFF1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
45#[doc = "Field `OFF2` reader - Offset for Channel 2, used in Automatic Calibration Procedure"]
46pub type OFF2_R = crate::BitReader<bool>;
47#[doc = "Field `OFF2` writer - Offset for Channel 2, used in Automatic Calibration Procedure"]
48pub type OFF2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
49#[doc = "Field `OFF3` reader - Offset for Channel 3, used in Automatic Calibration Procedure"]
50pub type OFF3_R = crate::BitReader<bool>;
51#[doc = "Field `OFF3` writer - Offset for Channel 3, used in Automatic Calibration Procedure"]
52pub type OFF3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
53#[doc = "Field `OFF4` reader - Offset for Channel 4, used in Automatic Calibration Procedure"]
54pub type OFF4_R = crate::BitReader<bool>;
55#[doc = "Field `OFF4` writer - Offset for Channel 4, used in Automatic Calibration Procedure"]
56pub type OFF4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
57#[doc = "Field `OFF5` reader - Offset for Channel 5, used in Automatic Calibration Procedure"]
58pub type OFF5_R = crate::BitReader<bool>;
59#[doc = "Field `OFF5` writer - Offset for Channel 5, used in Automatic Calibration Procedure"]
60pub type OFF5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
61#[doc = "Field `OFF6` reader - Offset for Channel 6, used in Automatic Calibration Procedure"]
62pub type OFF6_R = crate::BitReader<bool>;
63#[doc = "Field `OFF6` writer - Offset for Channel 6, used in Automatic Calibration Procedure"]
64pub type OFF6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
65#[doc = "Field `OFF7` reader - Offset for Channel 7, used in Automatic Calibration Procedure"]
66pub type OFF7_R = crate::BitReader<bool>;
67#[doc = "Field `OFF7` writer - Offset for Channel 7, used in Automatic Calibration Procedure"]
68pub type OFF7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
69#[doc = "Field `OFF8` reader - Offset for Channel 8, used in Automatic Calibration Procedure"]
70pub type OFF8_R = crate::BitReader<bool>;
71#[doc = "Field `OFF8` writer - Offset for Channel 8, used in Automatic Calibration Procedure"]
72pub type OFF8_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
73#[doc = "Field `OFF9` reader - Offset for Channel 9, used in Automatic Calibration Procedure"]
74pub type OFF9_R = crate::BitReader<bool>;
75#[doc = "Field `OFF9` writer - Offset for Channel 9, used in Automatic Calibration Procedure"]
76pub type OFF9_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
77#[doc = "Field `OFF10` reader - Offset for Channel 10, used in Automatic Calibration Procedure"]
78pub type OFF10_R = crate::BitReader<bool>;
79#[doc = "Field `OFF10` writer - Offset for Channel 10, used in Automatic Calibration Procedure"]
80pub type OFF10_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
81#[doc = "Field `OFF11` reader - Offset for Channel 11, used in Automatic Calibration Procedure"]
82pub type OFF11_R = crate::BitReader<bool>;
83#[doc = "Field `OFF11` writer - Offset for Channel 11, used in Automatic Calibration Procedure"]
84pub type OFF11_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
85#[doc = "Field `OFF12` reader - Offset for Channel 12, used in Automatic Calibration Procedure"]
86pub type OFF12_R = crate::BitReader<bool>;
87#[doc = "Field `OFF12` writer - Offset for Channel 12, used in Automatic Calibration Procedure"]
88pub type OFF12_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
89#[doc = "Field `OFF13` reader - Offset for Channel 13, used in Automatic Calibration Procedure"]
90pub type OFF13_R = crate::BitReader<bool>;
91#[doc = "Field `OFF13` writer - Offset for Channel 13, used in Automatic Calibration Procedure"]
92pub type OFF13_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
93#[doc = "Field `OFF14` reader - Offset for Channel 14, used in Automatic Calibration Procedure"]
94pub type OFF14_R = crate::BitReader<bool>;
95#[doc = "Field `OFF14` writer - Offset for Channel 14, used in Automatic Calibration Procedure"]
96pub type OFF14_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
97#[doc = "Field `OFF15` reader - Offset for Channel 15, used in Automatic Calibration Procedure"]
98pub type OFF15_R = crate::BitReader<bool>;
99#[doc = "Field `OFF15` writer - Offset for Channel 15, used in Automatic Calibration Procedure"]
100pub type OFF15_W<'a, const O: u8> = crate::BitWriter<'a, u32, CDOR_SPEC, bool, O>;
101impl R {
102    #[doc = "Bit 0 - Offset for Channel 0, used in Automatic Calibration Procedure"]
103    #[inline(always)]
104    pub fn off0(&self) -> OFF0_R {
105        OFF0_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - Offset for Channel 1, used in Automatic Calibration Procedure"]
108    #[inline(always)]
109    pub fn off1(&self) -> OFF1_R {
110        OFF1_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - Offset for Channel 2, used in Automatic Calibration Procedure"]
113    #[inline(always)]
114    pub fn off2(&self) -> OFF2_R {
115        OFF2_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - Offset for Channel 3, used in Automatic Calibration Procedure"]
118    #[inline(always)]
119    pub fn off3(&self) -> OFF3_R {
120        OFF3_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - Offset for Channel 4, used in Automatic Calibration Procedure"]
123    #[inline(always)]
124    pub fn off4(&self) -> OFF4_R {
125        OFF4_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 5 - Offset for Channel 5, used in Automatic Calibration Procedure"]
128    #[inline(always)]
129    pub fn off5(&self) -> OFF5_R {
130        OFF5_R::new(((self.bits >> 5) & 1) != 0)
131    }
132    #[doc = "Bit 6 - Offset for Channel 6, used in Automatic Calibration Procedure"]
133    #[inline(always)]
134    pub fn off6(&self) -> OFF6_R {
135        OFF6_R::new(((self.bits >> 6) & 1) != 0)
136    }
137    #[doc = "Bit 7 - Offset for Channel 7, used in Automatic Calibration Procedure"]
138    #[inline(always)]
139    pub fn off7(&self) -> OFF7_R {
140        OFF7_R::new(((self.bits >> 7) & 1) != 0)
141    }
142    #[doc = "Bit 8 - Offset for Channel 8, used in Automatic Calibration Procedure"]
143    #[inline(always)]
144    pub fn off8(&self) -> OFF8_R {
145        OFF8_R::new(((self.bits >> 8) & 1) != 0)
146    }
147    #[doc = "Bit 9 - Offset for Channel 9, used in Automatic Calibration Procedure"]
148    #[inline(always)]
149    pub fn off9(&self) -> OFF9_R {
150        OFF9_R::new(((self.bits >> 9) & 1) != 0)
151    }
152    #[doc = "Bit 10 - Offset for Channel 10, used in Automatic Calibration Procedure"]
153    #[inline(always)]
154    pub fn off10(&self) -> OFF10_R {
155        OFF10_R::new(((self.bits >> 10) & 1) != 0)
156    }
157    #[doc = "Bit 11 - Offset for Channel 11, used in Automatic Calibration Procedure"]
158    #[inline(always)]
159    pub fn off11(&self) -> OFF11_R {
160        OFF11_R::new(((self.bits >> 11) & 1) != 0)
161    }
162    #[doc = "Bit 12 - Offset for Channel 12, used in Automatic Calibration Procedure"]
163    #[inline(always)]
164    pub fn off12(&self) -> OFF12_R {
165        OFF12_R::new(((self.bits >> 12) & 1) != 0)
166    }
167    #[doc = "Bit 13 - Offset for Channel 13, used in Automatic Calibration Procedure"]
168    #[inline(always)]
169    pub fn off13(&self) -> OFF13_R {
170        OFF13_R::new(((self.bits >> 13) & 1) != 0)
171    }
172    #[doc = "Bit 14 - Offset for Channel 14, used in Automatic Calibration Procedure"]
173    #[inline(always)]
174    pub fn off14(&self) -> OFF14_R {
175        OFF14_R::new(((self.bits >> 14) & 1) != 0)
176    }
177    #[doc = "Bit 15 - Offset for Channel 15, used in Automatic Calibration Procedure"]
178    #[inline(always)]
179    pub fn off15(&self) -> OFF15_R {
180        OFF15_R::new(((self.bits >> 15) & 1) != 0)
181    }
182}
183impl W {
184    #[doc = "Bit 0 - Offset for Channel 0, used in Automatic Calibration Procedure"]
185    #[inline(always)]
186    #[must_use]
187    pub fn off0(&mut self) -> OFF0_W<0> {
188        OFF0_W::new(self)
189    }
190    #[doc = "Bit 1 - Offset for Channel 1, used in Automatic Calibration Procedure"]
191    #[inline(always)]
192    #[must_use]
193    pub fn off1(&mut self) -> OFF1_W<1> {
194        OFF1_W::new(self)
195    }
196    #[doc = "Bit 2 - Offset for Channel 2, used in Automatic Calibration Procedure"]
197    #[inline(always)]
198    #[must_use]
199    pub fn off2(&mut self) -> OFF2_W<2> {
200        OFF2_W::new(self)
201    }
202    #[doc = "Bit 3 - Offset for Channel 3, used in Automatic Calibration Procedure"]
203    #[inline(always)]
204    #[must_use]
205    pub fn off3(&mut self) -> OFF3_W<3> {
206        OFF3_W::new(self)
207    }
208    #[doc = "Bit 4 - Offset for Channel 4, used in Automatic Calibration Procedure"]
209    #[inline(always)]
210    #[must_use]
211    pub fn off4(&mut self) -> OFF4_W<4> {
212        OFF4_W::new(self)
213    }
214    #[doc = "Bit 5 - Offset for Channel 5, used in Automatic Calibration Procedure"]
215    #[inline(always)]
216    #[must_use]
217    pub fn off5(&mut self) -> OFF5_W<5> {
218        OFF5_W::new(self)
219    }
220    #[doc = "Bit 6 - Offset for Channel 6, used in Automatic Calibration Procedure"]
221    #[inline(always)]
222    #[must_use]
223    pub fn off6(&mut self) -> OFF6_W<6> {
224        OFF6_W::new(self)
225    }
226    #[doc = "Bit 7 - Offset for Channel 7, used in Automatic Calibration Procedure"]
227    #[inline(always)]
228    #[must_use]
229    pub fn off7(&mut self) -> OFF7_W<7> {
230        OFF7_W::new(self)
231    }
232    #[doc = "Bit 8 - Offset for Channel 8, used in Automatic Calibration Procedure"]
233    #[inline(always)]
234    #[must_use]
235    pub fn off8(&mut self) -> OFF8_W<8> {
236        OFF8_W::new(self)
237    }
238    #[doc = "Bit 9 - Offset for Channel 9, used in Automatic Calibration Procedure"]
239    #[inline(always)]
240    #[must_use]
241    pub fn off9(&mut self) -> OFF9_W<9> {
242        OFF9_W::new(self)
243    }
244    #[doc = "Bit 10 - Offset for Channel 10, used in Automatic Calibration Procedure"]
245    #[inline(always)]
246    #[must_use]
247    pub fn off10(&mut self) -> OFF10_W<10> {
248        OFF10_W::new(self)
249    }
250    #[doc = "Bit 11 - Offset for Channel 11, used in Automatic Calibration Procedure"]
251    #[inline(always)]
252    #[must_use]
253    pub fn off11(&mut self) -> OFF11_W<11> {
254        OFF11_W::new(self)
255    }
256    #[doc = "Bit 12 - Offset for Channel 12, used in Automatic Calibration Procedure"]
257    #[inline(always)]
258    #[must_use]
259    pub fn off12(&mut self) -> OFF12_W<12> {
260        OFF12_W::new(self)
261    }
262    #[doc = "Bit 13 - Offset for Channel 13, used in Automatic Calibration Procedure"]
263    #[inline(always)]
264    #[must_use]
265    pub fn off13(&mut self) -> OFF13_W<13> {
266        OFF13_W::new(self)
267    }
268    #[doc = "Bit 14 - Offset for Channel 14, used in Automatic Calibration Procedure"]
269    #[inline(always)]
270    #[must_use]
271    pub fn off14(&mut self) -> OFF14_W<14> {
272        OFF14_W::new(self)
273    }
274    #[doc = "Bit 15 - Offset for Channel 15, used in Automatic Calibration Procedure"]
275    #[inline(always)]
276    #[must_use]
277    pub fn off15(&mut self) -> OFF15_W<15> {
278        OFF15_W::new(self)
279    }
280    #[doc = "Writes raw bits to the register."]
281    #[inline(always)]
282    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
283        self.0.bits(bits);
284        self
285    }
286}
287#[doc = "AFEC Channel Calibration DC Offset 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 [cdor](index.html) module"]
288pub struct CDOR_SPEC;
289impl crate::RegisterSpec for CDOR_SPEC {
290    type Ux = u32;
291}
292#[doc = "`read()` method returns [cdor::R](R) reader structure"]
293impl crate::Readable for CDOR_SPEC {
294    type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [cdor::W](W) writer structure"]
297impl crate::Writable for CDOR_SPEC {
298    type Writer = W;
299    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
300    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
301}
302#[doc = "`reset()` method sets CDOR to value 0"]
303impl crate::Resettable for CDOR_SPEC {
304    const RESET_VALUE: Self::Ux = 0;
305}