SAMV71 Xplained Ultra Software Package 1.3

Usbd_hal

Collaboration diagram for Usbd_hal:

Data Structures

struct  TransferHeader
struct  Transfer
struct  MblTransfer
struct  Endpoint
struct  UdphsDmaDescriptor

Modules

 USB Device LEDs

Defines

#define DMA
#define NUM_IT_MAX   11
#define NUM_IT_MAX_DMA
#define SHIFT_INTERUPT   12
#define DMA_MAX_FIFO_SIZE   (65536/1)
#define EPT_VIRTUAL_SIZE   16384
#define UDPHS_ENDPOINT_DISABLED   0
#define UDPHS_ENDPOINT_HALTED   1
#define UDPHS_ENDPOINT_IDLE   2
#define UDPHS_ENDPOINT_SENDING   3
#define UDPHS_ENDPOINT_RECEIVING   4
#define UDPHS_ENDPOINT_SENDINGM   5
#define UDPHS_ENDPOINT_RECEIVINGM   6
#define MBL_NbBuffer(i, o, size)   (((i)>(o))?((i)-(o)):((i)+(size)-(o)))
#define MBL_FULL   1
#define MBL_NULL   2
#define CHIP_USB_UDP
#define CHIP_USB_PULLUP_INTERNAL
#define CHIP_USB_NUMENDPOINTS   8
#define CHIP_USB_ENDPOINTS_MAXPACKETSIZE(i)
#define CHIP_USB_ENDPOINTS_BANKS(i)
#define UDP_CSR_RXDATA_BK   (UDP_CSR_RX_DATA_BK0 | UDP_CSR_RX_DATA_BK1)
#define UDP_ENDPOINT_DISABLED   0
#define UDP_ENDPOINT_HALTED   1
#define UDP_ENDPOINT_IDLE   2
#define UDP_ENDPOINT_SENDING   3
#define UDP_ENDPOINT_RECEIVING   4
#define UDP_ENDPOINT_SENDINGM   5
#define UDP_ENDPOINT_RECEIVINGM   6
#define REG_NO_EFFECT_1_ALL
#define SET_CSR(endpoint, flags)
#define CLEAR_CSR(endpoint, flags)
#define MBL_NbBuffer(i, o, size)   (((i)>(o))?((i)-(o)):((i)+(size)-(o)))
#define MBL_FULL   1
#define MBL_NULL   2
#define DMA
#define NUM_IT_MAX   (UDPHS->UDPHS_IPFEATURES & UDPHS_IPFEATURES_EPT_NBR_MAX_Msk)
#define NUM_IT_MAX_DMA
#define SHIFT_DMA   24
#define SHIFT_INTERUPT   8
#define DMA_MAX_FIFO_SIZE   (65536/1)
#define EPT_VIRTUAL_SIZE   16384
#define UDPHS_ENDPOINT_DISABLED   0
#define UDPHS_ENDPOINT_HALTED   1
#define UDPHS_ENDPOINT_IDLE   2
#define UDPHS_ENDPOINT_SENDING   3
#define UDPHS_ENDPOINT_RECEIVING   4
#define UDPHS_ENDPOINT_SENDINGM   5
#define UDPHS_ENDPOINT_RECEIVINGM   6
#define MBL_NbBuffer(i, o, size)   (((i)>(o))?((i)-(o)):((i)+(size)-(o)))
#define MBL_FULL   1
#define MBL_NULL   2
#define bmEP(bEP)   (1 << (bEP))
#define EndpointInt
#define DMAEndpointInt

Functions

 COMPILER_ALIGNED (16)
void USBHS_Handler (void)
void USBD_HAL_ResetEPs (uint32_t bmEPs, uint8_t bStatus, uint8_t bKeepCfg)
 Reset endpoints and disable them.

  1. Terminate transfer if there is any, with given status;
  2. Reset the endpoint & disable it.

void USBD_HAL_CancelIo (uint32_t bmEPs)
uint8_t USBD_HAL_ConfigureEP (const USBEndpointDescriptor *pDescriptor)
uint8_t USBD_HAL_SetTransferCallback (uint8_t bEP, TransferCallback fCallback, void *pCbData)
uint8_t USBD_HAL_SetupMblTransfer (uint8_t bEndpoint, USBDTransferBuffer *pMbList, uint16_t mblSize, uint16_t startOffset)
uint8_t USBD_HAL_Write (uint8_t bEndpoint, const void *pData, uint32_t dLength)
uint8_t USBD_HAL_WrWithHdr (uint8_t bEndpoint, const void *pHdr, uint8_t bHdrLen, const void *pData, uint32_t dLength)
uint8_t USBD_HAL_Read (uint8_t bEndpoint, void *pData, uint32_t dLength)
void USBD_HAL_Connect (void)
 Enable Pull-up, connect.
