1pub type R = crate::R<EPRrs>;
3pub type W = crate::W<EPRrs>;
5pub type EA_R = crate::FieldReader;
7pub type EA_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14#[repr(u8)]
15pub enum STAT_TXR {
16 Disabled = 0,
18 Stall = 1,
20 Nak = 2,
22 Valid = 3,
24}
25impl From<STAT_TXR> for u8 {
26 #[inline(always)]
27 fn from(variant: STAT_TXR) -> Self {
28 variant as _
29 }
30}
31impl crate::FieldSpec for STAT_TXR {
32 type Ux = u8;
33}
34impl crate::IsEnum for STAT_TXR {}
35pub type STAT_TX_R = crate::FieldReader<STAT_TXR>;
37impl STAT_TX_R {
38 #[inline(always)]
40 pub const fn variant(&self) -> STAT_TXR {
41 match self.bits {
42 0 => STAT_TXR::Disabled,
43 1 => STAT_TXR::Stall,
44 2 => STAT_TXR::Nak,
45 3 => STAT_TXR::Valid,
46 _ => unreachable!(),
47 }
48 }
49 #[inline(always)]
51 pub fn is_disabled(&self) -> bool {
52 *self == STAT_TXR::Disabled
53 }
54 #[inline(always)]
56 pub fn is_stall(&self) -> bool {
57 *self == STAT_TXR::Stall
58 }
59 #[inline(always)]
61 pub fn is_nak(&self) -> bool {
62 *self == STAT_TXR::Nak
63 }
64 #[inline(always)]
66 pub fn is_valid(&self) -> bool {
67 *self == STAT_TXR::Valid
68 }
69}
70pub type STAT_TX_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STAT_TXR, crate::Safe>;
72impl<'a, REG> STAT_TX_W<'a, REG>
73where
74 REG: crate::Writable + crate::RegisterSpec,
75 REG::Ux: From<u8>,
76{
77 #[inline(always)]
79 pub fn disabled(self) -> &'a mut crate::W<REG> {
80 self.variant(STAT_TXR::Disabled)
81 }
82 #[inline(always)]
84 pub fn stall(self) -> &'a mut crate::W<REG> {
85 self.variant(STAT_TXR::Stall)
86 }
87 #[inline(always)]
89 pub fn nak(self) -> &'a mut crate::W<REG> {
90 self.variant(STAT_TXR::Nak)
91 }
92 #[inline(always)]
94 pub fn valid(self) -> &'a mut crate::W<REG> {
95 self.variant(STAT_TXR::Valid)
96 }
97}
98pub type DTOG_TX_R = crate::BitReader;
100pub type DTOG_TX_W<'a, REG> = crate::BitWriter1T<'a, REG>;
102pub type CTR_TX_R = crate::BitReader;
104pub type CTR_TX_W<'a, REG> = crate::BitWriter0C<'a, REG>;
106pub type EP_KIND_R = crate::BitReader;
108pub type EP_KIND_W<'a, REG> = crate::BitWriter<'a, REG>;
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115#[repr(u8)]
116pub enum EP_TYPE {
117 Bulk = 0,
119 Control = 1,
121 Iso = 2,
123 Interrupt = 3,
125}
126impl From<EP_TYPE> for u8 {
127 #[inline(always)]
128 fn from(variant: EP_TYPE) -> Self {
129 variant as _
130 }
131}
132impl crate::FieldSpec for EP_TYPE {
133 type Ux = u8;
134}
135impl crate::IsEnum for EP_TYPE {}
136pub type EP_TYPE_R = crate::FieldReader<EP_TYPE>;
138impl EP_TYPE_R {
139 #[inline(always)]
141 pub const fn variant(&self) -> EP_TYPE {
142 match self.bits {
143 0 => EP_TYPE::Bulk,
144 1 => EP_TYPE::Control,
145 2 => EP_TYPE::Iso,
146 3 => EP_TYPE::Interrupt,
147 _ => unreachable!(),
148 }
149 }
150 #[inline(always)]
152 pub fn is_bulk(&self) -> bool {
153 *self == EP_TYPE::Bulk
154 }
155 #[inline(always)]
157 pub fn is_control(&self) -> bool {
158 *self == EP_TYPE::Control
159 }
160 #[inline(always)]
162 pub fn is_iso(&self) -> bool {
163 *self == EP_TYPE::Iso
164 }
165 #[inline(always)]
167 pub fn is_interrupt(&self) -> bool {
168 *self == EP_TYPE::Interrupt
169 }
170}
171pub type EP_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EP_TYPE, crate::Safe>;
173impl<'a, REG> EP_TYPE_W<'a, REG>
174where
175 REG: crate::Writable + crate::RegisterSpec,
176 REG::Ux: From<u8>,
177{
178 #[inline(always)]
180 pub fn bulk(self) -> &'a mut crate::W<REG> {
181 self.variant(EP_TYPE::Bulk)
182 }
183 #[inline(always)]
185 pub fn control(self) -> &'a mut crate::W<REG> {
186 self.variant(EP_TYPE::Control)
187 }
188 #[inline(always)]
190 pub fn iso(self) -> &'a mut crate::W<REG> {
191 self.variant(EP_TYPE::Iso)
192 }
193 #[inline(always)]
195 pub fn interrupt(self) -> &'a mut crate::W<REG> {
196 self.variant(EP_TYPE::Interrupt)
197 }
198}
199pub type SETUP_R = crate::BitReader;
201pub type SETUP_W<'a, REG> = crate::BitWriter<'a, REG>;
203#[cfg_attr(feature = "defmt", derive(defmt::Format))]
207#[derive(Clone, Copy, Debug, PartialEq, Eq)]
208#[repr(u8)]
209pub enum STAT_RXR {
210 Disabled = 0,
212 Stall = 1,
214 Nak = 2,
216 Valid = 3,
218}
219impl From<STAT_RXR> for u8 {
220 #[inline(always)]
221 fn from(variant: STAT_RXR) -> Self {
222 variant as _
223 }
224}
225impl crate::FieldSpec for STAT_RXR {
226 type Ux = u8;
227}
228impl crate::IsEnum for STAT_RXR {}
229pub type STAT_RX_R = crate::FieldReader<STAT_RXR>;
231impl STAT_RX_R {
232 #[inline(always)]
234 pub const fn variant(&self) -> STAT_RXR {
235 match self.bits {
236 0 => STAT_RXR::Disabled,
237 1 => STAT_RXR::Stall,
238 2 => STAT_RXR::Nak,
239 3 => STAT_RXR::Valid,
240 _ => unreachable!(),
241 }
242 }
243 #[inline(always)]
245 pub fn is_disabled(&self) -> bool {
246 *self == STAT_RXR::Disabled
247 }
248 #[inline(always)]
250 pub fn is_stall(&self) -> bool {
251 *self == STAT_RXR::Stall
252 }
253 #[inline(always)]
255 pub fn is_nak(&self) -> bool {
256 *self == STAT_RXR::Nak
257 }
258 #[inline(always)]
260 pub fn is_valid(&self) -> bool {
261 *self == STAT_RXR::Valid
262 }
263}
264pub type STAT_RX_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STAT_RXR, crate::Safe>;
266impl<'a, REG> STAT_RX_W<'a, REG>
267where
268 REG: crate::Writable + crate::RegisterSpec,
269 REG::Ux: From<u8>,
270{
271 #[inline(always)]
273 pub fn disabled(self) -> &'a mut crate::W<REG> {
274 self.variant(STAT_RXR::Disabled)
275 }
276 #[inline(always)]
278 pub fn stall(self) -> &'a mut crate::W<REG> {
279 self.variant(STAT_RXR::Stall)
280 }
281 #[inline(always)]
283 pub fn nak(self) -> &'a mut crate::W<REG> {
284 self.variant(STAT_RXR::Nak)
285 }
286 #[inline(always)]
288 pub fn valid(self) -> &'a mut crate::W<REG> {
289 self.variant(STAT_RXR::Valid)
290 }
291}
292pub type DTOG_RX_R = crate::BitReader;
294pub type DTOG_RX_W<'a, REG> = crate::BitWriter1T<'a, REG>;
296pub type CTR_RX_R = crate::BitReader;
298pub type CTR_RX_W<'a, REG> = crate::BitWriter0C<'a, REG>;
300impl R {
301 #[inline(always)]
303 pub fn ea(&self) -> EA_R {
304 EA_R::new((self.bits & 0x0f) as u8)
305 }
306 #[inline(always)]
308 pub fn stat_tx(&self) -> STAT_TX_R {
309 STAT_TX_R::new(((self.bits >> 4) & 3) as u8)
310 }
311 #[inline(always)]
313 pub fn dtog_tx(&self) -> DTOG_TX_R {
314 DTOG_TX_R::new(((self.bits >> 6) & 1) != 0)
315 }
316 #[inline(always)]
318 pub fn ctr_tx(&self) -> CTR_TX_R {
319 CTR_TX_R::new(((self.bits >> 7) & 1) != 0)
320 }
321 #[inline(always)]
323 pub fn ep_kind(&self) -> EP_KIND_R {
324 EP_KIND_R::new(((self.bits >> 8) & 1) != 0)
325 }
326 #[inline(always)]
328 pub fn ep_type(&self) -> EP_TYPE_R {
329 EP_TYPE_R::new(((self.bits >> 9) & 3) as u8)
330 }
331 #[inline(always)]
333 pub fn setup(&self) -> SETUP_R {
334 SETUP_R::new(((self.bits >> 11) & 1) != 0)
335 }
336 #[inline(always)]
338 pub fn stat_rx(&self) -> STAT_RX_R {
339 STAT_RX_R::new(((self.bits >> 12) & 3) as u8)
340 }
341 #[inline(always)]
343 pub fn dtog_rx(&self) -> DTOG_RX_R {
344 DTOG_RX_R::new(((self.bits >> 14) & 1) != 0)
345 }
346 #[inline(always)]
348 pub fn ctr_rx(&self) -> CTR_RX_R {
349 CTR_RX_R::new(((self.bits >> 15) & 1) != 0)
350 }
351}
352impl core::fmt::Debug for R {
353 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
354 f.debug_struct("EPR")
355 .field("ea", &self.ea())
356 .field("stat_tx", &self.stat_tx())
357 .field("dtog_tx", &self.dtog_tx())
358 .field("ctr_tx", &self.ctr_tx())
359 .field("ep_kind", &self.ep_kind())
360 .field("ep_type", &self.ep_type())
361 .field("setup", &self.setup())
362 .field("stat_rx", &self.stat_rx())
363 .field("dtog_rx", &self.dtog_rx())
364 .field("ctr_rx", &self.ctr_rx())
365 .finish()
366 }
367}
368impl W {
369 #[inline(always)]
371 pub fn ea(&mut self) -> EA_W<EPRrs> {
372 EA_W::new(self, 0)
373 }
374 #[inline(always)]
376 pub fn stat_tx(&mut self) -> STAT_TX_W<EPRrs> {
377 STAT_TX_W::new(self, 4)
378 }
379 #[inline(always)]
381 pub fn dtog_tx(&mut self) -> DTOG_TX_W<EPRrs> {
382 DTOG_TX_W::new(self, 6)
383 }
384 #[inline(always)]
386 pub fn ctr_tx(&mut self) -> CTR_TX_W<EPRrs> {
387 CTR_TX_W::new(self, 7)
388 }
389 #[inline(always)]
391 pub fn ep_kind(&mut self) -> EP_KIND_W<EPRrs> {
392 EP_KIND_W::new(self, 8)
393 }
394 #[inline(always)]
396 pub fn ep_type(&mut self) -> EP_TYPE_W<EPRrs> {
397 EP_TYPE_W::new(self, 9)
398 }
399 #[inline(always)]
401 pub fn setup(&mut self) -> SETUP_W<EPRrs> {
402 SETUP_W::new(self, 11)
403 }
404 #[inline(always)]
406 pub fn stat_rx(&mut self) -> STAT_RX_W<EPRrs> {
407 STAT_RX_W::new(self, 12)
408 }
409 #[inline(always)]
411 pub fn dtog_rx(&mut self) -> DTOG_RX_W<EPRrs> {
412 DTOG_RX_W::new(self, 14)
413 }
414 #[inline(always)]
416 pub fn ctr_rx(&mut self) -> CTR_RX_W<EPRrs> {
417 CTR_RX_W::new(self, 15)
418 }
419}
420pub struct EPRrs;
426impl crate::RegisterSpec for EPRrs {
427 type Ux = u32;
428}
429impl crate::Readable for EPRrs {}
431impl crate::Writable for EPRrs {
433 type Safety = crate::Unsafe;
434 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x8080;
435 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x7070;
436}
437impl crate::Resettable for EPRrs {}