efm32pg1b200_pac/prs/
dmareq1.rs1#[doc = "Register `DMAREQ1` reader"]
2pub struct R(crate::R<DMAREQ1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DMAREQ1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DMAREQ1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DMAREQ1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `DMAREQ1` writer"]
17pub struct W(crate::W<DMAREQ1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DMAREQ1_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<DMAREQ1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DMAREQ1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "DMA Request 1 PRS Channel Select\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum PRSSEL_A {
41 #[doc = "0: PRS Channel 0 selected"]
42 PRSCH0 = 0,
43 #[doc = "1: PRS Channel 1 selected"]
44 PRSCH1 = 1,
45 #[doc = "2: PRS Channel 2 selected"]
46 PRSCH2 = 2,
47 #[doc = "3: PRS Channel 3 selected"]
48 PRSCH3 = 3,
49 #[doc = "4: PRS Channel 4 selected"]
50 PRSCH4 = 4,
51 #[doc = "5: PRS Channel 5 selected"]
52 PRSCH5 = 5,
53 #[doc = "6: PRS Channel 6 selected"]
54 PRSCH6 = 6,
55 #[doc = "7: PRS Channel 7 selected"]
56 PRSCH7 = 7,
57 #[doc = "8: PRS Channel 8 selected"]
58 PRSCH8 = 8,
59 #[doc = "9: PRS Channel 9 selected"]
60 PRSCH9 = 9,
61 #[doc = "10: PRS Channel 10 selected"]
62 PRSCH10 = 10,
63 #[doc = "11: PRS Channel 11 selected"]
64 PRSCH11 = 11,
65}
66impl From<PRSSEL_A> for u8 {
67 #[inline(always)]
68 fn from(variant: PRSSEL_A) -> Self {
69 variant as _
70 }
71}
72#[doc = "Field `PRSSEL` reader - DMA Request 1 PRS Channel Select"]
73pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
74impl PRSSEL_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub fn variant(&self) -> Option<PRSSEL_A> {
78 match self.bits {
79 0 => Some(PRSSEL_A::PRSCH0),
80 1 => Some(PRSSEL_A::PRSCH1),
81 2 => Some(PRSSEL_A::PRSCH2),
82 3 => Some(PRSSEL_A::PRSCH3),
83 4 => Some(PRSSEL_A::PRSCH4),
84 5 => Some(PRSSEL_A::PRSCH5),
85 6 => Some(PRSSEL_A::PRSCH6),
86 7 => Some(PRSSEL_A::PRSCH7),
87 8 => Some(PRSSEL_A::PRSCH8),
88 9 => Some(PRSSEL_A::PRSCH9),
89 10 => Some(PRSSEL_A::PRSCH10),
90 11 => Some(PRSSEL_A::PRSCH11),
91 _ => None,
92 }
93 }
94 #[doc = "Checks if the value of the field is `PRSCH0`"]
95 #[inline(always)]
96 pub fn is_prsch0(&self) -> bool {
97 *self == PRSSEL_A::PRSCH0
98 }
99 #[doc = "Checks if the value of the field is `PRSCH1`"]
100 #[inline(always)]
101 pub fn is_prsch1(&self) -> bool {
102 *self == PRSSEL_A::PRSCH1
103 }
104 #[doc = "Checks if the value of the field is `PRSCH2`"]
105 #[inline(always)]
106 pub fn is_prsch2(&self) -> bool {
107 *self == PRSSEL_A::PRSCH2
108 }
109 #[doc = "Checks if the value of the field is `PRSCH3`"]
110 #[inline(always)]
111 pub fn is_prsch3(&self) -> bool {
112 *self == PRSSEL_A::PRSCH3
113 }
114 #[doc = "Checks if the value of the field is `PRSCH4`"]
115 #[inline(always)]
116 pub fn is_prsch4(&self) -> bool {
117 *self == PRSSEL_A::PRSCH4
118 }
119 #[doc = "Checks if the value of the field is `PRSCH5`"]
120 #[inline(always)]
121 pub fn is_prsch5(&self) -> bool {
122 *self == PRSSEL_A::PRSCH5
123 }
124 #[doc = "Checks if the value of the field is `PRSCH6`"]
125 #[inline(always)]
126 pub fn is_prsch6(&self) -> bool {
127 *self == PRSSEL_A::PRSCH6
128 }
129 #[doc = "Checks if the value of the field is `PRSCH7`"]
130 #[inline(always)]
131 pub fn is_prsch7(&self) -> bool {
132 *self == PRSSEL_A::PRSCH7
133 }
134 #[doc = "Checks if the value of the field is `PRSCH8`"]
135 #[inline(always)]
136 pub fn is_prsch8(&self) -> bool {
137 *self == PRSSEL_A::PRSCH8
138 }
139 #[doc = "Checks if the value of the field is `PRSCH9`"]
140 #[inline(always)]
141 pub fn is_prsch9(&self) -> bool {
142 *self == PRSSEL_A::PRSCH9
143 }
144 #[doc = "Checks if the value of the field is `PRSCH10`"]
145 #[inline(always)]
146 pub fn is_prsch10(&self) -> bool {
147 *self == PRSSEL_A::PRSCH10
148 }
149 #[doc = "Checks if the value of the field is `PRSCH11`"]
150 #[inline(always)]
151 pub fn is_prsch11(&self) -> bool {
152 *self == PRSSEL_A::PRSCH11
153 }
154}
155#[doc = "Field `PRSSEL` writer - DMA Request 1 PRS Channel Select"]
156pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, DMAREQ1_SPEC, u8, PRSSEL_A, 4, 6>;
157impl<'a> PRSSEL_W<'a> {
158 #[doc = "PRS Channel 0 selected"]
159 #[inline(always)]
160 pub fn prsch0(self) -> &'a mut W {
161 self.variant(PRSSEL_A::PRSCH0)
162 }
163 #[doc = "PRS Channel 1 selected"]
164 #[inline(always)]
165 pub fn prsch1(self) -> &'a mut W {
166 self.variant(PRSSEL_A::PRSCH1)
167 }
168 #[doc = "PRS Channel 2 selected"]
169 #[inline(always)]
170 pub fn prsch2(self) -> &'a mut W {
171 self.variant(PRSSEL_A::PRSCH2)
172 }
173 #[doc = "PRS Channel 3 selected"]
174 #[inline(always)]
175 pub fn prsch3(self) -> &'a mut W {
176 self.variant(PRSSEL_A::PRSCH3)
177 }
178 #[doc = "PRS Channel 4 selected"]
179 #[inline(always)]
180 pub fn prsch4(self) -> &'a mut W {
181 self.variant(PRSSEL_A::PRSCH4)
182 }
183 #[doc = "PRS Channel 5 selected"]
184 #[inline(always)]
185 pub fn prsch5(self) -> &'a mut W {
186 self.variant(PRSSEL_A::PRSCH5)
187 }
188 #[doc = "PRS Channel 6 selected"]
189 #[inline(always)]
190 pub fn prsch6(self) -> &'a mut W {
191 self.variant(PRSSEL_A::PRSCH6)
192 }
193 #[doc = "PRS Channel 7 selected"]
194 #[inline(always)]
195 pub fn prsch7(self) -> &'a mut W {
196 self.variant(PRSSEL_A::PRSCH7)
197 }
198 #[doc = "PRS Channel 8 selected"]
199 #[inline(always)]
200 pub fn prsch8(self) -> &'a mut W {
201 self.variant(PRSSEL_A::PRSCH8)
202 }
203 #[doc = "PRS Channel 9 selected"]
204 #[inline(always)]
205 pub fn prsch9(self) -> &'a mut W {
206 self.variant(PRSSEL_A::PRSCH9)
207 }
208 #[doc = "PRS Channel 10 selected"]
209 #[inline(always)]
210 pub fn prsch10(self) -> &'a mut W {
211 self.variant(PRSSEL_A::PRSCH10)
212 }
213 #[doc = "PRS Channel 11 selected"]
214 #[inline(always)]
215 pub fn prsch11(self) -> &'a mut W {
216 self.variant(PRSSEL_A::PRSCH11)
217 }
218}
219impl R {
220 #[doc = "Bits 6:9 - DMA Request 1 PRS Channel Select"]
221 #[inline(always)]
222 pub fn prssel(&self) -> PRSSEL_R {
223 PRSSEL_R::new(((self.bits >> 6) & 0x0f) as u8)
224 }
225}
226impl W {
227 #[doc = "Bits 6:9 - DMA Request 1 PRS Channel Select"]
228 #[inline(always)]
229 pub fn prssel(&mut self) -> PRSSEL_W {
230 PRSSEL_W::new(self)
231 }
232 #[doc = "Writes raw bits to the register."]
233 #[inline(always)]
234 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
235 self.0.bits(bits);
236 self
237 }
238}
239#[doc = "DMA Request 1 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 [dmareq1](index.html) module"]
240pub struct DMAREQ1_SPEC;
241impl crate::RegisterSpec for DMAREQ1_SPEC {
242 type Ux = u32;
243}
244#[doc = "`read()` method returns [dmareq1::R](R) reader structure"]
245impl crate::Readable for DMAREQ1_SPEC {
246 type Reader = R;
247}
248#[doc = "`write(|w| ..)` method takes [dmareq1::W](W) writer structure"]
249impl crate::Writable for DMAREQ1_SPEC {
250 type Writer = W;
251}
252#[doc = "`reset()` method sets DMAREQ1 to value 0"]
253impl crate::Resettable for DMAREQ1_SPEC {
254 #[inline(always)]
255 fn reset_value() -> Self::Ux {
256 0
257 }
258}