void USBD_HAL_Disconnect (void)
 Disable Pull-up, disconnect.
void USBD_HAL_RemoteWakeUp (void)
void USBD_HAL_SetAddress (uint8_t address)
void USBD_HAL_SetConfiguration (uint8_t cfgnum)
void USBD_HAL_Init (void)
uint8_t USBD_HAL_Stall (uint8_t bEP)
uint8_t USBD_HAL_Halt (uint8_t bEndpoint, uint8_t ctl)
uint8_t USBD_HAL_IsHighSpeed (void)
void USBD_HAL_Suspend (void)
void USBD_HAL_Activate (void)
void USBD_HAL_Disable (void)
void USBD_HAL_Test (uint8_t bIndex)
void USBD_IrqHandler (void)
void USBD_HAL_DetachUsb (void)
void USBD_HAL_AttachUsb (void)
void USBD_HAL_Enable (void)

Define Documentation

#define bmEP (   bEP  )     (1 << (bEP))

Get bitmap for an endpoint

Definition at line 60 of file USBD_HAL.h.

#define CHIP_USB_ENDPOINTS_BANKS (   i  ) 
Value:
((i == 0) ? 1 : \
   ((i == 1) ? 2 : \
   ((i == 2) ? 2 : \
   ((i == 3) ? 1 : \
   ((i == 4) ? 2 : \
   ((i == 5) ? 2 : \
   ((i == 6) ? 2 : \
   ((i == 7) ? 2 : 0 ))))))))

Endpoints Number of Bank

Definition at line 80 of file hal_udp.c.

#define CHIP_USB_ENDPOINTS_MAXPACKETSIZE (   i  ) 
Value:
((i == 0) ? 64 : \
   ((i == 1) ? 64 : \
   ((i == 2) ? 64 : \
   ((i == 3) ? 64 : \
   ((i == 4) ? 512 : \
   ((i == 5) ? 512 : \
   ((i == 6) ? 64 : \
   ((i == 7) ? 64 : 0 ))))))))

Endpoints max paxcket size

Definition at line 69 of file hal_udp.c.

#define CHIP_USB_NUMENDPOINTS   8

Number of USB endpoints

Definition at line 66 of file hal_udp.c.

#define CHIP_USB_PULLUP_INTERNAL

Indicates chip has an internal pull-up.

Definition at line 63 of file hal_udp.c.

#define CHIP_USB_UDP

Indicates chip has an UDP Full Speed.

Definition at line 60 of file hal_udp.c.

#define CLEAR_CSR (   endpoint,
  flags 
)
Value:
{ \
    volatile uint32_t reg; \
    int32_t nop_count ; \
    reg = UDP->UDP_CSR[endpoint]; \
    reg |= REG_NO_EFFECT_1_ALL; \
    reg &= ~((uint32_t)(flags)); \
    UDP->UDP_CSR[endpoint] = reg; \
    for( nop_count=0; nop_count<15; nop_count++ ) {\
        nop();\
    }\
}

Clears the specified bit(s) in the UDP_CSR register.

Parameters:
endpoint The endpoint number of the CSR to process.
flags The bitmap to clear to 0.

Definition at line 188 of file hal_udp.c.

#define DMA_MAX_FIFO_SIZE   (65536/1)

Max size of the FMA FIFO

Definition at line 72 of file USBD_HAL.c.

#define DMA_MAX_FIFO_SIZE   (65536/1)

Max size of the FMA FIFO

Definition at line 76 of file hal_udphs.c.

#define DMAEndpointInt
#define EPT_VIRTUAL_SIZE   16384

fifo space size in DW

Definition at line 78 of file hal_udphs.c.

#define EPT_VIRTUAL_SIZE   16384

fifo space size in DW

Definition at line 74 of file USBD_HAL.c.

#define MBL_FULL   1

Buffer list is full

Definition at line 210 of file hal_udp.c.

#define MBL_FULL   1

Buffer list is full

Definition at line 118 of file hal_udphs.c.

#define MBL_FULL   1

Buffer list is full

Definition at line 115 of file USBD_HAL.c.

