efm32gg11b820_pac/prs/
ctrl.rs1#[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 `SEVONPRS` reader - Set Event on PRS"]
38pub type SEVONPRS_R = crate::BitReader<bool>;
39#[doc = "Field `SEVONPRS` writer - Set Event on PRS"]
40pub type SEVONPRS_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 0>;
41#[doc = "SEVONPRS PRS Channel Select\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43#[repr(u8)]
44pub enum SEVONPRSSEL_A {
45 #[doc = "0: PRS Channel 0 selected"]
46 PRSCH0 = 0,
47 #[doc = "1: PRS Channel 1 selected"]
48 PRSCH1 = 1,
49 #[doc = "2: PRS Channel 2 selected"]
50 PRSCH2 = 2,
51 #[doc = "3: PRS Channel 3 selected"]
52 PRSCH3 = 3,
53 #[doc = "4: PRS Channel 4 selected"]
54 PRSCH4 = 4,
55 #[doc = "5: PRS Channel 5 selected"]
56 PRSCH5 = 5,
57 #[doc = "6: PRS Channel 6 selected"]
58 PRSCH6 = 6,
59 #[doc = "7: PRS Channel 7 selected"]
60 PRSCH7 = 7,
61 #[doc = "8: PRS Channel 8 selected"]
62 PRSCH8 = 8,
63 #[doc = "9: PRS Channel 9 selected"]
64 PRSCH9 = 9,
65 #[doc = "10: PRS Channel 10 selected"]
66 PRSCH10 = 10,
67 #[doc = "11: PRS Channel 11 selected"]
68 PRSCH11 = 11,
69 #[doc = "12: PRS Channel 12 selected"]
70 PRSCH12 = 12,
71 #[doc = "13: PRS Channel 13 selected"]
72 PRSCH13 = 13,
73 #[doc = "14: PRS Channel 14 selected"]
74 PRSCH14 = 14,
75 #[doc = "15: PRS Channel 15 selected"]
76 PRSCH15 = 15,
77 #[doc = "16: PRS Channel 16 selected"]
78 PRSCH16 = 16,
79 #[doc = "17: PRS Channel 17 selected"]
80 PRSCH17 = 17,
81 #[doc = "18: PRS Channel 18 selected"]
82 PRSCH18 = 18,
83 #[doc = "19: PRS Channel 19 selected"]
84 PRSCH19 = 19,
85 #[doc = "20: PRS Channel 20 selected"]
86 PRSCH20 = 20,
87 #[doc = "21: PRS Channel 21 selected"]
88 PRSCH21 = 21,
89 #[doc = "22: PRS Channel 22 selected"]
90 PRSCH22 = 22,
91 #[doc = "23: PRS Channel 23 selected"]
92 PRSCH23 = 23,
93}
94impl From<SEVONPRSSEL_A> for u8 {
95 #[inline(always)]
96 fn from(variant: SEVONPRSSEL_A) -> Self {
97 variant as _
98 }
99}
100#[doc = "Field `SEVONPRSSEL` reader - SEVONPRS PRS Channel Select"]
101pub type SEVONPRSSEL_R = crate::FieldReader<u8, SEVONPRSSEL_A>;
102impl SEVONPRSSEL_R {
103 #[doc = "Get enumerated values variant"]
104 #[inline(always)]
105 pub fn variant(&self) -> Option<SEVONPRSSEL_A> {
106 match self.bits {
107 0 => Some(SEVONPRSSEL_A::PRSCH0),
108 1 => Some(SEVONPRSSEL_A::PRSCH1),
109 2 => Some(SEVONPRSSEL_A::PRSCH2),
110 3 => Some(SEVONPRSSEL_A::PRSCH3),
111 4 => Some(SEVONPRSSEL_A::PRSCH4),
112 5 => Some(SEVONPRSSEL_A::PRSCH5),
113 6 => Some(SEVONPRSSEL_A::PRSCH6),
114 7 => Some(SEVONPRSSEL_A::PRSCH7),
115 8 => Some(SEVONPRSSEL_A::PRSCH8),
116 9 => Some(SEVONPRSSEL_A::PRSCH9),
117 10 => Some(SEVONPRSSEL_A::PRSCH10),
118 11 => Some(SEVONPRSSEL_A::PRSCH11),
119 12 => Some(SEVONPRSSEL_A::PRSCH12),
120 13 => Some(SEVONPRSSEL_A::PRSCH13),
121 14 => Some(SEVONPRSSEL_A::PRSCH14),
122 15 => Some(SEVONPRSSEL_A::PRSCH15),
123 16 => Some(SEVONPRSSEL_A::PRSCH16),
124 17 => Some(SEVONPRSSEL_A::PRSCH17),
125 18 => Some(SEVONPRSSEL_A::PRSCH18),
126 19 => Some(SEVONPRSSEL_A::PRSCH19),
127 20 => Some(SEVONPRSSEL_A::PRSCH20),
128 21 => Some(SEVONPRSSEL_A::PRSCH21),
129 22 => Some(SEVONPRSSEL_A::PRSCH22),
130 23 => Some(SEVONPRSSEL_A::PRSCH23),
131 _ => None,
132 }
133 }
134 #[doc = "Checks if the value of the field is `PRSCH0`"]
135 #[inline(always)]
136 pub fn is_prsch0(&self) -> bool {
137 *self == SEVONPRSSEL_A::PRSCH0
138 }
139 #[doc = "Checks if the value of the field is `PRSCH1`"]
140 #[inline(always)]
141 pub fn is_prsch1(&self) -> bool {
142 *self == SEVONPRSSEL_A::PRSCH1
143 }
144 #[doc = "Checks if the value of the field is `PRSCH2`"]
145 #[inline(always)]
146 pub fn is_prsch2(&self) -> bool {
147 *self == SEVONPRSSEL_A::PRSCH2
148 }
149 #[doc = "Checks if the value of the field is `PRSCH3`"]
150 #[inline(always)]
151 pub fn is_prsch3(&self) -> bool {
152 *self == SEVONPRSSEL_A::PRSCH3
153 }
154 #[doc = "Checks if the value of the field is `PRSCH4`"]
155 #[inline(always)]
156 pub fn is_prsch4(&self) -> bool {
157 *self == SEVONPRSSEL_A::PRSCH4
158 }
159 #[doc = "Checks if the value of the field is `PRSCH5`"]
160 #[inline(always)]
161 pub fn is_prsch5(&self) -> bool {
162 *self == SEVONPRSSEL_A::PRSCH5
163 }
164 #[doc = "Checks if the value of the field is `PRSCH6`"]
165 #[inline(always)]
166 pub fn is_prsch6(&self) -> bool {
167 *self == SEVONPRSSEL_A::PRSCH6
168 }
169 #[doc = "Checks if the value of the field is `PRSCH7`"]
170 #[inline(always)]
171 pub fn is_prsch7(&self) -> bool {
172 *self == SEVONPRSSEL_A::PRSCH7
173 }
174 #[doc = "Checks if the value of the field is `PRSCH8`"]
175 #[inline(always)]
176 pub fn is_prsch8(&self) -> bool {
177 *self == SEVONPRSSEL_A::PRSCH8
178 }
179 #[doc = "Checks if the value of the field is `PRSCH9`"]
180 #[inline(always)]
181 pub fn is_prsch9(&self) -> bool {
182 *self == SEVONPRSSEL_A::PRSCH9
183 }
184 #[doc = "Checks if the value of the field is `PRSCH10`"]
185 #[inline(always)]
186 pub fn is_prsch10(&self) -> bool {
187 *self == SEVONPRSSEL_A::PRSCH10
188 }
189 #[doc = "Checks if the value of the field is `PRSCH11`"]
190 #[inline(always)]
191 pub fn is_prsch11(&self) -> bool {
192 *self == SEVONPRSSEL_A::PRSCH11
193 }
194 #[doc = "Checks if the value of the field is `PRSCH12`"]
195 #[inline(always)]
196 pub fn is_prsch12(&self) -> bool {
197 *self == SEVONPRSSEL_A::PRSCH12
198 }
199 #[doc = "Checks if the value of the field is `PRSCH13`"]
200 #[inline(always)]
201 pub fn is_prsch13(&self) -> bool {
202 *self == SEVONPRSSEL_A::PRSCH13
203 }
204 #[doc = "Checks if the value of the field is `PRSCH14`"]
205 #[inline(always)]
206 pub fn is_prsch14(&self) -> bool {
207 *self == SEVONPRSSEL_A::PRSCH14
208 }
209 #[doc = "Checks if the value of the field is `PRSCH15`"]
210 #[inline(always)]
211 pub fn is_prsch15(&self) -> bool {
212 *self == SEVONPRSSEL_A::PRSCH15
213 }
214 #[doc = "Checks if the value of the field is `PRSCH16`"]
215 #[inline(always)]
216 pub fn is_prsch16(&self) -> bool {
217 *self == SEVONPRSSEL_A::PRSCH16
218 }
219 #[doc = "Checks if the value of the field is `PRSCH17`"]
220 #[inline(always)]
221 pub fn is_prsch17(&self) -> bool {
222 *self == SEVONPRSSEL_A::PRSCH17
223 }
224 #[doc = "Checks if the value of the field is `PRSCH18`"]
225 #[inline(always)]
226 pub fn is_prsch18(&self) -> bool {
227 *self == SEVONPRSSEL_A::PRSCH18
228 }
229 #[doc = "Checks if the value of the field is `PRSCH19`"]
230 #[inline(always)]
231 pub fn is_prsch19(&self) -> bool {
232 *self == SEVONPRSSEL_A::PRSCH19
233 }
234 #[doc = "Checks if the value of the field is `PRSCH20`"]
235 #[inline(always)]
236 pub fn is_prsch20(&self) -> bool {
237 *self == SEVONPRSSEL_A::PRSCH20
238 }
239 #[doc = "Checks if the value of the field is `PRSCH21`"]
240 #[inline(always)]
241 pub fn is_prsch21(&self) -> bool {
242 *self == SEVONPRSSEL_A::PRSCH21
243 }
244 #[doc = "Checks if the value of the field is `PRSCH22`"]
245 #[inline(always)]
246 pub fn is_prsch22(&self) -> bool {
247 *self == SEVONPRSSEL_A::PRSCH22
248 }
249 #[doc = "Checks if the value of the field is `PRSCH23`"]
250 #[inline(always)]
251 pub fn is_prsch23(&self) -> bool {
252 *self == SEVONPRSSEL_A::PRSCH23
253 }
254}
255#[doc = "Field `SEVONPRSSEL` writer - SEVONPRS PRS Channel Select"]
256pub type SEVONPRSSEL_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, SEVONPRSSEL_A, 5, 1>;
257impl<'a> SEVONPRSSEL_W<'a> {
258 #[doc = "PRS Channel 0 selected"]
259 #[inline(always)]
260 pub fn prsch0(self) -> &'a mut W {
261 self.variant(SEVONPRSSEL_A::PRSCH0)
262 }
263 #[doc = "PRS Channel 1 selected"]
264 #[inline(always)]
265 pub fn prsch1(self) -> &'a mut W {
266 self.variant(SEVONPRSSEL_A::PRSCH1)
267 }
268 #[doc = "PRS Channel 2 selected"]
269 #[inline(always)]
270 pub fn prsch2(self) -> &'a mut W {
271 self.variant(SEVONPRSSEL_A::PRSCH2)
272 }
273 #[doc = "PRS Channel 3 selected"]
274 #[inline(always)]
275 pub fn prsch3(self) -> &'a mut W {
276 self.variant(SEVONPRSSEL_A::PRSCH3)
277 }
278 #[doc = "PRS Channel 4 selected"]
279 #[inline(always)]
280 pub fn prsch4(self) -> &'a mut W {
281 self.variant(SEVONPRSSEL_A::PRSCH4)
282 }
283 #[doc = "PRS Channel 5 selected"]
284 #[inline(always)]
285 pub fn prsch5(self) -> &'a mut W {
286 self.variant(SEVONPRSSEL_A::PRSCH5)
287 }
288 #[doc = "PRS Channel 6 selected"]
289 #[inline(always)]
290 pub fn prsch6(self) -> &'a mut W {
291 self.variant(SEVONPRSSEL_A::PRSCH6)
292 }
293 #[doc = "PRS Channel 7 selected"]
294 #[inline(always)]
295 pub fn prsch7(self) -> &'a mut W {
296 self.variant(SEVONPRSSEL_A::PRSCH7)
297 }
298 #[doc = "PRS Channel 8 selected"]
299 #[inline(always)]
300 pub fn prsch8(self) -> &'a mut W {
301 self.variant(SEVONPRSSEL_A::PRSCH8)
302 }
303 #[doc = "PRS Channel 9 selected"]
304 #[inline(always)]
305 pub fn prsch9(self) -> &'a mut W {
306 self.variant(SEVONPRSSEL_A::PRSCH9)
307 }
308 #[doc = "PRS Channel 10 selected"]
309 #[inline(always)]
310 pub fn prsch10(self) -> &'a mut W {
311 self.variant(SEVONPRSSEL_A::PRSCH10)
312 }
313 #[doc = "PRS Channel 11 selected"]
314 #[inline(always)]
315 pub fn prsch11(self) -> &'a mut W {
316 self.variant(SEVONPRSSEL_A::PRSCH11)
317 }
318 #[doc = "PRS Channel 12 selected"]
319 #[inline(always)]
320 pub fn prsch12(self) -> &'a mut W {
321 self.variant(SEVONPRSSEL_A::PRSCH12)
322 }
323 #[doc = "PRS Channel 13 selected"]
324 #[inline(always)]
325 pub fn prsch13(self) -> &'a mut W {
326 self.variant(SEVONPRSSEL_A::PRSCH13)
327 }
328 #[doc = "PRS Channel 14 selected"]
329 #[inline(always)]
330 pub fn prsch14(self) -> &'a mut W {
331 self.variant(SEVONPRSSEL_A::PRSCH14)
332 }
333 #[doc = "PRS Channel 15 selected"]
334 #[inline(always)]
335 pub fn prsch15(self) -> &'a mut W {
336 self.variant(SEVONPRSSEL_A::PRSCH15)
337 }
338 #[doc = "PRS Channel 16 selected"]
339 #[inline(always)]
340 pub fn prsch16(self) -> &'a mut W {
341 self.variant(SEVONPRSSEL_A::PRSCH16)
342 }
343 #[doc = "PRS Channel 17 selected"]
344 #[inline(always)]
345 pub fn prsch17(self) -> &'a mut W {
346 self.variant(SEVONPRSSEL_A::PRSCH17)
347 }
348 #[doc = "PRS Channel 18 selected"]
349 #[inline(always)]
350 pub fn prsch18(self) -> &'a mut W {
351 self.variant(SEVONPRSSEL_A::PRSCH18)
352 }
353 #[doc = "PRS Channel 19 selected"]
354 #[inline(always)]
355 pub fn prsch19(self) -> &'a mut W {
356 self.variant(SEVONPRSSEL_A::PRSCH19)
357 }
358 #[doc = "PRS Channel 20 selected"]
359 #[inline(always)]
360 pub fn prsch20(self) -> &'a mut W {
361 self.variant(SEVONPRSSEL_A::PRSCH20)
362 }
363 #[doc = "PRS Channel 21 selected"]
364 #[inline(always)]
365 pub fn prsch21(self) -> &'a mut W {
366 self.variant(SEVONPRSSEL_A::PRSCH21)
367 }
368 #[doc = "PRS Channel 22 selected"]
369 #[inline(always)]
370 pub fn prsch22(self) -> &'a mut W {
371 self.variant(SEVONPRSSEL_A::PRSCH22)
372 }
373 #[doc = "PRS Channel 23 selected"]
374 #[inline(always)]
375 pub fn prsch23(self) -> &'a mut W {
376 self.variant(SEVONPRSSEL_A::PRSCH23)
377 }
378}
379impl R {
380 #[doc = "Bit 0 - Set Event on PRS"]
381 #[inline(always)]
382 pub fn sevonprs(&self) -> SEVONPRS_R {
383 SEVONPRS_R::new((self.bits & 1) != 0)
384 }
385 #[doc = "Bits 1:5 - SEVONPRS PRS Channel Select"]
386 #[inline(always)]
387 pub fn sevonprssel(&self) -> SEVONPRSSEL_R {
388 SEVONPRSSEL_R::new(((self.bits >> 1) & 0x1f) as u8)
389 }
390}
391impl W {
392 #[doc = "Bit 0 - Set Event on PRS"]
393 #[inline(always)]
394 pub fn sevonprs(&mut self) -> SEVONPRS_W {
395 SEVONPRS_W::new(self)
396 }
397 #[doc = "Bits 1:5 - SEVONPRS PRS Channel Select"]
398 #[inline(always)]
399 pub fn sevonprssel(&mut self) -> SEVONPRSSEL_W {
400 SEVONPRSSEL_W::new(self)
401 }
402 #[doc = "Writes raw bits to the register."]
403 #[inline(always)]
404 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
405 self.0.bits(bits);
406 self
407 }
408}
409#[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"]
410pub struct CTRL_SPEC;
411impl crate::RegisterSpec for CTRL_SPEC {
412 type Ux = u32;
413}
414#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
415impl crate::Readable for CTRL_SPEC {
416 type Reader = R;
417}
418#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
419impl crate::Writable for CTRL_SPEC {
420 type Writer = W;
421}
422#[doc = "`reset()` method sets CTRL to value 0"]
423impl crate::Resettable for CTRL_SPEC {
424 #[inline(always)]
425 fn reset_value() -> Self::Ux {
426 0
427 }
428}