efm32gg12b410_pac/prs/
routepen.rs

1#[doc = "Register `ROUTEPEN` reader"]
2pub struct R(crate::R<ROUTEPEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ROUTEPEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ROUTEPEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ROUTEPEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ROUTEPEN` writer"]
17pub struct W(crate::W<ROUTEPEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<ROUTEPEN_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<ROUTEPEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<ROUTEPEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CH0PEN` reader - CH0 Pin Enable"]
38pub type CH0PEN_R = crate::BitReader<bool>;
39#[doc = "Field `CH0PEN` writer - CH0 Pin Enable"]
40pub type CH0PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 0>;
41#[doc = "Field `CH1PEN` reader - CH1 Pin Enable"]
42pub type CH1PEN_R = crate::BitReader<bool>;
43#[doc = "Field `CH1PEN` writer - CH1 Pin Enable"]
44pub type CH1PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 1>;
45#[doc = "Field `CH2PEN` reader - CH2 Pin Enable"]
46pub type CH2PEN_R = crate::BitReader<bool>;
47#[doc = "Field `CH2PEN` writer - CH2 Pin Enable"]
48pub type CH2PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 2>;
49#[doc = "Field `CH3PEN` reader - CH3 Pin Enable"]
50pub type CH3PEN_R = crate::BitReader<bool>;
51#[doc = "Field `CH3PEN` writer - CH3 Pin Enable"]
52pub type CH3PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 3>;
53#[doc = "Field `CH4PEN` reader - CH4 Pin Enable"]
54pub type CH4PEN_R = crate::BitReader<bool>;
55#[doc = "Field `CH4PEN` writer - CH4 Pin Enable"]
56pub type CH4PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 4>;
57#[doc = "Field `CH5PEN` reader - CH5 Pin Enable"]
58pub type CH5PEN_R = crate::BitReader<bool>;
59#[doc = "Field `CH5PEN` writer - CH5 Pin Enable"]
60pub type CH5PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 5>;
61#[doc = "Field `CH6PEN` reader - CH6 Pin Enable"]
62pub type CH6PEN_R = crate::BitReader<bool>;
63#[doc = "Field `CH6PEN` writer - CH6 Pin Enable"]
64pub type CH6PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 6>;
65#[doc = "Field `CH7PEN` reader - CH7 Pin Enable"]
66pub type CH7PEN_R = crate::BitReader<bool>;
67#[doc = "Field `CH7PEN` writer - CH7 Pin Enable"]
68pub type CH7PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 7>;
69#[doc = "Field `CH8PEN` reader - CH8 Pin Enable"]
70pub type CH8PEN_R = crate::BitReader<bool>;
71#[doc = "Field `CH8PEN` writer - CH8 Pin Enable"]
72pub type CH8PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 8>;
73#[doc = "Field `CH9PEN` reader - CH9 Pin Enable"]
74pub type CH9PEN_R = crate::BitReader<bool>;
75#[doc = "Field `CH9PEN` writer - CH9 Pin Enable"]
76pub type CH9PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 9>;
77#[doc = "Field `CH10PEN` reader - CH10 Pin Enable"]
78pub type CH10PEN_R = crate::BitReader<bool>;
79#[doc = "Field `CH10PEN` writer - CH10 Pin Enable"]
80pub type CH10PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 10>;
81#[doc = "Field `CH11PEN` reader - CH11 Pin Enable"]
82pub type CH11PEN_R = crate::BitReader<bool>;
83#[doc = "Field `CH11PEN` writer - CH11 Pin Enable"]
84pub type CH11PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 11>;
85#[doc = "Field `CH12PEN` reader - CH12 Pin Enable"]
86pub type CH12PEN_R = crate::BitReader<bool>;
87#[doc = "Field `CH12PEN` writer - CH12 Pin Enable"]
88pub type CH12PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 12>;
89#[doc = "Field `CH13PEN` reader - CH13 Pin Enable"]
90pub type CH13PEN_R = crate::BitReader<bool>;
91#[doc = "Field `CH13PEN` writer - CH13 Pin Enable"]
92pub type CH13PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 13>;
93#[doc = "Field `CH14PEN` reader - CH14 Pin Enable"]
94pub type CH14PEN_R = crate::BitReader<bool>;
95#[doc = "Field `CH14PEN` writer - CH14 Pin Enable"]
96pub type CH14PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 14>;
97#[doc = "Field `CH15PEN` reader - CH15 Pin Enable"]
98pub type CH15PEN_R = crate::BitReader<bool>;
99#[doc = "Field `CH15PEN` writer - CH15 Pin Enable"]
100pub type CH15PEN_W<'a> = crate::BitWriter<'a, u32, ROUTEPEN_SPEC, bool, 15>;
101impl R {
102    #[doc = "Bit 0 - CH0 Pin Enable"]
103    #[inline(always)]
104    pub fn ch0pen(&self) -> CH0PEN_R {
105        CH0PEN_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - CH1 Pin Enable"]
108    #[inline(always)]
109    pub fn ch1pen(&self) -> CH1PEN_R {
110        CH1PEN_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - CH2 Pin Enable"]
113    #[inline(always)]
114    pub fn ch2pen(&self) -> CH2PEN_R {
115        CH2PEN_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - CH3 Pin Enable"]
118    #[inline(always)]
119    pub fn ch3pen(&self) -> CH3PEN_R {
120        CH3PEN_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - CH4 Pin Enable"]
123    #[inline(always)]
124    pub fn ch4pen(&self) -> CH4PEN_R {
125        CH4PEN_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 5 - CH5 Pin Enable"]
128    #[inline(always)]
129    pub fn ch5pen(&self) -> CH5PEN_R {
130        CH5PEN_R::new(((self.bits >> 5) & 1) != 0)
131    }
132    #[doc = "Bit 6 - CH6 Pin Enable"]
133    #[inline(always)]
134    pub fn ch6pen(&self) -> CH6PEN_R {
135        CH6PEN_R::new(((self.bits >> 6) & 1) != 0)
136    }
137    #[doc = "Bit 7 - CH7 Pin Enable"]
138    #[inline(always)]
139    pub fn ch7pen(&self) -> CH7PEN_R {
140        CH7PEN_R::new(((self.bits >> 7) & 1) != 0)
141    }
142    #[doc = "Bit 8 - CH8 Pin Enable"]
143    #[inline(always)]
144    pub fn ch8pen(&self) -> CH8PEN_R {
145        CH8PEN_R::new(((self.bits >> 8) & 1) != 0)
146    }
147    #[doc = "Bit 9 - CH9 Pin Enable"]
148    #[inline(always)]
149    pub fn ch9pen(&self) -> CH9PEN_R {
150        CH9PEN_R::new(((self.bits >> 9) & 1) != 0)
151    }
152    #[doc = "Bit 10 - CH10 Pin Enable"]
153    #[inline(always)]
154    pub fn ch10pen(&self) -> CH10PEN_R {
155        CH10PEN_R::new(((self.bits >> 10) & 1) != 0)
156    }
157    #[doc = "Bit 11 - CH11 Pin Enable"]
158    #[inline(always)]
159    pub fn ch11pen(&self) -> CH11PEN_R {
160        CH11PEN_R::new(((self.bits >> 11) & 1) != 0)
161    }
162    #[doc = "Bit 12 - CH12 Pin Enable"]
163    #[inline(always)]
164    pub fn ch12pen(&self) -> CH12PEN_R {
165        CH12PEN_R::new(((self.bits >> 12) & 1) != 0)
166    }
167    #[doc = "Bit 13 - CH13 Pin Enable"]
168    #[inline(always)]
169    pub fn ch13pen(&self) -> CH13PEN_R {
170        CH13PEN_R::new(((self.bits >> 13) & 1) != 0)
171    }
172    #[doc = "Bit 14 - CH14 Pin Enable"]
173    #[inline(always)]
174    pub fn ch14pen(&self) -> CH14PEN_R {
175        CH14PEN_R::new(((self.bits >> 14) & 1) != 0)
176    }
177    #[doc = "Bit 15 - CH15 Pin Enable"]
178    #[inline(always)]
179    pub fn ch15pen(&self) -> CH15PEN_R {
180        CH15PEN_R::new(((self.bits >> 15) & 1) != 0)
181    }
182}
183impl W {
184    #[doc = "Bit 0 - CH0 Pin Enable"]
185    #[inline(always)]
186    pub fn ch0pen(&mut self) -> CH0PEN_W {
187        CH0PEN_W::new(self)
188    }
189    #[doc = "Bit 1 - CH1 Pin Enable"]
190    #[inline(always)]
191    pub fn ch1pen(&mut self) -> CH1PEN_W {
192        CH1PEN_W::new(self)
193    }
194    #[doc = "Bit 2 - CH2 Pin Enable"]
195    #[inline(always)]
196    pub fn ch2pen(&mut self) -> CH2PEN_W {
197        CH2PEN_W::new(self)
198    }
199    #[doc = "Bit 3 - CH3 Pin Enable"]
200    #[inline(always)]
201    pub fn ch3pen(&mut self) -> CH3PEN_W {
202        CH3PEN_W::new(self)
203    }
204    #[doc = "Bit 4 - CH4 Pin Enable"]
205    #[inline(always)]
206    pub fn ch4pen(&mut self) -> CH4PEN_W {
207        CH4PEN_W::new(self)
208    }
209    #[doc = "Bit 5 - CH5 Pin Enable"]
210    #[inline(always)]
211    pub fn ch5pen(&mut self) -> CH5PEN_W {
212        CH5PEN_W::new(self)
213    }
214    #[doc = "Bit 6 - CH6 Pin Enable"]
215    #[inline(always)]
216    pub fn ch6pen(&mut self) -> CH6PEN_W {
217        CH6PEN_W::new(self)
218    }
219    #[doc = "Bit 7 - CH7 Pin Enable"]
220    #[inline(always)]
221    pub fn ch7pen(&mut self) -> CH7PEN_W {
222        CH7PEN_W::new(self)
223    }
224    #[doc = "Bit 8 - CH8 Pin Enable"]
225    #[inline(always)]
226    pub fn ch8pen(&mut self) -> CH8PEN_W {
227        CH8PEN_W::new(self)
228    }
229    #[doc = "Bit 9 - CH9 Pin Enable"]
230    #[inline(always)]
231    pub fn ch9pen(&mut self) -> CH9PEN_W {
232        CH9PEN_W::new(self)
233    }
234    #[doc = "Bit 10 - CH10 Pin Enable"]
235    #[inline(always)]
236    pub fn ch10pen(&mut self) -> CH10PEN_W {
237        CH10PEN_W::new(self)
238    }
239    #[doc = "Bit 11 - CH11 Pin Enable"]
240    #[inline(always)]
241    pub fn ch11pen(&mut self) -> CH11PEN_W {
242        CH11PEN_W::new(self)
243    }
244    #[doc = "Bit 12 - CH12 Pin Enable"]
245    #[inline(always)]
246    pub fn ch12pen(&mut self) -> CH12PEN_W {
247        CH12PEN_W::new(self)
248    }
249    #[doc = "Bit 13 - CH13 Pin Enable"]
250    #[inline(always)]
251    pub fn ch13pen(&mut self) -> CH13PEN_W {
252        CH13PEN_W::new(self)
253    }
254    #[doc = "Bit 14 - CH14 Pin Enable"]
255    #[inline(always)]
256    pub fn ch14pen(&mut self) -> CH14PEN_W {
257        CH14PEN_W::new(self)
258    }
259    #[doc = "Bit 15 - CH15 Pin Enable"]
260    #[inline(always)]
261    pub fn ch15pen(&mut self) -> CH15PEN_W {
262        CH15PEN_W::new(self)
263    }
264    #[doc = "Writes raw bits to the register."]
265    #[inline(always)]
266    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
267        self.0.bits(bits);
268        self
269    }
270}
271#[doc = "I/O Routing Pin Enable 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 [routepen](index.html) module"]
272pub struct ROUTEPEN_SPEC;
273impl crate::RegisterSpec for ROUTEPEN_SPEC {
274    type Ux = u32;
275}
276#[doc = "`read()` method returns [routepen::R](R) reader structure"]
277impl crate::Readable for ROUTEPEN_SPEC {
278    type Reader = R;
279}
280#[doc = "`write(|w| ..)` method takes [routepen::W](W) writer structure"]
281impl crate::Writable for ROUTEPEN_SPEC {
282    type Writer = W;
283}
284#[doc = "`reset()` method sets ROUTEPEN to value 0"]
285impl crate::Resettable for ROUTEPEN_SPEC {
286    #[inline(always)]
287    fn reset_value() -> Self::Ux {
288        0
289    }
290}