bl702_pac/usb/
ep6_config.rs

1#[doc = "Register `ep6_config` reader"]
2pub struct R(crate::R<EP6_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<EP6_CONFIG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<EP6_CONFIG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<EP6_CONFIG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ep6_config` writer"]
17pub struct W(crate::W<EP6_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<EP6_CONFIG_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<EP6_CONFIG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<EP6_CONFIG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `cr_ep6_size` reader - "]
38pub type CR_EP6_SIZE_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `cr_ep6_size` writer - "]
40pub type CR_EP6_SIZE_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, EP6_CONFIG_SPEC, u16, u16, 11, O>;
42#[doc = "Field `cr_ep6_dir` reader - "]
43pub type CR_EP6_DIR_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `cr_ep6_dir` writer - "]
45pub type CR_EP6_DIR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EP6_CONFIG_SPEC, u8, u8, 2, O>;
46#[doc = "Field `cr_ep6_type` reader - "]
47pub type CR_EP6_TYPE_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `cr_ep6_type` writer - "]
49pub type CR_EP6_TYPE_W<'a, const O: u8> =
50    crate::FieldWriter<'a, u32, EP6_CONFIG_SPEC, u8, u8, 3, O>;
51#[doc = "Field `cr_ep6_stall` reader - "]
52pub type CR_EP6_STALL_R = crate::BitReader<bool>;
53#[doc = "Field `cr_ep6_stall` writer - "]
54pub type CR_EP6_STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, EP6_CONFIG_SPEC, bool, O>;
55#[doc = "Field `cr_ep6_nack` reader - "]
56pub type CR_EP6_NACK_R = crate::BitReader<bool>;
57#[doc = "Field `cr_ep6_nack` writer - "]
58pub type CR_EP6_NACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, EP6_CONFIG_SPEC, bool, O>;
59#[doc = "Field `cr_ep6_rdy` reader - "]
60pub type CR_EP6_RDY_R = crate::BitReader<bool>;
61#[doc = "Field `cr_ep6_rdy` writer - "]
62pub type CR_EP6_RDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, EP6_CONFIG_SPEC, bool, O>;
63#[doc = "Field `sts_ep6_rdy` reader - "]
64pub type STS_EP6_RDY_R = crate::BitReader<bool>;
65#[doc = "Field `sts_ep6_rdy` writer - "]
66pub type STS_EP6_RDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, EP6_CONFIG_SPEC, bool, O>;
67impl R {
68    #[doc = "Bits 0:10"]
69    #[inline(always)]
70    pub fn cr_ep6_size(&self) -> CR_EP6_SIZE_R {
71        CR_EP6_SIZE_R::new((self.bits & 0x07ff) as u16)
72    }
73    #[doc = "Bits 11:12"]
74    #[inline(always)]
75    pub fn cr_ep6_dir(&self) -> CR_EP6_DIR_R {
76        CR_EP6_DIR_R::new(((self.bits >> 11) & 3) as u8)
77    }
78    #[doc = "Bits 13:15"]
79    #[inline(always)]
80    pub fn cr_ep6_type(&self) -> CR_EP6_TYPE_R {
81        CR_EP6_TYPE_R::new(((self.bits >> 13) & 7) as u8)
82    }
83    #[doc = "Bit 16"]
84    #[inline(always)]
85    pub fn cr_ep6_stall(&self) -> CR_EP6_STALL_R {
86        CR_EP6_STALL_R::new(((self.bits >> 16) & 1) != 0)
87    }
88    #[doc = "Bit 17"]
89    #[inline(always)]
90    pub fn cr_ep6_nack(&self) -> CR_EP6_NACK_R {
91        CR_EP6_NACK_R::new(((self.bits >> 17) & 1) != 0)
92    }
93    #[doc = "Bit 18"]
94    #[inline(always)]
95    pub fn cr_ep6_rdy(&self) -> CR_EP6_RDY_R {
96        CR_EP6_RDY_R::new(((self.bits >> 18) & 1) != 0)
97    }
98    #[doc = "Bit 19"]
99    #[inline(always)]
100    pub fn sts_ep6_rdy(&self) -> STS_EP6_RDY_R {
101        STS_EP6_RDY_R::new(((self.bits >> 19) & 1) != 0)
102    }
103}
104impl W {
105    #[doc = "Bits 0:10"]
106    #[inline(always)]
107    #[must_use]
108    pub fn cr_ep6_size(&mut self) -> CR_EP6_SIZE_W<0> {
109        CR_EP6_SIZE_W::new(self)
110    }
111    #[doc = "Bits 11:12"]
112    #[inline(always)]
113    #[must_use]
114    pub fn cr_ep6_dir(&mut self) -> CR_EP6_DIR_W<11> {
115        CR_EP6_DIR_W::new(self)
116    }
117    #[doc = "Bits 13:15"]
118    #[inline(always)]
119    #[must_use]
120    pub fn cr_ep6_type(&mut self) -> CR_EP6_TYPE_W<13> {
121        CR_EP6_TYPE_W::new(self)
122    }
123    #[doc = "Bit 16"]
124    #[inline(always)]
125    #[must_use]
126    pub fn cr_ep6_stall(&mut self) -> CR_EP6_STALL_W<16> {
127        CR_EP6_STALL_W::new(self)
128    }
129    #[doc = "Bit 17"]
130    #[inline(always)]
131    #[must_use]
132    pub fn cr_ep6_nack(&mut self) -> CR_EP6_NACK_W<17> {
133        CR_EP6_NACK_W::new(self)
134    }
135    #[doc = "Bit 18"]
136    #[inline(always)]
137    #[must_use]
138    pub fn cr_ep6_rdy(&mut self) -> CR_EP6_RDY_W<18> {
139        CR_EP6_RDY_W::new(self)
140    }
141    #[doc = "Bit 19"]
142    #[inline(always)]
143    #[must_use]
144    pub fn sts_ep6_rdy(&mut self) -> STS_EP6_RDY_W<19> {
145        STS_EP6_RDY_W::new(self)
146    }
147    #[doc = "Writes raw bits to the register."]
148    #[inline(always)]
149    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
150        self.0.bits(bits);
151        self
152    }
153}
154#[doc = "ep6_config.\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 [ep6_config](index.html) module"]
155pub struct EP6_CONFIG_SPEC;
156impl crate::RegisterSpec for EP6_CONFIG_SPEC {
157    type Ux = u32;
158}
159#[doc = "`read()` method returns [ep6_config::R](R) reader structure"]
160impl crate::Readable for EP6_CONFIG_SPEC {
161    type Reader = R;
162}
163#[doc = "`write(|w| ..)` method takes [ep6_config::W](W) writer structure"]
164impl crate::Writable for EP6_CONFIG_SPEC {
165    type Writer = W;
166    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
167    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
168}
169#[doc = "`reset()` method sets ep6_config to value 0"]
170impl crate::Resettable for EP6_CONFIG_SPEC {
171    const RESET_VALUE: Self::Ux = 0;
172}