AM261x MCU+ SDK  11.00.00

Introduction

The PCD calls these routines when it needs something from the Function Driver.

Functions

void * dwc_usb3_gadget_alloc_dma (volatile dwc_usb3_pcd_ep_t *ep, int size, dwc_dma_t *mem_dma_ret)
 This routine allocates coherent DMA memory. It is used by the PCD to allocate memory for TRBs. The block of memory returned must have a start address aligned to a 16-byte boundary. More...
 
void dwc_usb3_gadget_free_dma (volatile dwc_usb3_pcd_ep_t *ep, int size, void *mem, dwc_dma_t mem_dma)
 This routine frees DMA memory allocated by dwc_usb3_gadget_alloc_dma(). More...
 
dwc_usb3_pcd_req_tdwc_usb3_gadget_get_request (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep)
 This routine returns the PCD request corresponding to the current transfer request for an endpoint. The current transfer request is the first request submitted that has not been completed yet. More...
 
void dwc_usb3_gadget_start_next_request (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep)
 This routine checks to see if there is another transfer request waiting on an endpoint that has not been started yet. If so then that transfer is started. More...
 
void dwc_usb3_gadget_isoc_ep_start (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep, u32 event)
 This routine starts an Isoc EP running at the proper interval, after receiving the initial XferNrdy event. More...
 
void dwc_usb3_gadget_request_nuke (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep)
 This routine terminates all requests which are pending on an endpoint. More...
 
void dwc_usb3_gadget_set_ep_not_started (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep)
 This routine marks all pending requests for an EP as not started. More...
 

Function Documentation

◆ dwc_usb3_gadget_alloc_dma()

void* dwc_usb3_gadget_alloc_dma ( volatile dwc_usb3_pcd_ep_t pcd_ep,
int  size,
dwc_dma_t mem_dma_ret 
)

This routine allocates coherent DMA memory. It is used by the PCD to allocate memory for TRBs. The block of memory returned must have a start address aligned to a 16-byte boundary.

This routine may be called from interrupt context, so it must be able to allocate coherent DMA memory in that context. One strategy would be to preallocate a block of memory at initialization time, and hand out chunks from that block in this routine.

Parameters
pcd_epPCD EP that memory block will be associated with.
sizeSize of memory block to allocate, in bytes.
mem_dma_retPhysical address of allocated memory block is returned through this pointer.
Returns
Address of allocated memory block, or NULL if allocation fails.

◆ dwc_usb3_gadget_free_dma()

void dwc_usb3_gadget_free_dma ( volatile dwc_usb3_pcd_ep_t pcd_ep,
int  size,
void *  mem,
dwc_dma_t  mem_dma 
)

This routine frees DMA memory allocated by dwc_usb3_gadget_alloc_dma().

Parameters
pcd_epPCD EP that memory block is associated with.
sizeSize of memory block to free, in bytes.
memAddress of memory block.
mem_dmaPhysical address of memory block.

◆ dwc_usb3_gadget_get_request()

dwc_usb3_pcd_req_t* dwc_usb3_gadget_get_request ( volatile dwc_usb3_pcd_t pcd,
volatile dwc_usb3_pcd_ep_t pcd_ep 
)

This routine returns the PCD request corresponding to the current transfer request for an endpoint. The current transfer request is the first request submitted that has not been completed yet.

Parameters
pcdProgramming view of DWC_usb3 peripheral controller.
pcd_epPCD EP to operate on.
Returns
Pointer to PCD request, or NULL if no request available.

◆ dwc_usb3_gadget_start_next_request()

void dwc_usb3_gadget_start_next_request ( volatile dwc_usb3_pcd_t pcd,
volatile dwc_usb3_pcd_ep_t pcd_ep 
)

This routine checks to see if there is another transfer request waiting on an endpoint that has not been started yet. If so then that transfer is started.

Parameters
pcdProgramming view of DWC_usb3 peripheral controller.
pcd_epPCD EP to operate on.

◆ dwc_usb3_gadget_isoc_ep_start()

void dwc_usb3_gadget_isoc_ep_start ( volatile dwc_usb3_pcd_t pcd,
volatile dwc_usb3_pcd_ep_t pcd_ep,
u32  event 
)

This routine starts an Isoc EP running at the proper interval, after receiving the initial XferNrdy event.

Parameters
pcdProgramming view of DWC_usb3 peripheral controller.
pcd_epEP to operate on.
eventEvent data containing the XferNrdy microframe.

◆ dwc_usb3_gadget_request_nuke()

void dwc_usb3_gadget_request_nuke ( volatile dwc_usb3_pcd_t pcd,
volatile dwc_usb3_pcd_ep_t pcd_ep 
)

This routine terminates all requests which are pending on an endpoint.

Parameters
pcdProgramming view of DWC_usb3 peripheral controller.
pcd_epEP to operate on.

◆ dwc_usb3_gadget_set_ep_not_started()

void dwc_usb3_gadget_set_ep_not_started ( volatile dwc_usb3_pcd_t pcd,
volatile dwc_usb3_pcd_ep_t pcd_ep 
)

This routine marks all pending requests for an EP as not started.

Parameters
pcdProgramming view of DWC_usb3 peripheral controller.
pcd_epEP to operate on.