15#ifndef LIBBSP_ARM_STM32F4_STM32F4XXXX_OTGFS_H
16#define LIBBSP_ARM_STM32F4_STM32F4XXXX_OTGFS_H
20#define USB_OTG_NUM_EPS 4
21#define USB_OTG_MAX_TX_FIFOS 4
23#define USB_FIFO_BASE 0x1000
24#define USB_FIFO_OFFS 0x1000
28#define STM32F4_OTGFS_GOTGCTL_BSVLD BSP_BIT32(19)
29#define STM32F4_OTGFS_GOTGCTL_ASVLD BSP_BIT32(18)
30#define STM32F4_OTGFS_GOTGCTL_DBCT BSP_BIT32(17)
31#define STM32F4_OTGFS_GOTGCTL_CIDSTS BSP_BIT32(16)
32#define STM32F4_OTGFS_GOTGCTL_DHNPEN BSP_BIT32(11)
33#define STM32F4_OTGFS_GOTGCTL_HSHNPEN BSP_BIT32(10)
34#define STM32F4_OTGFS_GOTGCTL_HNPRQ BSP_BIT32(9)
35#define STM32F4_OTGFS_GOTGCTL_HNGSCS BSP_BIT32(8)
36#define STM32F4_OTGFS_GOTGCTL_SRQ BSP_BIT32(1)
37#define STM32F4_OTGFS_GOTGCTL_SRQSCS BSP_BIT32(0)
40#define STM32F4_OTGFS_GOTGINT_DBCDNE BSP_BIT32(19)
41#define STM32F4_OTGFS_GOTGINT_ADTOCHG BSP_BIT32(18)
42#define STM32F4_OTGFS_GOTGINT_HNGDET BSP_BIT32(17)
43#define STM32F4_OTGFS_GOTGINT_HNSSCHG BSP_BIT32(9)
44#define STM32F4_OTGFS_GOTGINT_SRSSCHG BSP_BIT32(8)
45#define STM32F4_OTGFS_GOTGINT_SEDET BSP_BIT32(2)
48#define STM32F4_OTGFS_GAHBCFG_PTXFELVL BSP_BIT32(8)
49#define STM32F4_OTGFS_GAHBCFG_TXFELVL BSP_BIT32(7)
50#define STM32F4_OTGFS_GAHBCFG_GINTMSK BSP_BIT32(0)
53#define STM32F4_OTGFS_GUSBCFG_CTXPKT BSP_BIT32(31)
54#define STM32F4_OTGFS_GUSBCFG_FDMOD BSP_BIT32(30)
55#define STM32F4_OTGFS_GUSBCFG_FHMOD BSP_BIT32(29)
56#define STM32F4_OTGFS_GUSBCFG_TRDT(val) BSP_FLD32(val, 10, 13)
57#define STM32F4_OTGFS_GUSBCFG_TRDT_GET(reg) BSP_FLD32GET(reg, 10, 13)
58#define STM32F4_OTGFS_GUSBCFG_TRDT_SET(reg, val) BSP_FLD32SET(reg, val, 10, 13)
59#define STM32F4_OTGFS_GUSBCFG_HNPCAP BSP_BIT32(9)
60#define STM32F4_OTGFS_GUSBCFG_SRPCAP BSP_BIT32(8)
61#define STM32F4_OTGFS_GUSBCFG_PHYSEL BSP_BIT32(6)
62#define STM32F4_OTGFS_GUSBCFG_TOCAL(val) BSP_FLD32(val, 0, 2)
63#define STM32F4_OTGFS_GUSBCFG_TOCAL_GET(reg) BSP_FLD32GET(reg, 0, 2)
64#define STM32F4_OTGFS_GUSBCFG_TOCAL_SET(reg, val) BSP_FLD32SET(reg, val, 0, 2)
67#define STM32F4_OTGFS_GRSTCTL_AHBIDL BSP_BIT32(31)
68#define STM32F4_OTGFS_GRSTCTL_TXFNUM(val) BSP_FLD32(val, 6, 10)
69#define STM32F4_OTGFS_GRSTCTL_TXFNUM_GET(reg) BSP_FLD32GET(reg, 6, 10)
70#define STM32F4_OTGFS_GRSTCTL_TXFNUM_SET(reg, val) BSP_FLD32SET(reg, val, 6, 10)
71#define STM32F4_OTGFS_GRSTCTL_TXFNUM_ALL STM32F4_OTGFS_GRSTCTL_TXFNUM(0x10)
72#define STM32F4_OTGFS_GRSTCTL_TXFFLSH BSP_BIT32(5)
73#define STM32F4_OTGFS_GRSTCTL_RXFFLSH BSP_BIT32(4)
74#define STM32F4_OTGFS_GRSTCTL_FCRST BSP_BIT32(2)
75#define STM32F4_OTGFS_GRSTCTL_HSRST BSP_BIT32(1)
76#define STM32F4_OTGFS_GRSTCTL_CSRST BSP_BIT32(0)
79#define STM32F4_OTGFS_GINTSTS_WKUPINT BSP_BIT32(31)
80#define STM32F4_OTGFS_GINTSTS_SRQINT BSP_BIT32(30)
81#define STM32F4_OTGFS_GINTSTS_DISCINT BSP_BIT32(29)
82#define STM32F4_OTGFS_GINTSTS_CIDSCHG BSP_BIT32(28)
83#define STM32F4_OTGFS_GINTSTS_PTXFE BSP_BIT32(26)
84#define STM32F4_OTGFS_GINTSTS_HCINT BSP_BIT32(25)
85#define STM32F4_OTGFS_GINTSTS_HPRTINT BSP_BIT32(24)
86#define STM32F4_OTGFS_GINTSTS_IPXFR BSP_BIT32(21)
87#define STM32F4_OTGFS_GINTSTS_IISOOXFR BSP_BIT32(21)
88#define STM32F4_OTGFS_GINTSTS_IISOIXFR BSP_BIT32(20)
89#define STM32F4_OTGFS_GINTSTS_OEPINT BSP_BIT32(19)
90#define STM32F4_OTGFS_GINTSTS_IEPINT BSP_BIT32(18)
91#define STM32F4_OTGFS_GINTSTS_EOPF BSP_BIT32(15)
92#define STM32F4_OTGFS_GINTSTS_ISOODRP BSP_BIT32(14)
93#define STM32F4_OTGFS_GINTSTS_ENUMDNE BSP_BIT32(13)
94#define STM32F4_OTGFS_GINTSTS_USBRST BSP_BIT32(12)
95#define STM32F4_OTGFS_GINTSTS_USBSUSP BSP_BIT32(11)
96#define STM32F4_OTGFS_GINTSTS_ESUSP BSP_BIT32(10)
97#define STM32F4_OTGFS_GINTSTS_GONAKEFF BSP_BIT32(7)
98#define STM32F4_OTGFS_GINTSTS_GINAKEFF BSP_BIT32(6)
99#define STM32F4_OTGFS_GINTSTS_NPTXFE BSP_BIT32(5)
100#define STM32F4_OTGFS_GINTSTS_RXFLVL BSP_BIT32(4)
101#define STM32F4_OTGFS_GINTSTS_SOF BSP_BIT32(3)
102#define STM32F4_OTGFS_GINTSTS_OTGINT BSP_BIT32(2)
103#define STM32F4_OTGFS_GINTSTS_MMIS BSP_BIT32(1)
104#define STM32F4_OTGFS_GINTSTS_CMOD BSP_BIT32(0)
111#define STM32F4_OTGFS_GRXSTSP_FRMNUM(val) BSP_FLD32(val, 21, 24)
112#define STM32F4_OTGFS_GRXSTSP_FRMNUM_GET(reg) BSP_FLD32GET(reg, 21, 24)
113#define STM32F4_OTGFS_GRXSTSP_FRMNUM_SET(reg, val) BSP_FLD32SET(reg, val, 21, 24)
114#define STM32F4_OTGFS_GRXSTSP_PKTSTS(val) BSP_FLD32(val, 17, 20)
115#define STM32F4_OTGFS_GRXSTSP_PKTSTS_GET(reg) BSP_FLD32GET(reg, 17, 20)
116#define STM32F4_OTGFS_GRXSTSP_PKTSTS_SET(reg, val) BSP_FLD32SET(reg, val, 17, 20)
117#define PKTSTS_IN_DATA (0x2)
118#define PKTSTS_IN_COMPLETE (0x3)
119#define PKTSTS_TOGGLE_ERR (0x5)
120#define PKTSTS_HALTED (0x7)
121#define PKTSTS_OUTNAK (0x1)
122#define PKTSTS_OUT_DATA (0x2)
123#define PKTSTS_OUT_COMPLETE (0x3)
124#define PKTSTS_SETUP_COMPLETE (0x4)
125#define PKTSTS_SETUP_DATA (0x6)
126#define STM32F4_OTGFS_GRXSTSP_DPIG(val) BSP_FLD32(val, 15, 16)
127#define STM32F4_OTGFS_GRXSTSP_DPID_GET(reg) BSP_FLD32GET(reg, 15, 16)
128#define STM32F4_OTGFS_GRXSTSP_DPID_SET(reg, val) BSP_FLD32SET(reg, val, 15, 16)
129#define STM32F4_OTGFS_GRXSTSP_DPID_DATA0 STM32F4_OTGFS_GRXSTSP_PKTSTS(0x0)
130#define STM32F4_OTGFS_GRXSTSP_DPID_DATA1 STM32F4_OTGFS_GRXSTSP_PKTSTS(0x1)
131#define STM32F4_OTGFS_GRXSTSP_DPID_DATA2 STM32F4_OTGFS_GRXSTSP_PKTSTS(0x2)
132#define STM32F4_OTGFS_GRXSTSP_DPID_MDATA0 STM32F4_OTGFS_GRXSTSP_PKTSTS(0x3)
133#define STM32F4_OTGFS_GRXSTSP_BCNT(val) BSP_FLD32(val, 4, 14)
134#define STM32F4_OTGFS_GRXSTSP_BCNT_GET(reg) BSP_FLD32GET(reg, 4, 14)
135#define STM32F4_OTGFS_GRXSTSP_BCNT_SET(reg, val) BSP_FLD32SET(reg, val, 4, 14)
136#define STM32F4_OTGFS_GRXSTSP_CHNUM(val) BSP_FLD32(val, 0, 3)
137#define STM32F4_OTGFS_GRXSTSP_CHNUM_GET(reg) BSP_FLD32GET(reg, 0, 3)
138#define STM32F4_OTGFS_GRXSTSP_CHNUM_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
139#define STM32F4_OTGFS_GRXSTSP_EPNUM(val) BSP_FLD32(val, 0, 3)
140#define STM32F4_OTGFS_GRXSTSP_EPNUM_GET(reg) BSP_FLD32GET(reg, 0, 3)
141#define STM32F4_OTGFS_GRXSTSP_EPNUM_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
144#define STM32F4_OTGFS_GRXFSIZ_RXFD(val) BSP_FLD32(val, 0, 15)
145#define STM32F4_OTGFS_GRXFSIZ_RXFD_GET(reg) BSP_FLD32GET(reg, 0, 15)
146#define STM32F4_OTGFS_GRXFSIZ_RXFD_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
147#define STM32F4_OTGFS_GRXFSIZ_RXFD_MIN 16
148#define STM32F4_OTGFS_GRXFSIZ_RXFD_MAX 256
151#define STM32F4_OTGFS_DIEPTXF_DEPTH(val) BSP_FLD32(val, 16, 31)
152#define STM32F4_OTGFS_DIEPTXF_DEPTH_GET(reg) BSP_FLD32GET(reg, 16, 31)
153#define STM32F4_OTGFS_DIEPTXF_DEPTH_SET(reg, val) BSP_FLD32SET(reg, val, 16, 31)
154#define STM32F4_OTGFS_DIEPTXF_DEPTH_MIN 16
155#define STM32F4_OTGFS_DIEPTXF_DEPTH_MAX 256
156#define STM32F4_OTGFS_DIEPTXF_SADDR(val) BSP_FLD32(val, 0, 15)
157#define STM32F4_OTGFS_DIEPTXF_SADDR_GET(reg) BSP_FLD32GET(reg, 0, 15)
158#define STM32F4_OTGFS_DIEPTXF_SADDR_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
166#define STM32F4_OTGFS_GCCFG_NOVBUSSENS BSP_BIT32(21)
167#define STM32F4_OTGFS_GCCFG_SOFOUTEN BSP_BIT32(20)
168#define STM32F4_OTGFS_GCCFG_VBUSBSEN BSP_BIT32(19)
169#define STM32F4_OTGFS_GCCFG_VBUSASEN BSP_BIT32(18)
170#define STM32F4_OTGFS_GCCFG_PWRDWN BSP_BIT32(16)
178 uint32_t dieptxf[USB_OTG_MAX_TX_FIFOS];
185#define STM32F4_OTGFS_DCFG_PFIVL(val) BSP_FLD32(val, 11, 12)
186#define STM32F4_OTGFS_DCFG_PFIVL_GET(reg) BSP_FLD32GET(reg, 11, 12)
187#define STM32F4_OTGFS_DCFG_PFIVL_SET(reg, val) BSP_FLD32SET(reg, val, 11, 12)
192#define STM32F4_OTGFS_DCFG_DAD(val) BSP_FLD32(val, 4, 10)
193#define STM32F4_OTGFS_DCFG_DAD_GET(reg) BSP_FLD32GET(reg, 4, 10)
194#define STM32F4_OTGFS_DCFG_DAD_SET(reg, val) BSP_FLD32SET(reg, val, 4, 10)
195#define STM32F4_OTGFS_DCFG_NZLSOHSK BSP_BIT32(2)
196#define STM32F4_OTGFS_DCFG_DSPD(val) BSP_FLD32(val, 0, 1)
197#define STM32F4_OTGFS_DCFG_DSPD_GET(reg) BSP_FLD32GET(reg, 0, 1)
198#define STM32F4_OTGFS_DCFG_DSPD_SET(reg, val) BSP_FLD32SET(reg, val, 0, 1)
199#define STM32F4_OTGFS_DCFG_DSPD_FULL STM32F4_OTGFS_DCFG_DSPD(0x3)
202#define STM32F4_OTGFS_DCTL_POPRGDNE BSP_BIT32(11)
203#define STM32F4_OTGFS_DCTL_CGONAK BSP_BIT32(10)
204#define STM32F4_OTGFS_DCTL_SGONAK BSP_BIT32(9)
205#define STM32F4_OTGFS_DCTL_CGINAK BSP_BIT32(8)
206#define STM32F4_OTGFS_DCTL_SGINAK BSP_BIT32(7)
207#define STM32F4_OTGFS_DCTL_TCTL(val) BSP_FLD32(val, 4, 6)
208#define STM32F4_OTGFS_DCTL_TCTL_GET(reg) BSP_FLD32GET(reg, 4, 6)
209#define STM32F4_OTGFS_DCTL_TCTL_SET(reg, val) BSP_FLD32SET(reg, val, 4, 6)
210#define STM32F4_OTGFS_DCTL_GONSTS BSP_BIT32(3)
211#define STM32F4_OTGFS_DCTL_GINSTS BSP_BIT32(2)
212#define STM32F4_OTGFS_DCTL_SDIS BSP_BIT32(1)
213#define STM32F4_OTGFS_DCTL_RWUSIG BSP_BIT32(0)
216#define STM32F4_OTGFS_DSTS_FNSOF(val) BSP_FLD32(val, 8, 21)
217#define STM32F4_OTGFS_DSTS_FNSOF_GET(reg) BSP_FLD32GET(reg, 8, 21)
218#define STM32F4_OTGFS_DSTS_EERR BSP_BIT32(3)
219#define STM32F4_OTGFS_DSTS_ENUMSPD(val) BSP_FLD32(val, 1, 2)
220#define STM32F4_OTGFS_DSTS_ENUMSPD_GET(reg) BSP_FLD32GET(reg, 1, 2)
221#define STM32F4_OTGFS_DSTS_ENUMSPD_FULL STM32F4_OTGFS_DSTS_ENUMSPD(0x3)
222#define STM32F4_OTGFS_DSTS_SUSPSTS BSP_BIT32(0)
231#define STM32F4_OTGFS_DAINT_OEPINT15 BSP_BIT32(31)
232#define STM32F4_OTGFS_DAINT_OEPINT14 BSP_BIT32(30)
233#define STM32F4_OTGFS_DAINT_OEPINT13 BSP_BIT32(29)
234#define STM32F4_OTGFS_DAINT_OEPINT12 BSP_BIT32(28)
235#define STM32F4_OTGFS_DAINT_OEPINT11 BSP_BIT32(27)
236#define STM32F4_OTGFS_DAINT_OEPINT10 BSP_BIT32(26)
237#define STM32F4_OTGFS_DAINT_OEPINT9 BSP_BIT32(25)
238#define STM32F4_OTGFS_DAINT_OEPINT8 BSP_BIT32(24)
239#define STM32F4_OTGFS_DAINT_OEPINT7 BSP_BIT32(23)
240#define STM32F4_OTGFS_DAINT_OEPINT6 BSP_BIT32(22)
241#define STM32F4_OTGFS_DAINT_OEPINT5 BSP_BIT32(21)
242#define STM32F4_OTGFS_DAINT_OEPINT4 BSP_BIT32(20)
243#define STM32F4_OTGFS_DAINT_OEPINT3 BSP_BIT32(19)
244#define STM32F4_OTGFS_DAINT_OEPINT2 BSP_BIT32(18)
245#define STM32F4_OTGFS_DAINT_OEPINT1 BSP_BIT32(17)
246#define STM32F4_OTGFS_DAINT_OEPINT0 BSP_BIT32(16)
247#define STM32F4_OTGFS_DAINT_IEPINT15 BSP_BIT32(15)
248#define STM32F4_OTGFS_DAINT_IEPINT14 BSP_BIT32(14)
249#define STM32F4_OTGFS_DAINT_IEPINT13 BSP_BIT32(13)
250#define STM32F4_OTGFS_DAINT_IEPINT12 BSP_BIT32(12)
251#define STM32F4_OTGFS_DAINT_IEPINT11 BSP_BIT32(11)
252#define STM32F4_OTGFS_DAINT_IEPINT10 BSP_BIT32(10)
253#define STM32F4_OTGFS_DAINT_IEPINT9 BSP_BIT32(9)
254#define STM32F4_OTGFS_DAINT_IEPINT8 BSP_BIT32(8)
255#define STM32F4_OTGFS_DAINT_IEPINT7 BSP_BIT32(7)
256#define STM32F4_OTGFS_DAINT_IEPINT6 BSP_BIT32(6)
257#define STM32F4_OTGFS_DAINT_IEPINT5 BSP_BIT32(5)
258#define STM32F4_OTGFS_DAINT_IEPINT4 BSP_BIT32(4)
259#define STM32F4_OTGFS_DAINT_IEPINT3 BSP_BIT32(3)
260#define STM32F4_OTGFS_DAINT_IEPINT2 BSP_BIT32(2)
261#define STM32F4_OTGFS_DAINT_IEPINT1 BSP_BIT32(1)
262#define STM32F4_OTGFS_DAINT_IEPINT0 BSP_BIT32(0)
265#define STM32F4_OTGFS_DAINTMSK_OEPM(val) BSP_FLD32(val, 16, 31)
266#define STM32F4_OTGFS_DAINTMSK_OEPM_GET(reg) BSP_FLD32GET(reg, 16, 31)
267#define STM32F4_OTGFS_DAINTMSK_OEPM_SET(reg, val) BSP_FLD32SET(reg, val, 16, 31)
268#define STM32F4_OTGFS_DAINTMSK_IEPM(val) BSP_FLD32(val, 0, 15)
269#define STM32F4_OTGFS_DAINTMSK_IEPM_GET(reg) BSP_FLD32GET(reg, 0, 15)
270#define STM32F4_OTGFS_DAINTMSK_IEPM_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
275#define STM32F4_OTGFS_DVBUSDIS_VBUSDT(val) BSP_FLD32(val, 0, 15)
276#define STM32F4_OTGFS_DVBUSDIS_VBUSDT_GET(reg) BSP_FLD32GET(reg, 0, 15)
277#define STM32F4_OTGFS_DVBUSDIS_VBUSDT_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
280#define STM32F4_OTGFS_DVBUSPULSE_DVBUSP(val) BSP_FLD32(val, 0, 15)
281#define STM32F4_OTGFS_DVBUSPULSE_DVBUSP_GET(reg) BSP_FLD32GET(reg, 0, 15)
282#define STM32F4_OTGFS_DVBUSPULSE_DVBUSP_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
287#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM15 BSP_BIT32(15)
288#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM14 BSP_BIT32(14)
289#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM13 BSP_BIT32(13)
290#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM12 BSP_BIT32(12)
291#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM11 BSP_BIT32(11)
292#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM10 BSP_BIT32(10)
293#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM9 BSP_BIT32(9)
294#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM8 BSP_BIT32(8)
295#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM7 BSP_BIT32(7)
296#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM6 BSP_BIT32(6)
297#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM5 BSP_BIT32(5)
298#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM4 BSP_BIT32(4)
299#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM3 BSP_BIT32(3)
300#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM2 BSP_BIT32(2)
301#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM1 BSP_BIT32(1)
302#define STM32F4_OTGFS_DIEPEMPMSK_INEPTXFEM0 BSP_BIT32(0)
309#define STM32F4_OTGFS_DIEPCTL_EPENA BSP_BIT32(31)
310#define STM32F4_OTGFS_DIEPCTL_EPDIS BSP_BIT32(30)
311#define STM32F4_OTGFS_DIEPCTL_SODDFRM BSP_BIT32(29)
312#define STM32F4_OTGFS_DIEPCTL_SD0PID BSP_BIT32(28)
313#define STM32F4_OTGFS_DIEPCTL_SEVNFRM BSP_BIT32(28)
314#define STM32F4_OTGFS_DIEPCTL_SNAK BSP_BIT32(27)
315#define STM32F4_OTGFS_DIEPCTL_CNAK BSP_BIT32(26)
316#define STM32F4_OTGFS_DIEPCTL_TXFNUM(val) BSP_FLD32(val, 22, 25)
317#define STM32F4_OTGFS_DIEPCTL_TXFNUM_GET(reg) BSP_FLD32GET(reg, 22, 25)
318#define STM32F4_OTGFS_DIEPCTL_TXFNUM_SET(reg, val) BSP_FLD32SET(reg, val, 22, 25)
319#define STM32F4_OTGFS_DIEPCTL_STALL BSP_BIT32(21)
320#define STM32F4_OTGFS_DIEPCTL_EPTYP(val) BSP_FLD32(val, 18, 19)
321#define STM32F4_OTGFS_DIEPCTL_EPTYP_GET(reg) BSP_FLD32GET(reg, 18, 19)
322#define STM32F4_OTGFS_DIEPCTL_EPTYP_SET(reg, val) BSP_FLD32SET(reg, val, 18, 19)
327#define STM32F4_OTGFS_DIEPCTL_NAKSTS BSP_BIT32(17)
328#define STM32F4_OTGFS_DIEPCTL_EONUM_DPID BSP_BIT32(16)
329#define STM32F4_OTGFS_DIEPCTL_USBAEP BSP_BIT32(15)
330#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ(val) BSP_FLD32(val, 0, 1)
331#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_GET(reg) BSP_FLD32GET(reg, 0, 1)
332#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 1)
334#define EP0_MPSIZ_16 2
335#define EP0_MPSIZ_32 1
336#define EP0_MPSIZ_64 0
337#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_8 STM32F4_OTGFS_DIEPCTL_MPSIZ(EP0_MPSIZ_8)
338#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_16 STM32F4_OTGFS_DIEPCTL_MPSIZ(EP0_MPSIZ_16)
339#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_32 STM32F4_OTGFS_DIEPCTL_MPSIZ(EP0_MPSIZ_32)
340#define STM32F4_OTGFS_DIEPCTL_EP0_MPSIZ_64 STM32F4_OTGFS_DIEPCTL_MPSIZ(EP0_MPSIZ_64)
341#define STM32F4_OTGFS_DIEPCTL_MPSIZ(val) BSP_FLD32(val, 0, 10)
342#define STM32F4_OTGFS_DIEPCTL_MPSIZ_GET(reg) BSP_FLD32GET(reg, 0, 10)
343#define STM32F4_OTGFS_DIEPCTL_MPSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 10)
345 uint32_t reserved_04;
348#define STM32F4_OTGFS_DIEPINT_TXFE BSP_BIT32(7)
349#define STM32F4_OTGFS_DIEPINT_INEPNE BSP_BIT32(6)
350#define STM32F4_OTGFS_DIEPINT_ITTXFE BSP_BIT32(4)
351#define STM32F4_OTGFS_DIEPINT_TOC BSP_BIT32(3)
352#define STM32F4_OTGFS_DIEPINT_EPDISD BSP_BIT32(1)
353#define STM32F4_OTGFS_DIEPINT_XFRC BSP_BIT32(0)
355 uint32_t reserved_0C;
358#define STM32F4_OTGFS_DIEPTSIZ_EP0_PKTCNT(val) BSP_FLD32(val, 19, 20)
359#define STM32F4_OTGFS_DIEPTSIZ_EP0_PKTCNT_GET(reg) BSP_FLD32GET(reg, 19, 20)
360#define STM32F4_OTGFS_DIEPTSIZ_EP0_PKTCNT_SET(reg, val) BSP_FLD32SET(reg, val, 19, 20)
361#define STM32F4_OTGFS_DIEPTSIZ_EP0_XFRSIZ(val) BSP_FLD32(val, 0, 6)
362#define STM32F4_OTGFS_DIEPTSIZ_EP0_XFRSIZ_GET(reg) BSP_FLD32GET(reg, 0, 6)
363#define STM32F4_OTGFS_DIEPTSIZ_EP0_XFRSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 6)
364#define STM32F4_OTGFS_DIEPTSIZ_MCNT(val) BSP_FLD32(val, 29, 30)
365#define STM32F4_OTGFS_DIEPTSIZ_MCNT_GET(reg) BSP_FLD32GET(reg, 29, 30)
366#define STM32F4_OTGFS_DIEPTSIZ_MCNT_SET(reg, val) BSP_FLD32SET(reg, val, 29, 30)
367#define STM32F4_OTGFS_DIEPTSIZ_PKTCNT(val) BSP_FLD32(val, 19, 28)
368#define STM32F4_OTGFS_DIEPTSIZ_PKTCNT_GET(reg) BSP_FLD32GET(reg, 19, 28)
369#define STM32F4_OTGFS_DIEPTSIZ_PKTCNT_SET(reg, val) BSP_FLD32SET(reg, val, 19, 28)
370#define STM32F4_OTGFS_DIEPTSIZ_XFRSIZ(val) BSP_FLD32(val, 0, 18)
371#define STM32F4_OTGFS_DIEPTSIZ_XFRSIZ_GET(reg) BSP_FLD32GET(reg, 0, 18)
372#define STM32F4_OTGFS_DIEPTSIZ_XFRSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 18)
374 uint32_t reserved_14;
377#define STM32F4_OTGFS_DTXFSTS_INEPTFSAV(val) BSP_FLD32(val, 0, 15)
378#define STM32F4_OTGFS_DTXFSTS_INEPTFSAV_GET(reg) BSP_FLD32(reg, 0, 15)
379#define STM32F4_OTGFS_DTXFSTS_INEPTFSAV_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
381 uint32_t reserved_1C;
388#define STM32F4_OTGFS_DOEPCTL_EPENA BSP_BIT32(31)
389#define STM32F4_OTGFS_DOEPCTL_EPDIS BSP_BIT32(30)
390#define STM32F4_OTGFS_DOEPCTL_SD1PID BSP_BIT32(29)
391#define STM32F4_OTGFS_DOEPCTL_SD0PID BSP_BIT32(28)
392#define STM32F4_OTGFS_DOEPCTL_SNAK BSP_BIT32(27)
393#define STM32F4_OTGFS_DOEPCTL_CNAK BSP_BIT32(26)
394#define STM32F4_OTGFS_DOEPCTL_STALL BSP_BIT32(21)
395#define STM32F4_OTGFS_DOEPCTL_SNPM BSP_BIT32(20)
396#define STM32F4_OTGFS_DOEPCTL_EPTYP(val) BSP_FLD32(val, 18, 19)
397#define STM32F4_OTGFS_DOEPCTL_EPTYP_GET(reg) BSP_FLD32GET(reg, 18, 19)
398#define STM32F4_OTGFS_DOEPCTL_EPTYP_SET(reg, val) BSP_FLD32SET(reg, val, 18, 19)
399#define STM32F4_OTGFS_DOEPCTL_NAKSTS BSP_BIT32(17)
400#define STM32F4_OTGFS_DOEPCTL_EONUM_DPID BSP_BIT32(16)
401#define STM32F4_OTGFS_DOEPCTL_USBAEP BSP_BIT32(15)
402#define STM32F4_OTGFS_DOEPCTL_MPSIZ(val) BSP_FLD32(val, 0, 10)
403#define STM32F4_OTGFS_DOEPCTL_MPSIZ_GET(reg) BSP_FLD32GET(reg, 0, 10)
404#define STM32F4_OTGFS_DOEPCTL_MPSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 10)
409#define STM32F4_OTGFS_DOEPINT_B2BSTUP BSP_BIT32(6)
410#define STM32F4_OTGFS_DOEPINT_OTEPDIS BSP_BIT32(4)
411#define STM32F4_OTGFS_DOEPINT_STUP BSP_BIT32(3)
412#define STM32F4_OTGFS_DOEPINT_EPDISD BSP_BIT32(1)
413#define STM32F4_OTGFS_DOEPINT_XFRC BSP_BIT32(0)
416#define STM32F4_OTGFS_DOEPTSIZ_EP0_STUPCNT(val) BSP_FLD32(val, 29, 30)
417#define STM32F4_OTGFS_DOEPTSIZ_EP0_STUPCNT_GET(reg) BSP_FLD32GET(reg, 29, 30)
418#define STM32F4_OTGFS_DOEPTSIZ_EP0_STUPCNT_SET(reg, val) BSP_FLD32SET(reg, val, 29, 30)
419#define STM32F4_OTGFS_DOEPTSIZ_EP0_PKTCNT BSP_BIT32(19)
420#define STM32F4_OTGFS_DOEPTSIZ_EP0_XFRSIZ(val) BSP_FLD32(val, 0, 6)
421#define STM32F4_OTGFS_DOEPTSIZ_EP0_XFRSIZ_GET(reg) BSP_FLD32GET(reg, 0, 6)
422#define STM32F4_OTGFS_DOEPTSIZ_EP0_XFRSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 6)
423#define STM32F4_OTGFS_DOEPTSIZ_RXDPID(val) BSP_FLD32(val, 29, 30)
424#define STM32F4_OTGFS_DOEPTSIZ_RXDPID_GET(reg) BSP_FLD32GET(reg, 29, 30)
425#define STM32F4_OTGFS_DOEPTSIZ_RXDPID_SET(reg, val) BSP_FLD32SET(reg, val, 29, 30)
426#define STM32F4_OTGFS_DOEPTSIZ_PKTCNT(val) BSP_FLD32(val, 19, 28)
427#define STM32F4_OTGFS_DOEPTSIZ_PKTCNT_GET(reg) BSP_FLD32GET(reg, 19, 28)
428#define STM32F4_OTGFS_DOEPTSIZ_PKTCNT_SET(reg, val) BSP_FLD32SET(reg, val, 19, 28)
429#define STM32F4_OTGFS_DOEPTSIZ_XFRSIZ(val) BSP_FLD32(val, 0, 18)
430#define STM32F4_OTGFS_DOEPTSIZ_XFRSIZ_GET(reg) BSP_FLD32GET(reg, 0, 18)
431#define STM32F4_OTGFS_DOEPTSIZ_XFRSIZ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 18)
439#define STM32F4_OTGFS_PCGCCTL_PHYSUSP BSP_BIT32(4)
440#define STM32F4_OTGFS_PCGCCTL_GATEHCLK BSP_BIT32(1)
441#define STM32F4_OTGFS_PCGCCTL_STPPCLK BSP_BIT32(0)
This header file provides utility macros for BSPs.
Definition: xnandpsu_onfi.h:185
Definition: stm32f4xxxx_otgfs.h:183
Definition: stm32f4xxxx_otgfs.h:307
Definition: stm32f4xxxx_otgfs.h:386
Definition: stm32f4xxxx_otgfs.h:437
Definition: stm32f4xxxx_otgfs.h:26