gd32f2/gd32f207/
usbfs_global.rs1#[repr(C)]
2#[doc = "Register block"]
3pub struct RegisterBlock {
4 gotgcs: Gotgcs,
5 gotgintf: Gotgintf,
6 gahbcs: Gahbcs,
7 gusbcs: Gusbcs,
8 grstctl: Grstctl,
9 gintf: Gintf,
10 ginten: Ginten,
11 _reserved_7_grstatr: [u8; 0x04],
12 _reserved_8_grstatp: [u8; 0x04],
13 grflen: Grflen,
14 _reserved_10_hnptflen: [u8; 0x04],
15 hnptfqstat: Hnptfqstat,
16 _reserved12: [u8; 0x08],
17 gccfg: Gccfg,
18 cid: Cid,
19 _reserved14: [u8; 0xc0],
20 hptflen: Hptflen,
21 diep1tflen: Diep1tflen,
22 diep2tflen: Diep2tflen,
23 diep3tflen: Diep3tflen,
24}
25impl RegisterBlock {
26 #[doc = "0x00 - Global OTG control and status register (USBFS_GOTGCS)"]
27 #[inline(always)]
28 pub const fn gotgcs(&self) -> &Gotgcs {
29 &self.gotgcs
30 }
31 #[doc = "0x04 - Global OTG interrupt flag register (USBFS_GOTGINTF)"]
32 #[inline(always)]
33 pub const fn gotgintf(&self) -> &Gotgintf {
34 &self.gotgintf
35 }
36 #[doc = "0x08 - Global AHB control and status register (USBFS_GAHBCS)"]
37 #[inline(always)]
38 pub const fn gahbcs(&self) -> &Gahbcs {
39 &self.gahbcs
40 }
41 #[doc = "0x0c - Global USB control and status register (OTG_FS_GUSBCSR)"]
42 #[inline(always)]
43 pub const fn gusbcs(&self) -> &Gusbcs {
44 &self.gusbcs
45 }
46 #[doc = "0x10 - Global reset control register (USBFS_GRSTCTL)"]
47 #[inline(always)]
48 pub const fn grstctl(&self) -> &Grstctl {
49 &self.grstctl
50 }
51 #[doc = "0x14 - Global interrupt flag register (USBFS_GINTF)"]
52 #[inline(always)]
53 pub const fn gintf(&self) -> &Gintf {
54 &self.gintf
55 }
56 #[doc = "0x18 - Global interrupt enable register (USBFS_GINTEN)"]
57 #[inline(always)]
58 pub const fn ginten(&self) -> &Ginten {
59 &self.ginten
60 }
61 #[doc = "0x1c - Global Receive status read(Host mode)"]
62 #[inline(always)]
63 pub const fn grstatr_host(&self) -> &GrstatrHost {
64 unsafe { &*(self as *const Self).cast::<u8>().add(28).cast() }
65 }
66 #[doc = "0x1c - Global Receive status read(Device mode)"]
67 #[inline(always)]
68 pub const fn grstatr_device(&self) -> &GrstatrDevice {
69 unsafe { &*(self as *const Self).cast::<u8>().add(28).cast() }
70 }
71 #[doc = "0x20 - Global Receive status pop(Host mode)"]
72 #[inline(always)]
73 pub const fn grstatp_host(&self) -> &GrstatpHost {
74 unsafe { &*(self as *const Self).cast::<u8>().add(32).cast() }
75 }
76 #[doc = "0x20 - Global Receive status pop(Device mode)"]
77 #[inline(always)]
78 pub const fn grstatp_device(&self) -> &GrstatpDevice {
79 unsafe { &*(self as *const Self).cast::<u8>().add(32).cast() }
80 }
81 #[doc = "0x24 - Global Receive FIFO size register (USBFS_GRFLEN)"]
82 #[inline(always)]
83 pub const fn grflen(&self) -> &Grflen {
84 &self.grflen
85 }
86 #[doc = "0x28 - Device IN endpoint 0 transmit FIFO length (Device mode)"]
87 #[inline(always)]
88 pub const fn diep0tflen(&self) -> &Diep0tflen {
89 unsafe { &*(self as *const Self).cast::<u8>().add(40).cast() }
90 }
91 #[doc = "0x28 - Host non-periodic transmit FIFO length register (Host mode)"]
92 #[inline(always)]
93 pub const fn hnptflen(&self) -> &Hnptflen {
94 unsafe { &*(self as *const Self).cast::<u8>().add(40).cast() }
95 }
96 #[doc = "0x2c - Host non-periodic transmit FIFO/queue status register (HNPTFQSTAT)"]
97 #[inline(always)]
98 pub const fn hnptfqstat(&self) -> &Hnptfqstat {
99 &self.hnptfqstat
100 }
101 #[doc = "0x38 - Global core configuration register (USBFS_GCCFG)"]
102 #[inline(always)]
103 pub const fn gccfg(&self) -> &Gccfg {
104 &self.gccfg
105 }
106 #[doc = "0x3c - core ID register"]
107 #[inline(always)]
108 pub const fn cid(&self) -> &Cid {
109 &self.cid
110 }
111 #[doc = "0x100 - Host periodic transmit FIFO length register (HPTFLEN)"]
112 #[inline(always)]
113 pub const fn hptflen(&self) -> &Hptflen {
114 &self.hptflen
115 }
116 #[doc = "0x104 - device IN endpoint transmit FIFO size register (DIEP1TFLEN)"]
117 #[inline(always)]
118 pub const fn diep1tflen(&self) -> &Diep1tflen {
119 &self.diep1tflen
120 }
121 #[doc = "0x108 - device IN endpoint transmit FIFO size register (DIEP2TFLEN)"]
122 #[inline(always)]
123 pub const fn diep2tflen(&self) -> &Diep2tflen {
124 &self.diep2tflen
125 }
126 #[doc = "0x10c - device IN endpoint transmit FIFO size register (FS_DIEP3TXFLEN)"]
127 #[inline(always)]
128 pub const fn diep3tflen(&self) -> &Diep3tflen {
129 &self.diep3tflen
130 }
131}
132#[doc = "GOTGCS (rw) register accessor: Global OTG control and status register (USBFS_GOTGCS)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgcs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgcs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gotgcs`]
133module"]
134#[doc(alias = "GOTGCS")]
135pub type Gotgcs = crate::Reg<gotgcs::GotgcsSpec>;
136#[doc = "Global OTG control and status register (USBFS_GOTGCS)"]
137pub mod gotgcs;
138#[doc = "GOTGINTF (rw) register accessor: Global OTG interrupt flag register (USBFS_GOTGINTF)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgintf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgintf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gotgintf`]
139module"]
140#[doc(alias = "GOTGINTF")]
141pub type Gotgintf = crate::Reg<gotgintf::GotgintfSpec>;
142#[doc = "Global OTG interrupt flag register (USBFS_GOTGINTF)"]
143pub mod gotgintf;
144#[doc = "GAHBCS (rw) register accessor: Global AHB control and status register (USBFS_GAHBCS)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gahbcs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gahbcs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gahbcs`]
145module"]
146#[doc(alias = "GAHBCS")]
147pub type Gahbcs = crate::Reg<gahbcs::GahbcsSpec>;
148#[doc = "Global AHB control and status register (USBFS_GAHBCS)"]
149pub mod gahbcs;
150#[doc = "GUSBCS (rw) register accessor: Global USB control and status register (OTG_FS_GUSBCSR)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gusbcs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gusbcs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gusbcs`]
151module"]
152#[doc(alias = "GUSBCS")]
153pub type Gusbcs = crate::Reg<gusbcs::GusbcsSpec>;
154#[doc = "Global USB control and status register (OTG_FS_GUSBCSR)"]
155pub mod gusbcs;
156#[doc = "GRSTCTL (rw) register accessor: Global reset control register (USBFS_GRSTCTL)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grstctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstctl`]
157module"]
158#[doc(alias = "GRSTCTL")]
159pub type Grstctl = crate::Reg<grstctl::GrstctlSpec>;
160#[doc = "Global reset control register (USBFS_GRSTCTL)"]
161pub mod grstctl;
162#[doc = "GINTF (rw) register accessor: Global interrupt flag register (USBFS_GINTF)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gintf`]
163module"]
164#[doc(alias = "GINTF")]
165pub type Gintf = crate::Reg<gintf::GintfSpec>;
166#[doc = "Global interrupt flag register (USBFS_GINTF)"]
167pub mod gintf;
168#[doc = "GINTEN (rw) register accessor: Global interrupt enable register (USBFS_GINTEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ginten::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ginten::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ginten`]
169module"]
170#[doc(alias = "GINTEN")]
171pub type Ginten = crate::Reg<ginten::GintenSpec>;
172#[doc = "Global interrupt enable register (USBFS_GINTEN)"]
173pub mod ginten;
174#[doc = "GRSTATR_Device (r) register accessor: Global Receive status read(Device mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstatr_device::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstatr_device`]
175module"]
176#[doc(alias = "GRSTATR_Device")]
177pub type GrstatrDevice = crate::Reg<grstatr_device::GrstatrDeviceSpec>;
178#[doc = "Global Receive status read(Device mode)"]
179pub mod grstatr_device;
180#[doc = "GRSTATR_Host (r) register accessor: Global Receive status read(Host mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstatr_host::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstatr_host`]
181module"]
182#[doc(alias = "GRSTATR_Host")]
183pub type GrstatrHost = crate::Reg<grstatr_host::GrstatrHostSpec>;
184#[doc = "Global Receive status read(Host mode)"]
185pub mod grstatr_host;
186#[doc = "GRSTATP_Device (r) register accessor: Global Receive status pop(Device mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstatp_device::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstatp_device`]
187module"]
188#[doc(alias = "GRSTATP_Device")]
189pub type GrstatpDevice = crate::Reg<grstatp_device::GrstatpDeviceSpec>;
190#[doc = "Global Receive status pop(Device mode)"]
191pub mod grstatp_device;
192#[doc = "GRSTATP_Host (r) register accessor: Global Receive status pop(Host mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstatp_host::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstatp_host`]
193module"]
194#[doc(alias = "GRSTATP_Host")]
195pub type GrstatpHost = crate::Reg<grstatp_host::GrstatpHostSpec>;
196#[doc = "Global Receive status pop(Host mode)"]
197pub mod grstatp_host;
198#[doc = "GRFLEN (rw) register accessor: Global Receive FIFO size register (USBFS_GRFLEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grflen`]
199module"]
200#[doc(alias = "GRFLEN")]
201pub type Grflen = crate::Reg<grflen::GrflenSpec>;
202#[doc = "Global Receive FIFO size register (USBFS_GRFLEN)"]
203pub mod grflen;
204#[doc = "HNPTFLEN (rw) register accessor: Host non-periodic transmit FIFO length register (Host mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hnptflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hnptflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hnptflen`]
205module"]
206#[doc(alias = "HNPTFLEN")]
207pub type Hnptflen = crate::Reg<hnptflen::HnptflenSpec>;
208#[doc = "Host non-periodic transmit FIFO length register (Host mode)"]
209pub mod hnptflen;
210#[doc = "DIEP0TFLEN (rw) register accessor: Device IN endpoint 0 transmit FIFO length (Device mode)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diep0tflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diep0tflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diep0tflen`]
211module"]
212#[doc(alias = "DIEP0TFLEN")]
213pub type Diep0tflen = crate::Reg<diep0tflen::Diep0tflenSpec>;
214#[doc = "Device IN endpoint 0 transmit FIFO length (Device mode)"]
215pub mod diep0tflen;
216#[doc = "HNPTFQSTAT (r) register accessor: Host non-periodic transmit FIFO/queue status register (HNPTFQSTAT)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hnptfqstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hnptfqstat`]
217module"]
218#[doc(alias = "HNPTFQSTAT")]
219pub type Hnptfqstat = crate::Reg<hnptfqstat::HnptfqstatSpec>;
220#[doc = "Host non-periodic transmit FIFO/queue status register (HNPTFQSTAT)"]
221pub mod hnptfqstat;
222#[doc = "GCCFG (rw) register accessor: Global core configuration register (USBFS_GCCFG)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gccfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gccfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gccfg`]
223module"]
224#[doc(alias = "GCCFG")]
225pub type Gccfg = crate::Reg<gccfg::GccfgSpec>;
226#[doc = "Global core configuration register (USBFS_GCCFG)"]
227pub mod gccfg;
228#[doc = "CID (rw) register accessor: core ID register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cid::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cid::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cid`]
229module"]
230#[doc(alias = "CID")]
231pub type Cid = crate::Reg<cid::CidSpec>;
232#[doc = "core ID register"]
233pub mod cid;
234#[doc = "HPTFLEN (rw) register accessor: Host periodic transmit FIFO length register (HPTFLEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hptflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hptflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hptflen`]
235module"]
236#[doc(alias = "HPTFLEN")]
237pub type Hptflen = crate::Reg<hptflen::HptflenSpec>;
238#[doc = "Host periodic transmit FIFO length register (HPTFLEN)"]
239pub mod hptflen;
240#[doc = "DIEP1TFLEN (rw) register accessor: device IN endpoint transmit FIFO size register (DIEP1TFLEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diep1tflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diep1tflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diep1tflen`]
241module"]
242#[doc(alias = "DIEP1TFLEN")]
243pub type Diep1tflen = crate::Reg<diep1tflen::Diep1tflenSpec>;
244#[doc = "device IN endpoint transmit FIFO size register (DIEP1TFLEN)"]
245pub mod diep1tflen;
246#[doc = "DIEP2TFLEN (rw) register accessor: device IN endpoint transmit FIFO size register (DIEP2TFLEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diep2tflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diep2tflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diep2tflen`]
247module"]
248#[doc(alias = "DIEP2TFLEN")]
249pub type Diep2tflen = crate::Reg<diep2tflen::Diep2tflenSpec>;
250#[doc = "device IN endpoint transmit FIFO size register (DIEP2TFLEN)"]
251pub mod diep2tflen;
252#[doc = "DIEP3TFLEN (rw) register accessor: device IN endpoint transmit FIFO size register (FS_DIEP3TXFLEN)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diep3tflen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diep3tflen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diep3tflen`]
253module"]
254#[doc(alias = "DIEP3TFLEN")]
255pub type Diep3tflen = crate::Reg<diep3tflen::Diep3tflenSpec>;
256#[doc = "device IN endpoint transmit FIFO size register (FS_DIEP3TXFLEN)"]
257pub mod diep3tflen;