#define MBL_NbBuffer (   i,
  o,
  size 
)    (((i)>(o))?((i)-(o)):((i)+(size)-(o)))

Get Number of buffer in Multi-Buffer-List

Parameters:
i input index
o output index
size list size

Definition at line 207 of file hal_udp.c.

#define MBL_NbBuffer (   i,
  o,
  size 
)    (((i)>(o))?((i)-(o)):((i)+(size)-(o)))

Get Number of buffer in Multi-Buffer-List

Parameters:
i input index
o output index
size list size

Definition at line 115 of file hal_udphs.c.

#define MBL_NbBuffer (   i,
  o,
  size 
)    (((i)>(o))?((i)-(o)):((i)+(size)-(o)))

Get Number of buffer in Multi-Buffer-List

Parameters:
i input index
o output index
size list size

Definition at line 112 of file USBD_HAL.c.

#define MBL_NULL   2

Buffer list is null

Definition at line 117 of file USBD_HAL.c.

#define MBL_NULL   2

Buffer list is null

Definition at line 212 of file hal_udp.c.

#define MBL_NULL   2

Buffer list is null

Definition at line 120 of file hal_udphs.c.

#define NUM_IT_MAX   (UDPHS->UDPHS_IPFEATURES & UDPHS_IPFEATURES_EPT_NBR_MAX_Msk)

Maximum number of endpoints interrupts.

Definition at line 63 of file hal_udphs.c.

#define NUM_IT_MAX   11

Maximum number of endpoints interrupts.

Definition at line 61 of file USBD_HAL.c.

#define NUM_IT_MAX_DMA
Value:
((UDPHS->UDPHS_IPFEATURES \
        & UDPHS_IPFEATURES_DMA_CHANNEL_NBR_Msk) \
      >>UDPHS_IPFEATURES_DMA_CHANNEL_NBR_Pos)

Maximum number of endpoint DMA interrupts

Definition at line 66 of file hal_udphs.c.

#define NUM_IT_MAX_DMA
Value:
((USBHS->UDPHS_IPFEATURES \
        & UDPHS_IPFEATURES_DMA_CHANNEL_NBR_Msk) \
      >>UDPHS_IPFEATURES_DMA_CHANNEL_NBR_Pos)

Maximum number of endpoint DMA interrupts

Definition at line 63 of file USBD_HAL.c.

#define REG_NO_EFFECT_1_ALL
Value:
UDP_CSR_RX_DATA_BK0 | UDP_CSR_RX_DATA_BK1 \
                                |UDP_CSR_STALLSENTISOERROR | UDP_CSR_RXSETUP \
                                |UDP_CSR_TXCOMP

"UDP CSR register access"

This page lists the macros to access UDP CSR register.

In a preemptive environment, set or clear the flag and wait for a time of 1 UDPCK clock cycle and 1 peripheral clock cycle. However, RX_DATA_BK0, TXPKTRDY, RX_DATA_BK1 require wait times of 3 UDPCK clock cycles and 5 peripheral clock cycles before accessing DPR. See datasheet

!Macros

  • CLEAR_CSR
  • SET_CSR Bitmap for all status bits in CSR.

Definition at line 159 of file hal_udp.c.

#define SET_CSR (   endpoint,
  flags 
)
Value:
{ \
        volatile uint32_t reg; \
        int32_t nop_count ; \
        reg = UDP->UDP_CSR[endpoint] ; \
        reg |= REG_NO_EFFECT_1_ALL; \
        reg |= (flags); \
        UDP->UDP_CSR[endpoint] = reg; \
        for( nop_count=0; nop_count<15; nop_count++ ) {\
            nop();\
        }\
    }

Sets the specified bit(s) in the UDP_CSR register.

Parameters:
endpoint The endpoint number of the CSR to process.
flags The bitmap to set to 1.

Definition at line 169 of file hal_udp.c.

#define SHIFT_DMA   24

Bits that should be shifted to access DMA control bits.

Definition at line 71 of file hal_udphs.c.

#define SHIFT_INTERUPT   12

Bits that should be shifted to access interrupt bits.

Definition at line 69 of file USBD_HAL.c.

#define SHIFT_INTERUPT   8

Bits that should be shifted to access interrupt bits.

Definition at line 73 of file hal_udphs.c.

#define UDP_CSR_RXDATA_BK   (UDP_CSR_RX_DATA_BK0 | UDP_CSR_RX_DATA_BK1)

"UDP Register field values"

This section lists the initialize values of UDP registers.

