mcxa_pac/usb0/
stall_ih_dis.rs

1#[doc = "Register `STALL_IH_DIS` reader"]
2pub type R = crate::R<StallIhDisSpec>;
3#[doc = "Register `STALL_IH_DIS` writer"]
4pub type W = crate::W<StallIhDisSpec>;
5#[doc = "Disable Endpoint 8 IN Direction\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum StallIDis8 {
9    #[doc = "0: Enable"]
10    EnEp8InStall = 0,
11    #[doc = "1: Disable"]
12    DisEp8InStall = 1,
13}
14impl From<StallIDis8> for bool {
15    #[inline(always)]
16    fn from(variant: StallIDis8) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `STALL_I_DIS8` reader - Disable Endpoint 8 IN Direction"]
21pub type StallIDis8R = crate::BitReader<StallIDis8>;
22impl StallIDis8R {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> StallIDis8 {
26        match self.bits {
27            false => StallIDis8::EnEp8InStall,
28            true => StallIDis8::DisEp8InStall,
29        }
30    }
31    #[doc = "Enable"]
32    #[inline(always)]
33    pub fn is_en_ep8_in_stall(&self) -> bool {
34        *self == StallIDis8::EnEp8InStall
35    }
36    #[doc = "Disable"]
37    #[inline(always)]
38    pub fn is_dis_ep8_in_stall(&self) -> bool {
39        *self == StallIDis8::DisEp8InStall
40    }
41}
42#[doc = "Field `STALL_I_DIS8` writer - Disable Endpoint 8 IN Direction"]
43pub type StallIDis8W<'a, REG> = crate::BitWriter<'a, REG, StallIDis8>;
44impl<'a, REG> StallIDis8W<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Enable"]
49    #[inline(always)]
50    pub fn en_ep8_in_stall(self) -> &'a mut crate::W<REG> {
51        self.variant(StallIDis8::EnEp8InStall)
52    }
53    #[doc = "Disable"]
54    #[inline(always)]
55    pub fn dis_ep8_in_stall(self) -> &'a mut crate::W<REG> {
56        self.variant(StallIDis8::DisEp8InStall)
57    }
58}
59#[doc = "Disable Endpoint 9 IN Direction\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum StallIDis9 {
63    #[doc = "0: Enable"]
64    EnEp9InStall = 0,
65    #[doc = "1: Disable"]
66    DisEp9InStall = 1,
67}
68impl From<StallIDis9> for bool {
69    #[inline(always)]
70    fn from(variant: StallIDis9) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `STALL_I_DIS9` reader - Disable Endpoint 9 IN Direction"]
75pub type StallIDis9R = crate::BitReader<StallIDis9>;
76impl StallIDis9R {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> StallIDis9 {
80        match self.bits {
81            false => StallIDis9::EnEp9InStall,
82            true => StallIDis9::DisEp9InStall,
83        }
84    }
85    #[doc = "Enable"]
86    #[inline(always)]
87    pub fn is_en_ep9_in_stall(&self) -> bool {
88        *self == StallIDis9::EnEp9InStall
89    }
90    #[doc = "Disable"]
91    #[inline(always)]
92    pub fn is_dis_ep9_in_stall(&self) -> bool {
93        *self == StallIDis9::DisEp9InStall
94    }
95}
96#[doc = "Field `STALL_I_DIS9` writer - Disable Endpoint 9 IN Direction"]
97pub type StallIDis9W<'a, REG> = crate::BitWriter<'a, REG, StallIDis9>;
98impl<'a, REG> StallIDis9W<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Enable"]
103    #[inline(always)]
104    pub fn en_ep9_in_stall(self) -> &'a mut crate::W<REG> {
105        self.variant(StallIDis9::EnEp9InStall)
106    }
107    #[doc = "Disable"]
108    #[inline(always)]
109    pub fn dis_ep9_in_stall(self) -> &'a mut crate::W<REG> {
110        self.variant(StallIDis9::DisEp9InStall)
111    }
112}
113#[doc = "Disable Endpoint 10 IN Direction\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum StallIDis10 {
117    #[doc = "0: Enable"]
118    EnEp10InStall = 0,
119    #[doc = "1: Disable"]
120    DisEp10InStall = 1,
121}
122impl From<StallIDis10> for bool {
123    #[inline(always)]
124    fn from(variant: StallIDis10) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `STALL_I_DIS10` reader - Disable Endpoint 10 IN Direction"]
129pub type StallIDis10R = crate::BitReader<StallIDis10>;
130impl StallIDis10R {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> StallIDis10 {
134        match self.bits {
135            false => StallIDis10::EnEp10InStall,
136            true => StallIDis10::DisEp10InStall,
137        }
138    }
139    #[doc = "Enable"]
140    #[inline(always)]
141    pub fn is_en_ep10_in_stall(&self) -> bool {
142        *self == StallIDis10::EnEp10InStall
143    }
144    #[doc = "Disable"]
145    #[inline(always)]
146    pub fn is_dis_ep10_in_stall(&self) -> bool {
147        *self == StallIDis10::DisEp10InStall
148    }
149}
150#[doc = "Field `STALL_I_DIS10` writer - Disable Endpoint 10 IN Direction"]
151pub type StallIDis10W<'a, REG> = crate::BitWriter<'a, REG, StallIDis10>;
152impl<'a, REG> StallIDis10W<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "Enable"]
157    #[inline(always)]
158    pub fn en_ep10_in_stall(self) -> &'a mut crate::W<REG> {
159        self.variant(StallIDis10::EnEp10InStall)
160    }
161    #[doc = "Disable"]
162    #[inline(always)]
163    pub fn dis_ep10_in_stall(self) -> &'a mut crate::W<REG> {
164        self.variant(StallIDis10::DisEp10InStall)
165    }
166}
167#[doc = "Disable Endpoint 11 IN Direction\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum StallIDis11 {
171    #[doc = "0: Enable"]
172    EnEp11InStall = 0,
173    #[doc = "1: Disable"]
174    DisEp11InStall = 1,
175}
176impl From<StallIDis11> for bool {
177    #[inline(always)]
178    fn from(variant: StallIDis11) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `STALL_I_DIS11` reader - Disable Endpoint 11 IN Direction"]
183pub type StallIDis11R = crate::BitReader<StallIDis11>;
184impl StallIDis11R {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> StallIDis11 {
188        match self.bits {
189            false => StallIDis11::EnEp11InStall,
190            true => StallIDis11::DisEp11InStall,
191        }
192    }
193    #[doc = "Enable"]
194    #[inline(always)]
195    pub fn is_en_ep11_in_stall(&self) -> bool {
196        *self == StallIDis11::EnEp11InStall
197    }
198    #[doc = "Disable"]
199    #[inline(always)]
200    pub fn is_dis_ep11_in_stall(&self) -> bool {
201        *self == StallIDis11::DisEp11InStall
202    }
203}
204#[doc = "Field `STALL_I_DIS11` writer - Disable Endpoint 11 IN Direction"]
205pub type StallIDis11W<'a, REG> = crate::BitWriter<'a, REG, StallIDis11>;
206impl<'a, REG> StallIDis11W<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "Enable"]
211    #[inline(always)]
212    pub fn en_ep11_in_stall(self) -> &'a mut crate::W<REG> {
213        self.variant(StallIDis11::EnEp11InStall)
214    }
215    #[doc = "Disable"]
216    #[inline(always)]
217    pub fn dis_ep11_in_stall(self) -> &'a mut crate::W<REG> {
218        self.variant(StallIDis11::DisEp11InStall)
219    }
220}
221#[doc = "Disable Endpoint 12 IN Direction\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum StallIDis12 {
225    #[doc = "0: Enable"]
226    EnEp12InStall = 0,
227    #[doc = "1: Disable"]
228    DisEp12InStall = 1,
229}
230impl From<StallIDis12> for bool {
231    #[inline(always)]
232    fn from(variant: StallIDis12) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `STALL_I_DIS12` reader - Disable Endpoint 12 IN Direction"]
237pub type StallIDis12R = crate::BitReader<StallIDis12>;
238impl StallIDis12R {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> StallIDis12 {
242        match self.bits {
243            false => StallIDis12::EnEp12InStall,
244            true => StallIDis12::DisEp12InStall,
245        }
246    }
247    #[doc = "Enable"]
248    #[inline(always)]
249    pub fn is_en_ep12_in_stall(&self) -> bool {
250        *self == StallIDis12::EnEp12InStall
251    }
252    #[doc = "Disable"]
253    #[inline(always)]
254    pub fn is_dis_ep12_in_stall(&self) -> bool {
255        *self == StallIDis12::DisEp12InStall
256    }
257}
258#[doc = "Field `STALL_I_DIS12` writer - Disable Endpoint 12 IN Direction"]
259pub type StallIDis12W<'a, REG> = crate::BitWriter<'a, REG, StallIDis12>;
260impl<'a, REG> StallIDis12W<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "Enable"]
265    #[inline(always)]
266    pub fn en_ep12_in_stall(self) -> &'a mut crate::W<REG> {
267        self.variant(StallIDis12::EnEp12InStall)
268    }
269    #[doc = "Disable"]
270    #[inline(always)]
271    pub fn dis_ep12_in_stall(self) -> &'a mut crate::W<REG> {
272        self.variant(StallIDis12::DisEp12InStall)
273    }
274}
275#[doc = "Disable Endpoint 13 IN Direction\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum StallIDis13 {
279    #[doc = "0: Enable"]
280    EnEp13InStall = 0,
281    #[doc = "1: Disable"]
282    DisEp13InStall = 1,
283}
284impl From<StallIDis13> for bool {
285    #[inline(always)]
286    fn from(variant: StallIDis13) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `STALL_I_DIS13` reader - Disable Endpoint 13 IN Direction"]
291pub type StallIDis13R = crate::BitReader<StallIDis13>;
292impl StallIDis13R {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> StallIDis13 {
296        match self.bits {
297            false => StallIDis13::EnEp13InStall,
298            true => StallIDis13::DisEp13InStall,
299        }
300    }
301    #[doc = "Enable"]
302    #[inline(always)]
303    pub fn is_en_ep13_in_stall(&self) -> bool {
304        *self == StallIDis13::EnEp13InStall
305    }
306    #[doc = "Disable"]
307    #[inline(always)]
308    pub fn is_dis_ep13_in_stall(&self) -> bool {
309        *self == StallIDis13::DisEp13InStall
310    }
311}
312#[doc = "Field `STALL_I_DIS13` writer - Disable Endpoint 13 IN Direction"]
313pub type StallIDis13W<'a, REG> = crate::BitWriter<'a, REG, StallIDis13>;
314impl<'a, REG> StallIDis13W<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "Enable"]
319    #[inline(always)]
320    pub fn en_ep13_in_stall(self) -> &'a mut crate::W<REG> {
321        self.variant(StallIDis13::EnEp13InStall)
322    }
323    #[doc = "Disable"]
324    #[inline(always)]
325    pub fn dis_ep13_in_stall(self) -> &'a mut crate::W<REG> {
326        self.variant(StallIDis13::DisEp13InStall)
327    }
328}
329#[doc = "Disable Endpoint 14 IN Direction\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum StallIDis14 {
333    #[doc = "0: Enable"]
334    EnEp14InStall = 0,
335    #[doc = "1: Disable"]
336    DisEp14InStall = 1,
337}
338impl From<StallIDis14> for bool {
339    #[inline(always)]
340    fn from(variant: StallIDis14) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `STALL_I_DIS14` reader - Disable Endpoint 14 IN Direction"]
345pub type StallIDis14R = crate::BitReader<StallIDis14>;
346impl StallIDis14R {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub const fn variant(&self) -> StallIDis14 {
350        match self.bits {
351            false => StallIDis14::EnEp14InStall,
352            true => StallIDis14::DisEp14InStall,
353        }
354    }
355    #[doc = "Enable"]
356    #[inline(always)]
357    pub fn is_en_ep14_in_stall(&self) -> bool {
358        *self == StallIDis14::EnEp14InStall
359    }
360    #[doc = "Disable"]
361    #[inline(always)]
362    pub fn is_dis_ep14_in_stall(&self) -> bool {
363        *self == StallIDis14::DisEp14InStall
364    }
365}
366#[doc = "Field `STALL_I_DIS14` writer - Disable Endpoint 14 IN Direction"]
367pub type StallIDis14W<'a, REG> = crate::BitWriter<'a, REG, StallIDis14>;
368impl<'a, REG> StallIDis14W<'a, REG>
369where
370    REG: crate::Writable + crate::RegisterSpec,
371{
372    #[doc = "Enable"]
373    #[inline(always)]
374    pub fn en_ep14_in_stall(self) -> &'a mut crate::W<REG> {
375        self.variant(StallIDis14::EnEp14InStall)
376    }
377    #[doc = "Disable"]
378    #[inline(always)]
379    pub fn dis_ep14_in_stall(self) -> &'a mut crate::W<REG> {
380        self.variant(StallIDis14::DisEp14InStall)
381    }
382}
383#[doc = "Disable Endpoint 15 IN Direction\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum StallIDis15 {
387    #[doc = "0: Enable"]
388    EnEp15InStall = 0,
389    #[doc = "1: Disable"]
390    DisEp15InStall = 1,
391}
392impl From<StallIDis15> for bool {
393    #[inline(always)]
394    fn from(variant: StallIDis15) -> Self {
395        variant as u8 != 0
396    }
397}
398#[doc = "Field `STALL_I_DIS15` reader - Disable Endpoint 15 IN Direction"]
399pub type StallIDis15R = crate::BitReader<StallIDis15>;
400impl StallIDis15R {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub const fn variant(&self) -> StallIDis15 {
404        match self.bits {
405            false => StallIDis15::EnEp15InStall,
406            true => StallIDis15::DisEp15InStall,
407        }
408    }
409    #[doc = "Enable"]
410    #[inline(always)]
411    pub fn is_en_ep15_in_stall(&self) -> bool {
412        *self == StallIDis15::EnEp15InStall
413    }
414    #[doc = "Disable"]
415    #[inline(always)]
416    pub fn is_dis_ep15_in_stall(&self) -> bool {
417        *self == StallIDis15::DisEp15InStall
418    }
419}
420#[doc = "Field `STALL_I_DIS15` writer - Disable Endpoint 15 IN Direction"]
421pub type StallIDis15W<'a, REG> = crate::BitWriter<'a, REG, StallIDis15>;
422impl<'a, REG> StallIDis15W<'a, REG>
423where
424    REG: crate::Writable + crate::RegisterSpec,
425{
426    #[doc = "Enable"]
427    #[inline(always)]
428    pub fn en_ep15_in_stall(self) -> &'a mut crate::W<REG> {
429        self.variant(StallIDis15::EnEp15InStall)
430    }
431    #[doc = "Disable"]
432    #[inline(always)]
433    pub fn dis_ep15_in_stall(self) -> &'a mut crate::W<REG> {
434        self.variant(StallIDis15::DisEp15InStall)
435    }
436}
437impl R {
438    #[doc = "Bit 0 - Disable Endpoint 8 IN Direction"]
439    #[inline(always)]
440    pub fn stall_i_dis8(&self) -> StallIDis8R {
441        StallIDis8R::new((self.bits & 1) != 0)
442    }
443    #[doc = "Bit 1 - Disable Endpoint 9 IN Direction"]
444    #[inline(always)]
445    pub fn stall_i_dis9(&self) -> StallIDis9R {
446        StallIDis9R::new(((self.bits >> 1) & 1) != 0)
447    }
448    #[doc = "Bit 2 - Disable Endpoint 10 IN Direction"]
449    #[inline(always)]
450    pub fn stall_i_dis10(&self) -> StallIDis10R {
451        StallIDis10R::new(((self.bits >> 2) & 1) != 0)
452    }
453    #[doc = "Bit 3 - Disable Endpoint 11 IN Direction"]
454    #[inline(always)]
455    pub fn stall_i_dis11(&self) -> StallIDis11R {
456        StallIDis11R::new(((self.bits >> 3) & 1) != 0)
457    }
458    #[doc = "Bit 4 - Disable Endpoint 12 IN Direction"]
459    #[inline(always)]
460    pub fn stall_i_dis12(&self) -> StallIDis12R {
461        StallIDis12R::new(((self.bits >> 4) & 1) != 0)
462    }
463    #[doc = "Bit 5 - Disable Endpoint 13 IN Direction"]
464    #[inline(always)]
465    pub fn stall_i_dis13(&self) -> StallIDis13R {
466        StallIDis13R::new(((self.bits >> 5) & 1) != 0)
467    }
468    #[doc = "Bit 6 - Disable Endpoint 14 IN Direction"]
469    #[inline(always)]
470    pub fn stall_i_dis14(&self) -> StallIDis14R {
471        StallIDis14R::new(((self.bits >> 6) & 1) != 0)
472    }
473    #[doc = "Bit 7 - Disable Endpoint 15 IN Direction"]
474    #[inline(always)]
475    pub fn stall_i_dis15(&self) -> StallIDis15R {
476        StallIDis15R::new(((self.bits >> 7) & 1) != 0)
477    }
478}
479#[cfg(feature = "debug")]
480impl core::fmt::Debug for R {
481    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
482        f.debug_struct("STALL_IH_DIS")
483            .field("stall_i_dis8", &self.stall_i_dis8())
484            .field("stall_i_dis9", &self.stall_i_dis9())
485            .field("stall_i_dis10", &self.stall_i_dis10())
486            .field("stall_i_dis11", &self.stall_i_dis11())
487            .field("stall_i_dis12", &self.stall_i_dis12())
488            .field("stall_i_dis13", &self.stall_i_dis13())
489            .field("stall_i_dis14", &self.stall_i_dis14())
490            .field("stall_i_dis15", &self.stall_i_dis15())
491            .finish()
492    }
493}
494impl W {
495    #[doc = "Bit 0 - Disable Endpoint 8 IN Direction"]
496    #[inline(always)]
497    pub fn stall_i_dis8(&mut self) -> StallIDis8W<'_, StallIhDisSpec> {
498        StallIDis8W::new(self, 0)
499    }
500    #[doc = "Bit 1 - Disable Endpoint 9 IN Direction"]
501    #[inline(always)]
502    pub fn stall_i_dis9(&mut self) -> StallIDis9W<'_, StallIhDisSpec> {
503        StallIDis9W::new(self, 1)
504    }
505    #[doc = "Bit 2 - Disable Endpoint 10 IN Direction"]
506    #[inline(always)]
507    pub fn stall_i_dis10(&mut self) -> StallIDis10W<'_, StallIhDisSpec> {
508        StallIDis10W::new(self, 2)
509    }
510    #[doc = "Bit 3 - Disable Endpoint 11 IN Direction"]
511    #[inline(always)]
512    pub fn stall_i_dis11(&mut self) -> StallIDis11W<'_, StallIhDisSpec> {
513        StallIDis11W::new(self, 3)
514    }
515    #[doc = "Bit 4 - Disable Endpoint 12 IN Direction"]
516    #[inline(always)]
517    pub fn stall_i_dis12(&mut self) -> StallIDis12W<'_, StallIhDisSpec> {
518        StallIDis12W::new(self, 4)
519    }
520    #[doc = "Bit 5 - Disable Endpoint 13 IN Direction"]
521    #[inline(always)]
522    pub fn stall_i_dis13(&mut self) -> StallIDis13W<'_, StallIhDisSpec> {
523        StallIDis13W::new(self, 5)
524    }
525    #[doc = "Bit 6 - Disable Endpoint 14 IN Direction"]
526    #[inline(always)]
527    pub fn stall_i_dis14(&mut self) -> StallIDis14W<'_, StallIhDisSpec> {
528        StallIDis14W::new(self, 6)
529    }
530    #[doc = "Bit 7 - Disable Endpoint 15 IN Direction"]
531    #[inline(always)]
532    pub fn stall_i_dis15(&mut self) -> StallIDis15W<'_, StallIhDisSpec> {
533        StallIDis15W::new(self, 7)
534    }
535}
536#[doc = "Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction\n\nYou can [`read`](crate::Reg::read) this register and get [`stall_ih_dis::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`stall_ih_dis::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
537pub struct StallIhDisSpec;
538impl crate::RegisterSpec for StallIhDisSpec {
539    type Ux = u8;
540}
541#[doc = "`read()` method returns [`stall_ih_dis::R`](R) reader structure"]
542impl crate::Readable for StallIhDisSpec {}
543#[doc = "`write(|w| ..)` method takes [`stall_ih_dis::W`](W) writer structure"]
544impl crate::Writable for StallIhDisSpec {
545    type Safety = crate::Unsafe;
546}
547#[doc = "`reset()` method sets STALL_IH_DIS to value 0"]
548impl crate::Resettable for StallIhDisSpec {}