ra2a1/
usbfs.rs

1#[doc = r"Register block"]
2#[repr(C)]
3pub struct RegisterBlock {
4    #[doc = "0x00 - System Configuration Control Register"]
5    pub syscfg: SYSCFG,
6    _reserved1: [u8; 0x02],
7    #[doc = "0x04 - System Configuration Status Register 0"]
8    pub syssts0: SYSSTS0,
9    _reserved2: [u8; 0x02],
10    #[doc = "0x08 - Device State Control Register 0"]
11    pub dvstctr0: DVSTCTR0,
12    _reserved3: [u8; 0x0a],
13    _reserved_3_cfifo: [u8; 0x02],
14    _reserved4: [u8; 0x0a],
15    #[doc = "0x20 - CFIFO Port Select Register"]
16    pub cfifosel: CFIFOSEL,
17    #[doc = "0x22 - CFIFO Port Control Register"]
18    pub cfifoctr: CFIFOCTR,
19    _reserved6: [u8; 0x0c],
20    #[doc = "0x30 - Interrupt Enable Register 0"]
21    pub intenb0: INTENB0,
22    _reserved7: [u8; 0x04],
23    #[doc = "0x36 - BRDY Interrupt Enable Register"]
24    pub brdyenb: BRDYENB,
25    #[doc = "0x38 - NRDY Interrupt Enable Register"]
26    pub nrdyenb: NRDYENB,
27    #[doc = "0x3a - BEMP Interrupt Enable Register"]
28    pub bempenb: BEMPENB,
29    #[doc = "0x3c - SOF Output Configuration Register"]
30    pub sofcfg: SOFCFG,
31    _reserved11: [u8; 0x02],
32    #[doc = "0x40 - Interrupt Status Register 0"]
33    pub intsts0: INTSTS0,
34    _reserved12: [u8; 0x04],
35    #[doc = "0x46 - BRDY Interrupt Status Register"]
36    pub brdysts: BRDYSTS,
37    #[doc = "0x48 - NRDY Interrupt Status Register"]
38    pub nrdysts: NRDYSTS,
39    #[doc = "0x4a - BEMP Interrupt Status Register"]
40    pub bempsts: BEMPSTS,
41    #[doc = "0x4c - Frame Number Register"]
42    pub frmnum: FRMNUM,
43    _reserved16: [u8; 0x06],
44    #[doc = "0x54 - USB Request Type Register"]
45    pub usbreq: USBREQ,
46    #[doc = "0x56 - USB Request Value Register"]
47    pub usbval: USBVAL,
48    #[doc = "0x58 - USB Request Index Register"]
49    pub usbindx: USBINDX,
50    #[doc = "0x5a - USB Request Length Register"]
51    pub usbleng: USBLENG,
52    #[doc = "0x5c - DCP Configuration Register"]
53    pub dcpcfg: DCPCFG,
54    #[doc = "0x5e - DCP Maximum Packet Size Register"]
55    pub dcpmaxp: DCPMAXP,
56    #[doc = "0x60 - DCP Control Register"]
57    pub dcpctr: DCPCTR,
58    _reserved23: [u8; 0x02],
59    #[doc = "0x64 - Pipe Window Select Register"]
60    pub pipesel: PIPESEL,
61    _reserved24: [u8; 0x02],
62    #[doc = "0x68 - Pipe Configuration Register"]
63    pub pipecfg: PIPECFG,
64    _reserved25: [u8; 0x02],
65    #[doc = "0x6c - Pipe Maximum Packet Size Register"]
66    pub pipemaxp: PIPEMAXP,
67    _reserved26: [u8; 0x08],
68    #[doc = "0x76 - Pipe %s Control Register"]
69    pub pipectr: [PIPECTR; 2],
70    #[doc = "0x7a - Pipe %s Control Register"]
71    pub pipe6ctr: PIPE6CTR,
72    #[doc = "0x7c - Pipe %s Control Register"]
73    pub pipe7ctr: PIPE6CTR,
74    _reserved29: [u8; 0x1e],
75    #[doc = "0x9c - Pipe %s Transaction Counter Enable Register"]
76    pub pipe4tre: PIPETRE,
77    #[doc = "0x9e - Pipe %s Transaction Counter Register"]
78    pub pipe4trn: PIPETRN,
79    #[doc = "0xa0 - Pipe %s Transaction Counter Enable Register"]
80    pub pipe5tre: PIPETRE,
81    #[doc = "0xa2 - Pipe %s Transaction Counter Register"]
82    pub pipe5trn: PIPETRN,
83    _reserved33: [u8; 0x0c],
84    #[doc = "0xb0 - BC Control Register 0"]
85    pub usbbcctrl0: USBBCCTRL0,
86    _reserved34: [u8; 0x12],
87    #[doc = "0xc4 - USB Clock Selection Register"]
88    pub ucksel: UCKSEL,
89    _reserved35: [u8; 0x06],
90    #[doc = "0xcc - USB Module Control Register"]
91    pub usbmc: USBMC,
92}
93impl RegisterBlock {
94    #[doc = "0x14 - CFIFO Port Register L"]
95    #[inline(always)]
96    pub const fn cfifol(&self) -> &CFIFOL {
97        unsafe { &*(self as *const Self).cast::<u8>().add(20usize).cast() }
98    }
99    #[doc = "0x14 - CFIFO Port Register"]
100    #[inline(always)]
101    pub const fn cfifo(&self) -> &CFIFO {
102        unsafe { &*(self as *const Self).cast::<u8>().add(20usize).cast() }
103    }
104    #[doc = "0x76 - Pipe %s Control Register"]
105    #[inline(always)]
106    pub fn pipe4ctr(&self) -> &PIPECTR {
107        &self.pipectr[0]
108    }
109    #[doc = "0x78 - Pipe %s Control Register"]
110    #[inline(always)]
111    pub fn pipe5ctr(&self) -> &PIPECTR {
112        &self.pipectr[1]
113    }
114}
115#[doc = "SYSCFG (rw) register accessor: an alias for `Reg<SYSCFG_SPEC>`"]
116pub type SYSCFG = crate::Reg<syscfg::SYSCFG_SPEC>;
117#[doc = "System Configuration Control Register"]
118pub mod syscfg;
119#[doc = "SYSSTS0 (r) register accessor: an alias for `Reg<SYSSTS0_SPEC>`"]
120pub type SYSSTS0 = crate::Reg<syssts0::SYSSTS0_SPEC>;
121#[doc = "System Configuration Status Register 0"]
122pub mod syssts0;
123#[doc = "DVSTCTR0 (rw) register accessor: an alias for `Reg<DVSTCTR0_SPEC>`"]
124pub type DVSTCTR0 = crate::Reg<dvstctr0::DVSTCTR0_SPEC>;
125#[doc = "Device State Control Register 0"]
126pub mod dvstctr0;
127#[doc = "CFIFO (rw) register accessor: an alias for `Reg<CFIFO_SPEC>`"]
128pub type CFIFO = crate::Reg<cfifo::CFIFO_SPEC>;
129#[doc = "CFIFO Port Register"]
130pub mod cfifo;
131#[doc = "CFIFOL (rw) register accessor: an alias for `Reg<CFIFOL_SPEC>`"]
132pub type CFIFOL = crate::Reg<cfifol::CFIFOL_SPEC>;
133#[doc = "CFIFO Port Register L"]
134pub mod cfifol;
135#[doc = "CFIFOSEL (rw) register accessor: an alias for `Reg<CFIFOSEL_SPEC>`"]
136pub type CFIFOSEL = crate::Reg<cfifosel::CFIFOSEL_SPEC>;
137#[doc = "CFIFO Port Select Register"]
138pub mod cfifosel;
139#[doc = "CFIFOCTR (rw) register accessor: an alias for `Reg<CFIFOCTR_SPEC>`"]
140pub type CFIFOCTR = crate::Reg<cfifoctr::CFIFOCTR_SPEC>;
141#[doc = "CFIFO Port Control Register"]
142pub mod cfifoctr;
143#[doc = "INTENB0 (rw) register accessor: an alias for `Reg<INTENB0_SPEC>`"]
144pub type INTENB0 = crate::Reg<intenb0::INTENB0_SPEC>;
145#[doc = "Interrupt Enable Register 0"]
146pub mod intenb0;
147#[doc = "BRDYENB (rw) register accessor: an alias for `Reg<BRDYENB_SPEC>`"]
148pub type BRDYENB = crate::Reg<brdyenb::BRDYENB_SPEC>;
149#[doc = "BRDY Interrupt Enable Register"]
150pub mod brdyenb;
151#[doc = "NRDYENB (rw) register accessor: an alias for `Reg<NRDYENB_SPEC>`"]
152pub type NRDYENB = crate::Reg<nrdyenb::NRDYENB_SPEC>;
153#[doc = "NRDY Interrupt Enable Register"]
154pub mod nrdyenb;
155#[doc = "BEMPENB (rw) register accessor: an alias for `Reg<BEMPENB_SPEC>`"]
156pub type BEMPENB = crate::Reg<bempenb::BEMPENB_SPEC>;
157#[doc = "BEMP Interrupt Enable Register"]
158pub mod bempenb;
159#[doc = "SOFCFG (rw) register accessor: an alias for `Reg<SOFCFG_SPEC>`"]
160pub type SOFCFG = crate::Reg<sofcfg::SOFCFG_SPEC>;
161#[doc = "SOF Output Configuration Register"]
162pub mod sofcfg;
163#[doc = "INTSTS0 (rw) register accessor: an alias for `Reg<INTSTS0_SPEC>`"]
164pub type INTSTS0 = crate::Reg<intsts0::INTSTS0_SPEC>;
165#[doc = "Interrupt Status Register 0"]
166pub mod intsts0;
167#[doc = "BRDYSTS (rw) register accessor: an alias for `Reg<BRDYSTS_SPEC>`"]
168pub type BRDYSTS = crate::Reg<brdysts::BRDYSTS_SPEC>;
169#[doc = "BRDY Interrupt Status Register"]
170pub mod brdysts;
171#[doc = "NRDYSTS (rw) register accessor: an alias for `Reg<NRDYSTS_SPEC>`"]
172pub type NRDYSTS = crate::Reg<nrdysts::NRDYSTS_SPEC>;
173#[doc = "NRDY Interrupt Status Register"]
174pub mod nrdysts;
175#[doc = "BEMPSTS (rw) register accessor: an alias for `Reg<BEMPSTS_SPEC>`"]
176pub type BEMPSTS = crate::Reg<bempsts::BEMPSTS_SPEC>;
177#[doc = "BEMP Interrupt Status Register"]
178pub mod bempsts;
179#[doc = "FRMNUM (rw) register accessor: an alias for `Reg<FRMNUM_SPEC>`"]
180pub type FRMNUM = crate::Reg<frmnum::FRMNUM_SPEC>;
181#[doc = "Frame Number Register"]
182pub mod frmnum;
183#[doc = "USBREQ (r) register accessor: an alias for `Reg<USBREQ_SPEC>`"]
184pub type USBREQ = crate::Reg<usbreq::USBREQ_SPEC>;
185#[doc = "USB Request Type Register"]
186pub mod usbreq;
187#[doc = "USBVAL (r) register accessor: an alias for `Reg<USBVAL_SPEC>`"]
188pub type USBVAL = crate::Reg<usbval::USBVAL_SPEC>;
189#[doc = "USB Request Value Register"]
190pub mod usbval;
191#[doc = "USBINDX (r) register accessor: an alias for `Reg<USBINDX_SPEC>`"]
192pub type USBINDX = crate::Reg<usbindx::USBINDX_SPEC>;
193#[doc = "USB Request Index Register"]
194pub mod usbindx;
195#[doc = "USBLENG (r) register accessor: an alias for `Reg<USBLENG_SPEC>`"]
196pub type USBLENG = crate::Reg<usbleng::USBLENG_SPEC>;
197#[doc = "USB Request Length Register"]
198pub mod usbleng;
199#[doc = "DCPCFG (rw) register accessor: an alias for `Reg<DCPCFG_SPEC>`"]
200pub type DCPCFG = crate::Reg<dcpcfg::DCPCFG_SPEC>;
201#[doc = "DCP Configuration Register"]
202pub mod dcpcfg;
203#[doc = "DCPMAXP (rw) register accessor: an alias for `Reg<DCPMAXP_SPEC>`"]
204pub type DCPMAXP = crate::Reg<dcpmaxp::DCPMAXP_SPEC>;
205#[doc = "DCP Maximum Packet Size Register"]
206pub mod dcpmaxp;
207#[doc = "DCPCTR (rw) register accessor: an alias for `Reg<DCPCTR_SPEC>`"]
208pub type DCPCTR = crate::Reg<dcpctr::DCPCTR_SPEC>;
209#[doc = "DCP Control Register"]
210pub mod dcpctr;
211#[doc = "PIPESEL (rw) register accessor: an alias for `Reg<PIPESEL_SPEC>`"]
212pub type PIPESEL = crate::Reg<pipesel::PIPESEL_SPEC>;
213#[doc = "Pipe Window Select Register"]
214pub mod pipesel;
215#[doc = "PIPECFG (rw) register accessor: an alias for `Reg<PIPECFG_SPEC>`"]
216pub type PIPECFG = crate::Reg<pipecfg::PIPECFG_SPEC>;
217#[doc = "Pipe Configuration Register"]
218pub mod pipecfg;
219#[doc = "PIPEMAXP (rw) register accessor: an alias for `Reg<PIPEMAXP_SPEC>`"]
220pub type PIPEMAXP = crate::Reg<pipemaxp::PIPEMAXP_SPEC>;
221#[doc = "Pipe Maximum Packet Size Register"]
222pub mod pipemaxp;
223#[doc = "PIPECTR (rw) register accessor: an alias for `Reg<PIPECTR_SPEC>`"]
224pub type PIPECTR = crate::Reg<pipectr::PIPECTR_SPEC>;
225#[doc = "Pipe %s Control Register"]
226pub mod pipectr;
227pub use pipectr as pipe6ctr;
228pub use PIPECTR as PIPE6CTR;
229#[doc = "PIPETRE (rw) register accessor: an alias for `Reg<PIPETRE_SPEC>`"]
230pub type PIPETRE = crate::Reg<pipetre::PIPETRE_SPEC>;
231#[doc = "Pipe %s Transaction Counter Enable Register"]
232pub mod pipetre;
233#[doc = "PIPETRN (rw) register accessor: an alias for `Reg<PIPETRN_SPEC>`"]
234pub type PIPETRN = crate::Reg<pipetrn::PIPETRN_SPEC>;
235#[doc = "Pipe %s Transaction Counter Register"]
236pub mod pipetrn;
237#[doc = "USBMC (rw) register accessor: an alias for `Reg<USBMC_SPEC>`"]
238pub type USBMC = crate::Reg<usbmc::USBMC_SPEC>;
239#[doc = "USB Module Control Register"]
240pub mod usbmc;
241#[doc = "USBBCCTRL0 (rw) register accessor: an alias for `Reg<USBBCCTRL0_SPEC>`"]
242pub type USBBCCTRL0 = crate::Reg<usbbcctrl0::USBBCCTRL0_SPEC>;
243#[doc = "BC Control Register 0"]
244pub mod usbbcctrl0;
245#[doc = "UCKSEL (rw) register accessor: an alias for `Reg<UCKSEL_SPEC>`"]
246pub type UCKSEL = crate::Reg<ucksel::UCKSEL_SPEC>;
247#[doc = "USB Clock Selection Register"]
248pub mod ucksel;