150 if (bEndpoint != 0) {
226 uint8_t USBD_MblWrite(uint8_t bEndpoint,
246 if (pEndpoint->
state != UDP_ENDPOINT_IDLE)
250 pEndpoint->
state = UDP_ENDPOINT_SENDINGM;
256 if (!bCircList) wStartNdx = 0;
264 pTransfer->currBuffer = wStartNdx;
265 pTransfer->freedBuffer = 0;
267 pTransfer->circList = bCircList;
268 pTransfer->allUsed = 0;
272 for (i = 0; i < wListSize; i ++) {
281 while ((UDP->UDP_CSR[bEndpoint]&UDP_CSR_TXPKTRDY) == UDP_CSR_TXPKTRDY);
283 UDP_MblWriteFifo(bEndpoint);
284 SET_CSR(bEndpoint, UDP_CSR_TXPKTRDY);
293 UDP_MblWriteFifo(bEndpoint);
297 UDP->UDP_IER = 1 << bEndpoint;
336 uint8_t USBD_MblReuse(uint8_t bEndpoint,
345 bEndpoint, pEndpoint->
state, pTransfer->circList);
350 && (pEndpoint->
state == UDP_ENDPOINT_RECEIVINGM
351 || pEndpoint->
state == UDP_ENDPOINT_SENDINGM)
352 && pTransfer->circList) {
359 if (pTransfer->freedBuffer == pTransfer->currBuffer
360 && !pTransfer->allUsed)
366 if ((++ pTransfer->freedBuffer) == pTransfer->
listSize)
367 pTransfer->freedBuffer = 0;
371 pBi->
size = wNewSize;
380 pTransfer->allUsed = 0;
479 TRACE_INFO(
"USBD_RemoteWakeUp: Device is not suspended\n\r");
static uint8_t deviceState
#define USBD_STATUS_INVALID_PARAMETER
#define USBD_STATE_POWERED
Buffer struct used for multi-buffer-listed transfer.
uint8_t USBD_HAL_Read(uint8_t bEndpoint, void *pData, uint32_t dLength)
uint8_t USBD_HAL_Write(uint8_t bEndpoint, const void *pData, uint32_t dLength)
union Endpoint::@32 transfer
#define USBD_STATE_SUSPENDED
#define USBD_STATUS_RESET
void USBD_HAL_Disconnect(void)
Disable Pull-up, disconnect.
uint8_t USBD_HAL_IsHighSpeed(void)
void USBD_ForceFullSpeed(void)
void USBD_RemoteWakeUp(void)
WEAK void USBDCallbacks_RequestReceived(const USBGenericRequest *request)
void USBD_HAL_Test(uint8_t bIndex)
uint8_t USBD_GetState(void)
void USBD_Unhalt(uint8_t bEndpoint)
uint8_t USBD_IsHalted(uint8_t bEndpoint)
void USBD_SetAddress(uint8_t address)
USBDTransferBuffer * pMbl
uint8_t USBD_HAL_ConfigureEP(const USBEndpointDescriptor *pDescriptor)
void USBD_HAL_Connect(void)
Enable Pull-up, connect.
WEAK void USBDCallbacks_Resumed(void)
uint8_t USBD_Stall(uint8_t bEndpoint)
void USBD_SetConfiguration(uint8_t cfgnum)
#define USBD_STATE_DEFAULT
static Endpoint endpoints[CHIP_USB_NUMENDPOINTS]
uint8_t USBD_HAL_SetTransferCallback(uint8_t bEP, TransferCallback fCallback, void *pCbData)
void USBD_HAL_RemoteWakeUp(void)
uint8_t USBD_Read(uint8_t bEndpoint, void *pData, uint32_t dLength, TransferCallback fCallback, void *pArgument)
void USBD_RequestHandler(uint8_t bEndpoint, const USBGenericRequest *pRequest)
#define USBD_STATUS_LOCKED
void USBD_ConfigureEndpoint(const USBEndpointDescriptor *pDescriptor)
WEAK void USBDCallbacks_Suspended(void)
void USBD_ResumeHandler(void)
uint8_t USBD_Write(uint8_t bEndpoint, const void *pData, uint32_t dLength, TransferCallback fCallback, void *pArgument)
void USBD_HAL_ResetEPs(uint32_t bmEPs, uint8_t bStatus, uint8_t bKeepCfg)
Reset endpoints and disable them.Terminate transfer if there is any, with given status;Reset the endp...
uint8_t USBD_IsHighSpeed(void)
WEAK void USBDCallbacks_Reset(void)
void USBD_Disconnect(void)
void USBD_SuspendHandler(void)
void USBD_HAL_Suspend(void)
void(* TransferCallback)(void *pArg, uint8_t status, uint32_t transferred, uint32_t remaining)
#define USBD_STATE_CONFIGURED
void USBD_Halt(uint8_t bEndpoint)
uint8_t USBD_HAL_Halt(uint8_t bEndpoint, uint8_t ctl)
void USBD_Test(uint8_t bIndex)
#define USBD_STATE_ADDRESS
void USBD_HAL_SetAddress(uint8_t address)
#define TRACE_WARNING(...)
uint8_t USBD_HAL_Stall(uint8_t bEP)
#define USBD_STATUS_WRONG_STATE
void USBD_HAL_Activate(void)
void(* MblTransferCallback)(void *pArg, uint8_t status)
#define CHIP_USB_ENDPOINTS_BANKS(ep)
static uint8_t previousDeviceState
#define USBD_STATUS_SUCCESS
MblTransferCallback fCallback
#define TRACE_DEBUG_WP(...)
#define TRACE_INFO_WP(...)
WEAK void USBDCallbacks_Initialized(void)
void USBD_HAL_SetConfiguration(uint8_t cfgnum)