Values

  • UDP_RXDATA Bit mask for both banks of the UDP_CSR register.

Definition at line 99 of file hal_udp.c.

#define UDP_ENDPOINT_DISABLED   0

"UDP Endpoint states"

This page lists the endpoint states.

States

  • UDP_ENDPOINT_DISABLED
  • UDP_ENDPOINT_HALTED
  • UDP_ENDPOINT_IDLE
  • UDP_ENDPOINT_SENDING
  • UDP_ENDPOINT_RECEIVING
  • UDP_ENDPOINT_SENDINGM
  • UDP_ENDPOINT_RECEIVINGM Endpoint states: Endpoint is disabled

Definition at line 117 of file hal_udp.c.

#define UDP_ENDPOINT_HALTED   1

Endpoint states: Endpoint is halted (i.e. STALLs every request)

Definition at line 119 of file hal_udp.c.

#define UDP_ENDPOINT_IDLE   2

Endpoint states: Endpoint is idle (i.e. ready for transmission)

Definition at line 121 of file hal_udp.c.

#define UDP_ENDPOINT_RECEIVING   4

Endpoint states: Endpoint is receiving data

Definition at line 125 of file hal_udp.c.

#define UDP_ENDPOINT_RECEIVINGM   6

Endpoint states: Endpoint is receiving MBL

Definition at line 129 of file hal_udp.c.

#define UDP_ENDPOINT_SENDING   3

Endpoint states: Endpoint is sending data

Definition at line 123 of file hal_udp.c.

#define UDP_ENDPOINT_SENDINGM   5

Endpoint states: Endpoint is sending MBL

Definition at line 127 of file hal_udp.c.

#define UDPHS_ENDPOINT_DISABLED   0

"UDP Endpoint states"

This page lists the endpoint states.

States

  • UDPHS_ENDPOINT_DISABLED
  • UDPHS_ENDPOINT_HALTED
  • UDPHS_ENDPOINT_IDLE
  • UDPHS_ENDPOINT_SENDING
  • UDPHS_ENDPOINT_RECEIVING
  • UDPHS_ENDPOINT_SENDINGM
  • UDPHS_ENDPOINT_RECEIVINGM Endpoint states: Endpoint is disabled

Definition at line 96 of file hal_udphs.c.

#define UDPHS_ENDPOINT_DISABLED   0

"UDP Endpoint states"

This page lists the endpoint states.

States

  • UDPHS_ENDPOINT_DISABLED
  • UDPHS_ENDPOINT_HALTED
  • UDPHS_ENDPOINT_IDLE
  • UDPHS_ENDPOINT_SENDING
  • UDPHS_ENDPOINT_RECEIVING
  • UDPHS_ENDPOINT_SENDINGM
  • UDPHS_ENDPOINT_RECEIVINGM Endpoint states: Endpoint is disabled

Definition at line 92 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_HALTED   1

Endpoint states: Endpoint is halted (i.e. STALLs every request)

Definition at line 94 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_HALTED   1

Endpoint states: Endpoint is halted (i.e. STALLs every request)

Definition at line 98 of file hal_udphs.c.

#define UDPHS_ENDPOINT_IDLE   2

Endpoint states: Endpoint is idle (i.e. ready for transmission)

Definition at line 96 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_IDLE   2

Endpoint states: Endpoint is idle (i.e. ready for transmission)

Definition at line 100 of file hal_udphs.c.

#define UDPHS_ENDPOINT_RECEIVING   4

Endpoint states: Endpoint is receiving data

Definition at line 104 of file hal_udphs.c.

#define UDPHS_ENDPOINT_RECEIVING   4

Endpoint states: Endpoint is receiving data

Definition at line 100 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_RECEIVINGM   6

Endpoint states: Endpoint is receiving MBL

Definition at line 104 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_RECEIVINGM   6

Endpoint states: Endpoint is receiving MBL

Definition at line 108 of file hal_udphs.c.

#define UDPHS_ENDPOINT_SENDING   3

Endpoint states: Endpoint is sending data

Definition at line 102 of file hal_udphs.c.

#define UDPHS_ENDPOINT_SENDING   3

Endpoint states: Endpoint is sending data

Definition at line 98 of file USBD_HAL.c.

#define UDPHS_ENDPOINT_SENDINGM   5

Endpoint states: Endpoint is sending MBL

Definition at line 106 of file hal_udphs.c.

#define UDPHS_ENDPOINT_SENDINGM   5

