100 pdev->dev.device_address = 0;
105 ep = &pdev->dev.in_ep[
i];
119 ep = &pdev->dev.out_ep[
i];
133 #if defined (STM32F446xx) || defined (STM32F469_479xx) 152 USB_OTG_CoreInitDev(pdev);
172 if ((ep_addr & 0x80) == 0x80)
174 ep = &pdev->dev.in_ep[ep_addr & 0x7F];
178 ep = &pdev->dev.out_ep[ep_addr & 0x7F];
180 ep->
num = ep_addr & 0x7F;
182 ep->
is_in = (0x80 & ep_addr) != 0;
195 USB_OTG_EPActivate(pdev , ep );
208 if ((ep_addr&0x80) == 0x80)
210 ep = &pdev->dev.in_ep[ep_addr & 0x7F];
214 ep = &pdev->dev.out_ep[ep_addr & 0x7F];
216 ep->
num = ep_addr & 0x7F;
217 ep->
is_in = (0x80 & ep_addr) != 0;
218 USB_OTG_EPDeactivate(pdev , ep );
238 ep = &pdev->dev.out_ep[ep_addr & 0x7F];
245 ep->
num = ep_addr & 0x7F;
254 USB_OTG_EP0StartXfer(pdev , ep);
258 USB_OTG_EPStartXfer(pdev, ep );
278 ep = &pdev->dev.in_ep[ep_addr & 0x7F];
282 ep->
num = ep_addr & 0x7F;
290 USB_OTG_EP0StartXfer(pdev , ep);
294 USB_OTG_EPStartXfer(pdev, ep );
309 if ((0x80 & epnum) == 0x80)
311 ep = &pdev->dev.in_ep[epnum & 0x7F];
315 ep = &pdev->dev.out_ep[epnum];
319 ep->
num = epnum & 0x7F;
320 ep->
is_in = ((epnum & 0x80) == 0x80);
322 USB_OTG_EPSetStall(pdev , ep);
336 if ((0x80 & epnum) == 0x80)
338 ep = &pdev->dev.in_ep[epnum & 0x7F];
342 ep = &pdev->dev.out_ep[epnum];
346 ep->
num = epnum & 0x7F;
347 ep->
is_in = ((epnum & 0x80) == 0x80);
349 USB_OTG_EPClearStall(pdev , ep);
363 if ((epnum & 0x80) == 0x80)
438 if ((0x80 & epnum) == 0x80)
440 ep = &pdev->dev.in_ep[epnum & 0x7F];
444 ep = &pdev->dev.out_ep[epnum];
447 Status = USB_OTG_GetEPStatus(pdev ,ep);
464 if ((0x80 & epnum) == 0x80)
466 ep = &pdev->dev.in_ep[epnum & 0x7F];
470 ep = &pdev->dev.out_ep[epnum];
473 USB_OTG_SetEPStatus(pdev ,ep , Status);
uint32_t DCD_GetEPStatus(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
returns the EP Status
uint32_t DCD_EP_Flush(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
This Function flushes the FIFOs.
Specific api's relative to the used hardware platform.
USB_OTG_STS USB_OTG_SetCurrentMode(USB_OTG_CORE_HANDLE *pdev, uint8_t mode)
USB_OTG_SetCurrentMode : Set ID line.
void DCD_DevConnect(USB_OTG_CORE_HANDLE *pdev)
Connect device (enable internal pull-up)
USB_OTG_STS USB_OTG_DisableGlobalInt(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_DisableGlobalInt Enables the controller's Global Int in the AHB Config reg.
void DCD_Init(USB_OTG_CORE_HANDLE *pdev, USB_OTG_CORE_ID_TypeDef coreID)
uint32_t DCD_EP_Tx(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t buf_len)
Transmit data over USB.
void DCD_DevDisconnect(USB_OTG_CORE_HANDLE *pdev)
Disconnect device (disable internal pull-up)
USB_OTG_STS USB_OTG_FlushRxFifo(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_FlushRxFifo : Flush a Rx FIFO.
#define USB_OTG_MAX_EP0_SIZE
uint32_t DCD_EP_Open(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type)
Configure an EP.
uint32_t DCD_EP_Close(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr)
called when an EP is disabled
#define USB_OTG_WRITE_REG32(reg, value)
USB_OTG_STS USB_OTG_FlushTxFifo(USB_OTG_CORE_HANDLE *pdev, uint32_t num)
USB_OTG_FlushTxFifo : Flush a Tx FIFO.
#define USB_OTG_READ_REG32(reg)
void USB_OTG_BSP_mDelay(const uint32_t msec)
USB_OTG_BSP_mDelay This function provides delay time in milli sec.
void DCD_SetEPStatus(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum, uint32_t Status)
Set the EP Status.
USB_OTG_STS USB_OTG_SelectCore(USB_OTG_CORE_HANDLE *pdev, USB_OTG_CORE_ID_TypeDef coreID)
USB_OTG_SelectCore Initialize core registers address.
uint32_t DCD_EP_Stall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Stall an endpoint.
USB_OTG_STS USB_OTG_EnableGlobalInt(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg.
Peripheral Driver Header file.
void DCD_EP_SetAddress(USB_OTG_CORE_HANDLE *pdev, uint8_t address)
This Function set USB device address.
uint32_t DCD_EP_PrepareRx(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len)
DCD_EP_PrepareRx.
USB_OTG_STS USB_OTG_CoreInit(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_CoreInit Initializes the USB_OTG controller registers and prepares the core device mode or ho...
#define USB_OTG_MODIFY_REG32(reg, clear_mask, set_mask)
struct _USB_OTG_DCTL_TypeDef::@74 b
uint32_t DCD_EP_ClrStall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Clear stall condition on endpoints.
struct _USB_OTG_DCFG_TypeDef::@73 b