efm32jg12b_pac/efm32jg12b500/idac0/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL_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<CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `EN` reader - Current DAC Enable"]
38pub type EN_R = crate::BitReader<bool>;
39#[doc = "Field `EN` writer - Current DAC Enable"]
40pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
41#[doc = "Field `CURSINK` reader - Current Sink Enable"]
42pub type CURSINK_R = crate::BitReader<bool>;
43#[doc = "Field `CURSINK` writer - Current Sink Enable"]
44pub type CURSINK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
45#[doc = "Field `MINOUTTRANS` reader - Minimum Output Transition Enable"]
46pub type MINOUTTRANS_R = crate::BitReader<bool>;
47#[doc = "Field `MINOUTTRANS` writer - Minimum Output Transition Enable"]
48pub type MINOUTTRANS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
49#[doc = "Field `APORTOUTEN` reader - APORT Output Enable"]
50pub type APORTOUTEN_R = crate::BitReader<bool>;
51#[doc = "Field `APORTOUTEN` writer - APORT Output Enable"]
52pub type APORTOUTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
53#[doc = "Field `APORTOUTSEL` reader - APORT Output Select"]
54pub type APORTOUTSEL_R = crate::FieldReader<u8, APORTOUTSEL_A>;
55#[doc = "APORT Output Select\n\nValue on reset: 0"]
56#[derive(Clone, Copy, Debug, PartialEq, Eq)]
57#[repr(u8)]
58pub enum APORTOUTSEL_A {
59    #[doc = "32: APORT1X Channel 0"]
60    APORT1XCH0 = 32,
61    #[doc = "33: APORT1Y Channel 1"]
62    APORT1YCH1 = 33,
63    #[doc = "34: APORT1X Channel 2"]
64    APORT1XCH2 = 34,
65    #[doc = "35: APORT1Y Channel 3"]
66    APORT1YCH3 = 35,
67    #[doc = "36: APORT1X Channel 4"]
68    APORT1XCH4 = 36,
69    #[doc = "37: APORT1Y Channel 5"]
70    APORT1YCH5 = 37,
71    #[doc = "38: APORT1X Channel 6"]
72    APORT1XCH6 = 38,
73    #[doc = "39: APORT1Y Channel 7"]
74    APORT1YCH7 = 39,
75    #[doc = "40: APORT1X Channel 8"]
76    APORT1XCH8 = 40,
77    #[doc = "41: APORT1Y Channel 9"]
78    APORT1YCH9 = 41,
79    #[doc = "42: APORT1X Channel 10"]
80    APORT1XCH10 = 42,
81    #[doc = "43: APORT1Y Channel 11"]
82    APORT1YCH11 = 43,
83    #[doc = "44: APORT1X Channel 12"]
84    APORT1XCH12 = 44,
85    #[doc = "45: APORT1Y Channel 13"]
86    APORT1YCH13 = 45,
87    #[doc = "46: APORT1X Channel 14"]
88    APORT1XCH14 = 46,
89    #[doc = "47: APORT1Y Channel 15"]
90    APORT1YCH15 = 47,
91    #[doc = "48: APORT1X Channel 16"]
92    APORT1XCH16 = 48,
93    #[doc = "49: APORT1Y Channel 17"]
94    APORT1YCH17 = 49,
95    #[doc = "50: APORT1X Channel 18"]
96    APORT1XCH18 = 50,
97    #[doc = "51: APORT1Y Channel 19"]
98    APORT1YCH19 = 51,
99    #[doc = "52: APORT1X Channel 20"]
100    APORT1XCH20 = 52,
101    #[doc = "53: APORT1Y Channel 21"]
102    APORT1YCH21 = 53,
103    #[doc = "54: APORT1X Channel 22"]
104    APORT1XCH22 = 54,
105    #[doc = "55: APORT1Y Channel 23"]
106    APORT1YCH23 = 55,
107    #[doc = "56: APORT1X Channel 24"]
108    APORT1XCH24 = 56,
109    #[doc = "57: APORT1Y Channel 25"]
110    APORT1YCH25 = 57,
111    #[doc = "58: APORT1X Channel 26"]
112    APORT1XCH26 = 58,
113    #[doc = "59: APORT1Y Channel 27"]
114    APORT1YCH27 = 59,
115    #[doc = "60: APORT1X Channel 28"]
116    APORT1XCH28 = 60,
117    #[doc = "61: APORT1Y Channel 29"]
118    APORT1YCH29 = 61,
119    #[doc = "62: APORT1X Channel 30"]
120    APORT1XCH30 = 62,
121    #[doc = "63: APORT1Y Channel 31"]
122    APORT1YCH31 = 63,
123}
124impl From<APORTOUTSEL_A> for u8 {
125    #[inline(always)]
126    fn from(variant: APORTOUTSEL_A) -> Self {
127        variant as _
128    }
129}
130impl APORTOUTSEL_R {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub fn variant(&self) -> Option<APORTOUTSEL_A> {
134        match self.bits {
135            32 => Some(APORTOUTSEL_A::APORT1XCH0),
136            33 => Some(APORTOUTSEL_A::APORT1YCH1),
137            34 => Some(APORTOUTSEL_A::APORT1XCH2),
138            35 => Some(APORTOUTSEL_A::APORT1YCH3),
139            36 => Some(APORTOUTSEL_A::APORT1XCH4),
140            37 => Some(APORTOUTSEL_A::APORT1YCH5),
141            38 => Some(APORTOUTSEL_A::APORT1XCH6),
142            39 => Some(APORTOUTSEL_A::APORT1YCH7),
143            40 => Some(APORTOUTSEL_A::APORT1XCH8),
144            41 => Some(APORTOUTSEL_A::APORT1YCH9),
145            42 => Some(APORTOUTSEL_A::APORT1XCH10),
146            43 => Some(APORTOUTSEL_A::APORT1YCH11),
147            44 => Some(APORTOUTSEL_A::APORT1XCH12),
148            45 => Some(APORTOUTSEL_A::APORT1YCH13),
149            46 => Some(APORTOUTSEL_A::APORT1XCH14),
150            47 => Some(APORTOUTSEL_A::APORT1YCH15),
151            48 => Some(APORTOUTSEL_A::APORT1XCH16),
152            49 => Some(APORTOUTSEL_A::APORT1YCH17),
153            50 => Some(APORTOUTSEL_A::APORT1XCH18),
154            51 => Some(APORTOUTSEL_A::APORT1YCH19),
155            52 => Some(APORTOUTSEL_A::APORT1XCH20),
156            53 => Some(APORTOUTSEL_A::APORT1YCH21),
157            54 => Some(APORTOUTSEL_A::APORT1XCH22),
158            55 => Some(APORTOUTSEL_A::APORT1YCH23),
159            56 => Some(APORTOUTSEL_A::APORT1XCH24),
160            57 => Some(APORTOUTSEL_A::APORT1YCH25),
161            58 => Some(APORTOUTSEL_A::APORT1XCH26),
162            59 => Some(APORTOUTSEL_A::APORT1YCH27),
163            60 => Some(APORTOUTSEL_A::APORT1XCH28),
164            61 => Some(APORTOUTSEL_A::APORT1YCH29),
165            62 => Some(APORTOUTSEL_A::APORT1XCH30),
166            63 => Some(APORTOUTSEL_A::APORT1YCH31),
167            _ => None,
168        }
169    }
170    #[doc = "Checks if the value of the field is `APORT1XCH0`"]
171    #[inline(always)]
172    pub fn is_aport1xch0(&self) -> bool {
173        *self == APORTOUTSEL_A::APORT1XCH0
174    }
175    #[doc = "Checks if the value of the field is `APORT1YCH1`"]
176    #[inline(always)]
177    pub fn is_aport1ych1(&self) -> bool {
178        *self == APORTOUTSEL_A::APORT1YCH1
179    }
180    #[doc = "Checks if the value of the field is `APORT1XCH2`"]
181    #[inline(always)]
182    pub fn is_aport1xch2(&self) -> bool {
183        *self == APORTOUTSEL_A::APORT1XCH2
184    }
185    #[doc = "Checks if the value of the field is `APORT1YCH3`"]
186    #[inline(always)]
187    pub fn is_aport1ych3(&self) -> bool {
188        *self == APORTOUTSEL_A::APORT1YCH3
189    }
190    #[doc = "Checks if the value of the field is `APORT1XCH4`"]
191    #[inline(always)]
192    pub fn is_aport1xch4(&self) -> bool {
193        *self == APORTOUTSEL_A::APORT1XCH4
194    }
195    #[doc = "Checks if the value of the field is `APORT1YCH5`"]
196    #[inline(always)]
197    pub fn is_aport1ych5(&self) -> bool {
198        *self == APORTOUTSEL_A::APORT1YCH5
199    }
200    #[doc = "Checks if the value of the field is `APORT1XCH6`"]
201    #[inline(always)]
202    pub fn is_aport1xch6(&self) -> bool {
203        *self == APORTOUTSEL_A::APORT1XCH6
204    }
205    #[doc = "Checks if the value of the field is `APORT1YCH7`"]
206    #[inline(always)]
207    pub fn is_aport1ych7(&self) -> bool {
208        *self == APORTOUTSEL_A::APORT1YCH7
209    }
210    #[doc = "Checks if the value of the field is `APORT1XCH8`"]
211    #[inline(always)]
212    pub fn is_aport1xch8(&self) -> bool {
213        *self == APORTOUTSEL_A::APORT1XCH8
214    }
215    #[doc = "Checks if the value of the field is `APORT1YCH9`"]
216    #[inline(always)]
217    pub fn is_aport1ych9(&self) -> bool {
218        *self == APORTOUTSEL_A::APORT1YCH9
219    }
220    #[doc = "Checks if the value of the field is `APORT1XCH10`"]
221    #[inline(always)]
222    pub fn is_aport1xch10(&self) -> bool {
223        *self == APORTOUTSEL_A::APORT1XCH10
224    }
225    #[doc = "Checks if the value of the field is `APORT1YCH11`"]
226    #[inline(always)]
227    pub fn is_aport1ych11(&self) -> bool {
228        *self == APORTOUTSEL_A::APORT1YCH11
229    }
230    #[doc = "Checks if the value of the field is `APORT1XCH12`"]
231    #[inline(always)]
232    pub fn is_aport1xch12(&self) -> bool {
233        *self == APORTOUTSEL_A::APORT1XCH12
234    }
235    #[doc = "Checks if the value of the field is `APORT1YCH13`"]
236    #[inline(always)]
237    pub fn is_aport1ych13(&self) -> bool {
238        *self == APORTOUTSEL_A::APORT1YCH13
239    }
240    #[doc = "Checks if the value of the field is `APORT1XCH14`"]
241    #[inline(always)]
242    pub fn is_aport1xch14(&self) -> bool {
243        *self == APORTOUTSEL_A::APORT1XCH14
244    }
245    #[doc = "Checks if the value of the field is `APORT1YCH15`"]
246    #[inline(always)]
247    pub fn is_aport1ych15(&self) -> bool {
248        *self == APORTOUTSEL_A::APORT1YCH15
249    }
250    #[doc = "Checks if the value of the field is `APORT1XCH16`"]
251    #[inline(always)]
252    pub fn is_aport1xch16(&self) -> bool {
253        *self == APORTOUTSEL_A::APORT1XCH16
254    }
255    #[doc = "Checks if the value of the field is `APORT1YCH17`"]
256    #[inline(always)]
257    pub fn is_aport1ych17(&self) -> bool {
258        *self == APORTOUTSEL_A::APORT1YCH17
259    }
260    #[doc = "Checks if the value of the field is `APORT1XCH18`"]
261    #[inline(always)]
262    pub fn is_aport1xch18(&self) -> bool {
263        *self == APORTOUTSEL_A::APORT1XCH18
264    }
265    #[doc = "Checks if the value of the field is `APORT1YCH19`"]
266    #[inline(always)]
267    pub fn is_aport1ych19(&self) -> bool {
268        *self == APORTOUTSEL_A::APORT1YCH19
269    }
270    #[doc = "Checks if the value of the field is `APORT1XCH20`"]
271    #[inline(always)]
272    pub fn is_aport1xch20(&self) -> bool {
273        *self == APORTOUTSEL_A::APORT1XCH20
274    }
275    #[doc = "Checks if the value of the field is `APORT1YCH21`"]
276    #[inline(always)]
277    pub fn is_aport1ych21(&self) -> bool {
278        *self == APORTOUTSEL_A::APORT1YCH21
279    }
280    #[doc = "Checks if the value of the field is `APORT1XCH22`"]
281    #[inline(always)]
282    pub fn is_aport1xch22(&self) -> bool {
283        *self == APORTOUTSEL_A::APORT1XCH22
284    }
285    #[doc = "Checks if the value of the field is `APORT1YCH23`"]
286    #[inline(always)]
287    pub fn is_aport1ych23(&self) -> bool {
288        *self == APORTOUTSEL_A::APORT1YCH23
289    }
290    #[doc = "Checks if the value of the field is `APORT1XCH24`"]
291    #[inline(always)]
292    pub fn is_aport1xch24(&self) -> bool {
293        *self == APORTOUTSEL_A::APORT1XCH24
294    }
295    #[doc = "Checks if the value of the field is `APORT1YCH25`"]
296    #[inline(always)]
297    pub fn is_aport1ych25(&self) -> bool {
298        *self == APORTOUTSEL_A::APORT1YCH25
299    }
300    #[doc = "Checks if the value of the field is `APORT1XCH26`"]
301    #[inline(always)]
302    pub fn is_aport1xch26(&self) -> bool {
303        *self == APORTOUTSEL_A::APORT1XCH26
304    }
305    #[doc = "Checks if the value of the field is `APORT1YCH27`"]
306    #[inline(always)]
307    pub fn is_aport1ych27(&self) -> bool {
308        *self == APORTOUTSEL_A::APORT1YCH27
309    }
310    #[doc = "Checks if the value of the field is `APORT1XCH28`"]
311    #[inline(always)]
312    pub fn is_aport1xch28(&self) -> bool {
313        *self == APORTOUTSEL_A::APORT1XCH28
314    }
315    #[doc = "Checks if the value of the field is `APORT1YCH29`"]
316    #[inline(always)]
317    pub fn is_aport1ych29(&self) -> bool {
318        *self == APORTOUTSEL_A::APORT1YCH29
319    }
320    #[doc = "Checks if the value of the field is `APORT1XCH30`"]
321    #[inline(always)]
322    pub fn is_aport1xch30(&self) -> bool {
323        *self == APORTOUTSEL_A::APORT1XCH30
324    }
325    #[doc = "Checks if the value of the field is `APORT1YCH31`"]
326    #[inline(always)]
327    pub fn is_aport1ych31(&self) -> bool {
328        *self == APORTOUTSEL_A::APORT1YCH31
329    }
330}
331#[doc = "Field `APORTOUTSEL` writer - APORT Output Select"]
332pub type APORTOUTSEL_W<'a, const O: u8> =
333    crate::FieldWriter<'a, u32, CTRL_SPEC, u8, APORTOUTSEL_A, 8, O>;
334impl<'a, const O: u8> APORTOUTSEL_W<'a, O> {
335    #[doc = "APORT1X Channel 0"]
336    #[inline(always)]
337    pub fn aport1xch0(self) -> &'a mut W {
338        self.variant(APORTOUTSEL_A::APORT1XCH0)
339    }
340    #[doc = "APORT1Y Channel 1"]
341    #[inline(always)]
342    pub fn aport1ych1(self) -> &'a mut W {
343        self.variant(APORTOUTSEL_A::APORT1YCH1)
344    }
345    #[doc = "APORT1X Channel 2"]
346    #[inline(always)]
347    pub fn aport1xch2(self) -> &'a mut W {
348        self.variant(APORTOUTSEL_A::APORT1XCH2)
349    }
350    #[doc = "APORT1Y Channel 3"]
351    #[inline(always)]
352    pub fn aport1ych3(self) -> &'a mut W {
353        self.variant(APORTOUTSEL_A::APORT1YCH3)
354    }
355    #[doc = "APORT1X Channel 4"]
356    #[inline(always)]
357    pub fn aport1xch4(self) -> &'a mut W {
358        self.variant(APORTOUTSEL_A::APORT1XCH4)
359    }
360    #[doc = "APORT1Y Channel 5"]
361    #[inline(always)]
362    pub fn aport1ych5(self) -> &'a mut W {
363        self.variant(APORTOUTSEL_A::APORT1YCH5)
364    }
365    #[doc = "APORT1X Channel 6"]
366    #[inline(always)]
367    pub fn aport1xch6(self) -> &'a mut W {
368        self.variant(APORTOUTSEL_A::APORT1XCH6)
369    }
370    #[doc = "APORT1Y Channel 7"]
371    #[inline(always)]
372    pub fn aport1ych7(self) -> &'a mut W {
373        self.variant(APORTOUTSEL_A::APORT1YCH7)
374    }
375    #[doc = "APORT1X Channel 8"]
376    #[inline(always)]
377    pub fn aport1xch8(self) -> &'a mut W {
378        self.variant(APORTOUTSEL_A::APORT1XCH8)
379    }
380    #[doc = "APORT1Y Channel 9"]
381    #[inline(always)]
382    pub fn aport1ych9(self) -> &'a mut W {
383        self.variant(APORTOUTSEL_A::APORT1YCH9)
384    }
385    #[doc = "APORT1X Channel 10"]
386    #[inline(always)]
387    pub fn aport1xch10(self) -> &'a mut W {
388        self.variant(APORTOUTSEL_A::APORT1XCH10)
389    }
390    #[doc = "APORT1Y Channel 11"]
391    #[inline(always)]
392    pub fn aport1ych11(self) -> &'a mut W {
393        self.variant(APORTOUTSEL_A::APORT1YCH11)
394    }
395    #[doc = "APORT1X Channel 12"]
396    #[inline(always)]
397    pub fn aport1xch12(self) -> &'a mut W {
398        self.variant(APORTOUTSEL_A::APORT1XCH12)
399    }
400    #[doc = "APORT1Y Channel 13"]
401    #[inline(always)]
402    pub fn aport1ych13(self) -> &'a mut W {
403        self.variant(APORTOUTSEL_A::APORT1YCH13)
404    }
405    #[doc = "APORT1X Channel 14"]
406    #[inline(always)]
407    pub fn aport1xch14(self) -> &'a mut W {
408        self.variant(APORTOUTSEL_A::APORT1XCH14)
409    }
410    #[doc = "APORT1Y Channel 15"]
411    #[inline(always)]
412    pub fn aport1ych15(self) -> &'a mut W {
413        self.variant(APORTOUTSEL_A::APORT1YCH15)
414    }
415    #[doc = "APORT1X Channel 16"]
416    #[inline(always)]
417    pub fn aport1xch16(self) -> &'a mut W {
418        self.variant(APORTOUTSEL_A::APORT1XCH16)
419    }
420    #[doc = "APORT1Y Channel 17"]
421    #[inline(always)]
422    pub fn aport1ych17(self) -> &'a mut W {
423        self.variant(APORTOUTSEL_A::APORT1YCH17)
424    }
425    #[doc = "APORT1X Channel 18"]
426    #[inline(always)]
427    pub fn aport1xch18(self) -> &'a mut W {
428        self.variant(APORTOUTSEL_A::APORT1XCH18)
429    }
430    #[doc = "APORT1Y Channel 19"]
431    #[inline(always)]
432    pub fn aport1ych19(self) -> &'a mut W {
433        self.variant(APORTOUTSEL_A::APORT1YCH19)
434    }
435    #[doc = "APORT1X Channel 20"]
436    #[inline(always)]
437    pub fn aport1xch20(self) -> &'a mut W {
438        self.variant(APORTOUTSEL_A::APORT1XCH20)
439    }
440    #[doc = "APORT1Y Channel 21"]
441    #[inline(always)]
442    pub fn aport1ych21(self) -> &'a mut W {
443        self.variant(APORTOUTSEL_A::APORT1YCH21)
444    }
445    #[doc = "APORT1X Channel 22"]
446    #[inline(always)]
447    pub fn aport1xch22(self) -> &'a mut W {
448        self.variant(APORTOUTSEL_A::APORT1XCH22)
449    }
450    #[doc = "APORT1Y Channel 23"]
451    #[inline(always)]
452    pub fn aport1ych23(self) -> &'a mut W {
453        self.variant(APORTOUTSEL_A::APORT1YCH23)
454    }
455    #[doc = "APORT1X Channel 24"]
456    #[inline(always)]
457    pub fn aport1xch24(self) -> &'a mut W {
458        self.variant(APORTOUTSEL_A::APORT1XCH24)
459    }
460    #[doc = "APORT1Y Channel 25"]
461    #[inline(always)]
462    pub fn aport1ych25(self) -> &'a mut W {
463        self.variant(APORTOUTSEL_A::APORT1YCH25)
464    }
465    #[doc = "APORT1X Channel 26"]
466    #[inline(always)]
467    pub fn aport1xch26(self) -> &'a mut W {
468        self.variant(APORTOUTSEL_A::APORT1XCH26)
469    }
470    #[doc = "APORT1Y Channel 27"]
471    #[inline(always)]
472    pub fn aport1ych27(self) -> &'a mut W {
473        self.variant(APORTOUTSEL_A::APORT1YCH27)
474    }
475    #[doc = "APORT1X Channel 28"]
476    #[inline(always)]
477    pub fn aport1xch28(self) -> &'a mut W {
478        self.variant(APORTOUTSEL_A::APORT1XCH28)
479    }
480    #[doc = "APORT1Y Channel 29"]
481    #[inline(always)]
482    pub fn aport1ych29(self) -> &'a mut W {
483        self.variant(APORTOUTSEL_A::APORT1YCH29)
484    }
485    #[doc = "APORT1X Channel 30"]
486    #[inline(always)]
487    pub fn aport1xch30(self) -> &'a mut W {
488        self.variant(APORTOUTSEL_A::APORT1XCH30)
489    }
490    #[doc = "APORT1Y Channel 31"]
491    #[inline(always)]
492    pub fn aport1ych31(self) -> &'a mut W {
493        self.variant(APORTOUTSEL_A::APORT1YCH31)
494    }
495}
496#[doc = "Field `PWRSEL` reader - Power Select"]
497pub type PWRSEL_R = crate::BitReader<bool>;
498#[doc = "Field `PWRSEL` writer - Power Select"]
499pub type PWRSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
500#[doc = "Field `EM2DELAY` reader - EM2 Delay"]
501pub type EM2DELAY_R = crate::BitReader<bool>;
502#[doc = "Field `EM2DELAY` writer - EM2 Delay"]
503pub type EM2DELAY_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
504#[doc = "Field `APORTMASTERDIS` reader - APORT Bus Master Disable"]
505pub type APORTMASTERDIS_R = crate::BitReader<bool>;
506#[doc = "Field `APORTMASTERDIS` writer - APORT Bus Master Disable"]
507pub type APORTMASTERDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
508#[doc = "Field `APORTOUTENPRS` reader - PRS Controlled APORT Output Enable"]
509pub type APORTOUTENPRS_R = crate::BitReader<bool>;
510#[doc = "Field `APORTOUTENPRS` writer - PRS Controlled APORT Output Enable"]
511pub type APORTOUTENPRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
512#[doc = "Field `MAINOUTEN` reader - Output Enable"]
513pub type MAINOUTEN_R = crate::BitReader<bool>;
514#[doc = "Field `MAINOUTEN` writer - Output Enable"]
515pub type MAINOUTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
516#[doc = "Field `MAINOUTENPRS` reader - PRS Controlled Main Pad Output Enable"]
517pub type MAINOUTENPRS_R = crate::BitReader<bool>;
518#[doc = "Field `MAINOUTENPRS` writer - PRS Controlled Main Pad Output Enable"]
519pub type MAINOUTENPRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
520#[doc = "Field `PRSSEL` reader - IDAC Output Enable PRS Channel Select"]
521pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
522#[doc = "IDAC Output Enable PRS Channel Select\n\nValue on reset: 0"]
523#[derive(Clone, Copy, Debug, PartialEq, Eq)]
524#[repr(u8)]
525pub enum PRSSEL_A {
526    #[doc = "0: PRS Channel 0 selected."]
527    PRSCH0 = 0,
528    #[doc = "1: PRS Channel 1 selected."]
529    PRSCH1 = 1,
530    #[doc = "2: PRS Channel 2 selected."]
531    PRSCH2 = 2,
532    #[doc = "3: PRS Channel 3 selected."]
533    PRSCH3 = 3,
534    #[doc = "4: PRS Channel 4 selected."]
535    PRSCH4 = 4,
536    #[doc = "5: PRS Channel 5 selected."]
537    PRSCH5 = 5,
538    #[doc = "6: PRS Channel 6 selected."]
539    PRSCH6 = 6,
540    #[doc = "7: PRS Channel 7 selected."]
541    PRSCH7 = 7,
542    #[doc = "8: PRS Channel 8 selected."]
543    PRSCH8 = 8,
544    #[doc = "9: PRS Channel 9 selected."]
545    PRSCH9 = 9,
546    #[doc = "10: PRS Channel 10 selected."]
547    PRSCH10 = 10,
548    #[doc = "11: PRS Channel 11 selected."]
549    PRSCH11 = 11,
550}
551impl From<PRSSEL_A> for u8 {
552    #[inline(always)]
553    fn from(variant: PRSSEL_A) -> Self {
554        variant as _
555    }
556}
557impl PRSSEL_R {
558    #[doc = "Get enumerated values variant"]
559    #[inline(always)]
560    pub fn variant(&self) -> Option<PRSSEL_A> {
561        match self.bits {
562            0 => Some(PRSSEL_A::PRSCH0),
563            1 => Some(PRSSEL_A::PRSCH1),
564            2 => Some(PRSSEL_A::PRSCH2),
565            3 => Some(PRSSEL_A::PRSCH3),
566            4 => Some(PRSSEL_A::PRSCH4),
567            5 => Some(PRSSEL_A::PRSCH5),
568            6 => Some(PRSSEL_A::PRSCH6),
569            7 => Some(PRSSEL_A::PRSCH7),
570            8 => Some(PRSSEL_A::PRSCH8),
571            9 => Some(PRSSEL_A::PRSCH9),
572            10 => Some(PRSSEL_A::PRSCH10),
573            11 => Some(PRSSEL_A::PRSCH11),
574            _ => None,
575        }
576    }
577    #[doc = "Checks if the value of the field is `PRSCH0`"]
578    #[inline(always)]
579    pub fn is_prsch0(&self) -> bool {
580        *self == PRSSEL_A::PRSCH0
581    }
582    #[doc = "Checks if the value of the field is `PRSCH1`"]
583    #[inline(always)]
584    pub fn is_prsch1(&self) -> bool {
585        *self == PRSSEL_A::PRSCH1
586    }
587    #[doc = "Checks if the value of the field is `PRSCH2`"]
588    #[inline(always)]
589    pub fn is_prsch2(&self) -> bool {
590        *self == PRSSEL_A::PRSCH2
591    }
592    #[doc = "Checks if the value of the field is `PRSCH3`"]
593    #[inline(always)]
594    pub fn is_prsch3(&self) -> bool {
595        *self == PRSSEL_A::PRSCH3
596    }
597    #[doc = "Checks if the value of the field is `PRSCH4`"]
598    #[inline(always)]
599    pub fn is_prsch4(&self) -> bool {
600        *self == PRSSEL_A::PRSCH4
601    }
602    #[doc = "Checks if the value of the field is `PRSCH5`"]
603    #[inline(always)]
604    pub fn is_prsch5(&self) -> bool {
605        *self == PRSSEL_A::PRSCH5
606    }
607    #[doc = "Checks if the value of the field is `PRSCH6`"]
608    #[inline(always)]
609    pub fn is_prsch6(&self) -> bool {
610        *self == PRSSEL_A::PRSCH6
611    }
612    #[doc = "Checks if the value of the field is `PRSCH7`"]
613    #[inline(always)]
614    pub fn is_prsch7(&self) -> bool {
615        *self == PRSSEL_A::PRSCH7
616    }
617    #[doc = "Checks if the value of the field is `PRSCH8`"]
618    #[inline(always)]
619    pub fn is_prsch8(&self) -> bool {
620        *self == PRSSEL_A::PRSCH8
621    }
622    #[doc = "Checks if the value of the field is `PRSCH9`"]
623    #[inline(always)]
624    pub fn is_prsch9(&self) -> bool {
625        *self == PRSSEL_A::PRSCH9
626    }
627    #[doc = "Checks if the value of the field is `PRSCH10`"]
628    #[inline(always)]
629    pub fn is_prsch10(&self) -> bool {
630        *self == PRSSEL_A::PRSCH10
631    }
632    #[doc = "Checks if the value of the field is `PRSCH11`"]
633    #[inline(always)]
634    pub fn is_prsch11(&self) -> bool {
635        *self == PRSSEL_A::PRSCH11
636    }
637}
638#[doc = "Field `PRSSEL` writer - IDAC Output Enable PRS Channel Select"]
639pub type PRSSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRSSEL_A, 4, O>;
640impl<'a, const O: u8> PRSSEL_W<'a, O> {
641    #[doc = "PRS Channel 0 selected."]
642    #[inline(always)]
643    pub fn prsch0(self) -> &'a mut W {
644        self.variant(PRSSEL_A::PRSCH0)
645    }
646    #[doc = "PRS Channel 1 selected."]
647    #[inline(always)]
648    pub fn prsch1(self) -> &'a mut W {
649        self.variant(PRSSEL_A::PRSCH1)
650    }
651    #[doc = "PRS Channel 2 selected."]
652    #[inline(always)]
653    pub fn prsch2(self) -> &'a mut W {
654        self.variant(PRSSEL_A::PRSCH2)
655    }
656    #[doc = "PRS Channel 3 selected."]
657    #[inline(always)]
658    pub fn prsch3(self) -> &'a mut W {
659        self.variant(PRSSEL_A::PRSCH3)
660    }
661    #[doc = "PRS Channel 4 selected."]
662    #[inline(always)]
663    pub fn prsch4(self) -> &'a mut W {
664        self.variant(PRSSEL_A::PRSCH4)
665    }
666    #[doc = "PRS Channel 5 selected."]
667    #[inline(always)]
668    pub fn prsch5(self) -> &'a mut W {
669        self.variant(PRSSEL_A::PRSCH5)
670    }
671    #[doc = "PRS Channel 6 selected."]
672    #[inline(always)]
673    pub fn prsch6(self) -> &'a mut W {
674        self.variant(PRSSEL_A::PRSCH6)
675    }
676    #[doc = "PRS Channel 7 selected."]
677    #[inline(always)]
678    pub fn prsch7(self) -> &'a mut W {
679        self.variant(PRSSEL_A::PRSCH7)
680    }
681    #[doc = "PRS Channel 8 selected."]
682    #[inline(always)]
683    pub fn prsch8(self) -> &'a mut W {
684        self.variant(PRSSEL_A::PRSCH8)
685    }
686    #[doc = "PRS Channel 9 selected."]
687    #[inline(always)]
688    pub fn prsch9(self) -> &'a mut W {
689        self.variant(PRSSEL_A::PRSCH9)
690    }
691    #[doc = "PRS Channel 10 selected."]
692    #[inline(always)]
693    pub fn prsch10(self) -> &'a mut W {
694        self.variant(PRSSEL_A::PRSCH10)
695    }
696    #[doc = "PRS Channel 11 selected."]
697    #[inline(always)]
698    pub fn prsch11(self) -> &'a mut W {
699        self.variant(PRSSEL_A::PRSCH11)
700    }
701}
702impl R {
703    #[doc = "Bit 0 - Current DAC Enable"]
704    #[inline(always)]
705    pub fn en(&self) -> EN_R {
706        EN_R::new((self.bits & 1) != 0)
707    }
708    #[doc = "Bit 1 - Current Sink Enable"]
709    #[inline(always)]
710    pub fn cursink(&self) -> CURSINK_R {
711        CURSINK_R::new(((self.bits >> 1) & 1) != 0)
712    }
713    #[doc = "Bit 2 - Minimum Output Transition Enable"]
714    #[inline(always)]
715    pub fn minouttrans(&self) -> MINOUTTRANS_R {
716        MINOUTTRANS_R::new(((self.bits >> 2) & 1) != 0)
717    }
718    #[doc = "Bit 3 - APORT Output Enable"]
719    #[inline(always)]
720    pub fn aportouten(&self) -> APORTOUTEN_R {
721        APORTOUTEN_R::new(((self.bits >> 3) & 1) != 0)
722    }
723    #[doc = "Bits 4:11 - APORT Output Select"]
724    #[inline(always)]
725    pub fn aportoutsel(&self) -> APORTOUTSEL_R {
726        APORTOUTSEL_R::new(((self.bits >> 4) & 0xff) as u8)
727    }
728    #[doc = "Bit 12 - Power Select"]
729    #[inline(always)]
730    pub fn pwrsel(&self) -> PWRSEL_R {
731        PWRSEL_R::new(((self.bits >> 12) & 1) != 0)
732    }
733    #[doc = "Bit 13 - EM2 Delay"]
734    #[inline(always)]
735    pub fn em2delay(&self) -> EM2DELAY_R {
736        EM2DELAY_R::new(((self.bits >> 13) & 1) != 0)
737    }
738    #[doc = "Bit 14 - APORT Bus Master Disable"]
739    #[inline(always)]
740    pub fn aportmasterdis(&self) -> APORTMASTERDIS_R {
741        APORTMASTERDIS_R::new(((self.bits >> 14) & 1) != 0)
742    }
743    #[doc = "Bit 16 - PRS Controlled APORT Output Enable"]
744    #[inline(always)]
745    pub fn aportoutenprs(&self) -> APORTOUTENPRS_R {
746        APORTOUTENPRS_R::new(((self.bits >> 16) & 1) != 0)
747    }
748    #[doc = "Bit 18 - Output Enable"]
749    #[inline(always)]
750    pub fn mainouten(&self) -> MAINOUTEN_R {
751        MAINOUTEN_R::new(((self.bits >> 18) & 1) != 0)
752    }
753    #[doc = "Bit 19 - PRS Controlled Main Pad Output Enable"]
754    #[inline(always)]
755    pub fn mainoutenprs(&self) -> MAINOUTENPRS_R {
756        MAINOUTENPRS_R::new(((self.bits >> 19) & 1) != 0)
757    }
758    #[doc = "Bits 20:23 - IDAC Output Enable PRS Channel Select"]
759    #[inline(always)]
760    pub fn prssel(&self) -> PRSSEL_R {
761        PRSSEL_R::new(((self.bits >> 20) & 0x0f) as u8)
762    }
763}
764impl W {
765    #[doc = "Bit 0 - Current DAC Enable"]
766    #[inline(always)]
767    #[must_use]
768    pub fn en(&mut self) -> EN_W<0> {
769        EN_W::new(self)
770    }
771    #[doc = "Bit 1 - Current Sink Enable"]
772    #[inline(always)]
773    #[must_use]
774    pub fn cursink(&mut self) -> CURSINK_W<1> {
775        CURSINK_W::new(self)
776    }
777    #[doc = "Bit 2 - Minimum Output Transition Enable"]
778    #[inline(always)]
779    #[must_use]
780    pub fn minouttrans(&mut self) -> MINOUTTRANS_W<2> {
781        MINOUTTRANS_W::new(self)
782    }
783    #[doc = "Bit 3 - APORT Output Enable"]
784    #[inline(always)]
785    #[must_use]
786    pub fn aportouten(&mut self) -> APORTOUTEN_W<3> {
787        APORTOUTEN_W::new(self)
788    }
789    #[doc = "Bits 4:11 - APORT Output Select"]
790    #[inline(always)]
791    #[must_use]
792    pub fn aportoutsel(&mut self) -> APORTOUTSEL_W<4> {
793        APORTOUTSEL_W::new(self)
794    }
795    #[doc = "Bit 12 - Power Select"]
796    #[inline(always)]
797    #[must_use]
798    pub fn pwrsel(&mut self) -> PWRSEL_W<12> {
799        PWRSEL_W::new(self)
800    }
801    #[doc = "Bit 13 - EM2 Delay"]
802    #[inline(always)]
803    #[must_use]
804    pub fn em2delay(&mut self) -> EM2DELAY_W<13> {
805        EM2DELAY_W::new(self)
806    }
807    #[doc = "Bit 14 - APORT Bus Master Disable"]
808    #[inline(always)]
809    #[must_use]
810    pub fn aportmasterdis(&mut self) -> APORTMASTERDIS_W<14> {
811        APORTMASTERDIS_W::new(self)
812    }
813    #[doc = "Bit 16 - PRS Controlled APORT Output Enable"]
814    #[inline(always)]
815    #[must_use]
816    pub fn aportoutenprs(&mut self) -> APORTOUTENPRS_W<16> {
817        APORTOUTENPRS_W::new(self)
818    }
819    #[doc = "Bit 18 - Output Enable"]
820    #[inline(always)]
821    #[must_use]
822    pub fn mainouten(&mut self) -> MAINOUTEN_W<18> {
823        MAINOUTEN_W::new(self)
824    }
825    #[doc = "Bit 19 - PRS Controlled Main Pad Output Enable"]
826    #[inline(always)]
827    #[must_use]
828    pub fn mainoutenprs(&mut self) -> MAINOUTENPRS_W<19> {
829        MAINOUTENPRS_W::new(self)
830    }
831    #[doc = "Bits 20:23 - IDAC Output Enable PRS Channel Select"]
832    #[inline(always)]
833    #[must_use]
834    pub fn prssel(&mut self) -> PRSSEL_W<20> {
835        PRSSEL_W::new(self)
836    }
837    #[doc = "Writes raw bits to the register."]
838    #[inline(always)]
839    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
840        self.0.bits(bits);
841        self
842    }
843}
844#[doc = "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 [ctrl](index.html) module"]
845pub struct CTRL_SPEC;
846impl crate::RegisterSpec for CTRL_SPEC {
847    type Ux = u32;
848}
849#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
850impl crate::Readable for CTRL_SPEC {
851    type Reader = R;
852}
853#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
854impl crate::Writable for CTRL_SPEC {
855    type Writer = W;
856    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
857    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
858}
859#[doc = "`reset()` method sets CTRL to value 0"]
860impl crate::Resettable for CTRL_SPEC {
861    const RESET_VALUE: Self::Ux = 0;
862}