Endpoint states: Endpoint is sending MBL

Definition at line 102 of file USBD_HAL.c.


Function Documentation

COMPILER_ALIGNED ( 16   ) 

DMA link list

Definition at line 234 of file USBD_HAL.c.

void USBD_HAL_Activate ( void   ) 

Activate USB Device HW Interface

  1. Enable USB Peripheral
  2. Enable USB Clock
  3. Enable transceiver

Definition at line 1658 of file hal_udp.c.

void USBD_HAL_CancelIo ( uint32_t  bmEPs  ) 

Cancel pending READ/WRITE

Parameters:
bmEPs Bitmap for endpoints to reset.
Note:
EP callback is invoked with USBD_STATUS_CANCELED.

Definition at line 1236 of file hal_udp.c.

uint8_t USBD_HAL_ConfigureEP ( const USBEndpointDescriptor *  pDescriptor  ) 

Configures an endpoint according to its endpoint Descriptor.

Parameters:
pDescriptor Pointer to an endpoint descriptor.
Returns:
The endpoint address.

Configures an endpoint according to its endpoint Descriptor.

Parameters:
pDescriptor Pointer to an endpoint descriptor.

Definition at line 1260 of file hal_udp.c.

Here is the call graph for this function:

void USBD_HAL_Connect ( void   ) 

Enable Pull-up, connect.

  1. Enable HW access if needed
  2. Enable Pull-Up
  3. Disable HW access if needed

Definition at line 1458 of file hal_udp.c.

void USBD_HAL_Disconnect ( void   ) 

Disable Pull-up, disconnect.

  1. Enable HW access if needed
  2. Disable PULL-Up
  3. Disable HW access if needed

Definition at line 1472 of file hal_udp.c.

uint8_t USBD_HAL_Halt ( uint8_t  bEndpoint,
uint8_t  ctl 
)

Sets/Clear/Get the HALT state on the endpoint. In HALT state, the endpoint should keep stalling any packet.

Parameters:
bEndpoint Endpoint number.
ctl Control code CLR/HALT/READ. 0: Clear HALT state; 1: Set HALT state; .: Return HALT status.
Returns:
USBD_STATUS_INVALID_PARAMETER if endpoint not exist, otherwise endpoint halt status.

Definition at line 1577 of file hal_udp.c.

void USBD_HAL_Init ( void   ) 

Initializes the USB HW Access driver.

Disable USB hardware

Enable USB hardware

Definition at line 1528 of file hal_udp.c.

Here is the call graph for this function:

uint8_t USBD_HAL_IsHighSpeed ( void   ) 

Indicates if the device is running in high or full-speed. Always returns 0 since UDP does not support high-speed mode.

Definition at line 1632 of file hal_udp.c.

uint8_t USBD_HAL_Read ( uint8_t  bEndpoint,
void *  pData,
uint32_t  dLength 
)

Reads incoming data on an USB endpoint This methods sets the transfer descriptor and activate the endpoint interrupt. The actual transfer is then carried out by the endpoint interrupt handler. The Read operation finishes either when the buffer is full, or a short packet (inferior to endpoint maximum size) is received.

*The buffer must be kept allocated until the transfer is finished*.

Parameters:
bEndpoint Endpoint number.
pData Pointer to a data buffer.
dLength Size of the data buffer in bytes.
Returns:
USBD_STATUS_SUCCESS if the read operation has been started; otherwise, the corresponding error code.

Definition at line 1441 of file hal_udp.c.

void USBD_HAL_RemoteWakeUp ( void   ) 

Starts a remote wake-up procedure.

Definition at line 1482 of file hal_udp.c.

void USBD_HAL_ResetEPs ( uint32_t  bmEPs,
uint8_t  bStatus,
uint8_t  bKeepCfg 
)

Reset endpoints and disable them.

  1. Terminate transfer if there is any, with given status;
  2. Reset the endpoint & disable it.

Parameters:
bmEPs Bitmap for endpoints to reset.
bStatus Status passed to terminate transfer on endpoint.
bKeepCfg 1 to keep old endpoint configuration.
Note:
Use USBD_HAL_ConfigureEP() to configure and enable endpoint if not keeping old configuration.
See also:
USBD_HAL_ConfigureEP().

Definition at line 1188 of file hal_udp.c.

void USBD_HAL_SetAddress ( uint8_t  address  ) 

Sets the device address to the given value.

Parameters:
address New device address.

Definition at line 1499 of file hal_udp.c.

void USBD_HAL_SetConfiguration ( uint8_t  cfgnum  ) 

Sets the current device configuration.

Parameters:
cfgnum - Configuration number to set.

Definition at line 1513 of file hal_udp.c.

uint8_t USBD_HAL_SetTransferCallback ( uint8_t  bEP,
TransferCallback  fCallback,
void *  pCbData 
)

Set callback for a USB endpoint for transfer (read/write).

Parameters:
bEP Endpoint number.
fCallback Optional callback function to invoke when the transfer is complete.
pCbData Optional pointer to data to the callback function.
Returns:
USBD_STATUS_SUCCESS or USBD_STATUS_LOCKED if endpoint is busy.

Definition at line 1333 of file hal_udp.c.

uint8_t USBD_HAL_SetupMblTransfer ( uint8_t  bEndpoint,
USBDTransferBuffer pMbList,
uint16_t  mblSize,
uint16_t  startOffset 
)

Configure an endpoint to use multi-buffer-list transfer mode. The buffers can be added by _Read/_Write function.

Parameters:
pMbList Pointer to a multi-buffer list used, NULL to disable MBL.
mblSize Multi-buffer list size (number of buffers can be queued)
startOffset When number of buffer achieve this offset transfer start

Definition at line 1357 of file hal_udp.c.

uint8_t USBD_HAL_Stall ( uint8_t  bEP  ) 

Causes the given endpoint to acknowledge the next packet it receives with a STALL handshake except setup request.

Parameters:
bEP Endpoint number.
Returns:
USBD_STATUS_SUCCESS or USBD_STATUS_LOCKED.

Definition at line 1551 of file hal_udp.c.

void USBD_HAL_Suspend ( void   ) 

Suspend USB Device HW Interface

  1. Disable transceiver
  2. Disable USB Clock
  3. Disable USB Peripheral

Definition at line 1644 of file hal_udp.c.

void USBD_HAL_Test ( uint8_t  bIndex  ) 

Certification test for High Speed device.

Parameters:
bIndex Test to be done

Definition at line 1669 of file hal_udp.c.

uint8_t USBD_HAL_Write ( uint8_t  bEndpoint,
const void *  pData,
uint32_t  dLength 
)

Sends data through a USB endpoint. Sets up the transfer descriptor, writes one or two data payloads (depending on the number of FIFO bank for the endpoint) and then starts the actual transfer. The operation is complete when all the data has been sent.

*If the size of the buffer is greater than the size of the endpoint (or twice the size if the endpoint has two FIFO banks), then the buffer must be kept allocated until the transfer is finished*. This means that it is not possible to declare it on the stack (i.e. as a local variable of a function which returns after starting a transfer).

Parameters:
bEndpoint Endpoint number.
pData Pointer to a buffer with the data to send.
dLength Size of the data buffer.
Returns:
USBD_STATUS_SUCCESS if the transfer has been started; otherwise, the corresponding error status code.

Definition at line 1417 of file hal_udp.c.

uint8_t USBD_HAL_WrWithHdr ( uint8_t  bEndpoint,
const void *  pHdr,
uint8_t  bHdrLen,
const void *  pData,
uint32_t  dLength 
)

Special write function. Sends data through a USB endpoint. Sets up the transfer descriptor, writes header and one or two data payloads (depending on the number of FIFO bank for the endpoint) and then starts the actual transfer. The operation is complete when all the data has been sent.

*If the size of the buffer is greater than the size of the endpoint (or twice the size if the endpoint has two FIFO banks), then the buffer must be kept allocated until the transfer is finished*. This means that it is not possible to declare it on the stack (i.e. as a local variable of a function which returns after starting a transfer).

Parameters:
bEndpoint Endpoint number.
pData Pointer to a buffer with the data to send.
dLength Size of the data buffer.
Returns:
USBD_STATUS_SUCCESS if the transfer has been started; otherwise, the corresponding error status code.

Definition at line 1625 of file hal_udphs.c.

void USBD_IrqHandler ( void   ) 

USBD (UDP) interrupt handler Manages device resume, suspend, end of bus reset. Forwards endpoint events to the appropriate handler.

/ Start Of Frame (SOF)

Definition at line 1120 of file hal_udphs.c.

Here is the call graph for this function:

void USBHS_Handler ( void   ) 

USBD (UDP) interrupt handler Manages device resume, suspend, end of bus reset. Forwards endpoint events to the appropriate handler.

Definition at line 1069 of file USBD_HAL.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines