25 #ifndef __USBLIBPRIV_H__ 26 #define __USBLIBPRIV_H__ 61 #define MAX_USB_TICK_HANDLERS 6 71 #define USB_SOF_TICK_DIVIDE 5 122 #define InternalUSBGetTime() g_ui32CurrentUSBTick 131 #define USBBaseToIndex(BaseAddr)(0) 132 #define USBIndexToBase(Index) (USB0_BASE) 137 #define USB_MAX_DMA_CHANNELS_0 6 142 #define USB_MAX_DMA_CHANNELS 8 149 #define USBLIBSTATUS_DMA_IDLE 0x00000000 150 #define USBLIBSTATUS_DMA_COMPLETE \ 152 #define USBLIBSTATUS_DMA_ERROR 0x00000002 153 #define USBLIBSTATUS_DMA_PENDING \ 161 #define USB_DMA_EP_RX 0x00000080 162 #define USB_DMA_EP_TX 0x00000000 163 #define USB_DMA_EP_HOST 0x00000040 164 #define USB_DMA_EP_DEVICE 0x00000000 165 #define USB_DMA_EP_TYPE_CTRL 0x00000000 166 #define USB_DMA_EP_TYPE_ISOC 0x00000001 167 #define USB_DMA_EP_TYPE_BULK 0x00000002 168 #define USB_DMA_EP_TYPE_INT 0x00000003 169 #define USB_DMA_EP_TYPE_M 0x00000003 202 uint32_t ui32ArbSize);
205 uint32_t ui32MaxPacketSize,
206 uint32_t ui32Config);
208 uint32_t ui32Channel);
210 uint32_t ui32Channel);
212 uint8_t ui8Endpoint);
214 uint32_t ui32Channel);
216 uint32_t ui32Channel);
218 uint32_t ui32Channel);
220 uint32_t ui32Status);
223 uint32_t ui32Status);
226 uint32_t ui32Channel,
void *pvBuffer,
229 uint32_t ui32Channel,
230 uint32_t ui32BitSize);
240 uint32_t ui32Channel);
242 uint32_t ui32Channel);
258 #define USBLibDMAChannelStatus(psUSBDMAInst, ui32Channel) \ 259 psUSBDMAInst->pfnChannelStatus(psUSBDMAInst, ui32Channel) 274 #define USBLibDMAStatus(psUSBDMAInst) psUSBDMAInst->pfnStatus(psUSBDMAInst) 292 #define USBLibDMAIntStatus(psUSBDMAInst) \ 293 psUSBDMAInst->pfnIntStatus(psUSBDMAInst) 312 #define USBLibDMAIntStatusClear(psUSBDMAInst, ui32Status) \ 313 psUSBDMAInst->pfnIntStatusClear(psUSBDMAInst, ui32Status) 328 #define USBLibDMAChannelEnable(psUSBDMAInst, ui32Channel) \ 329 psUSBDMAInst->pfnChannelEnable(psUSBDMAInst, ui32Channel) 344 #define USBLibDMAChannelDisable(psUSBDMAInst, ui32Channel) \ 345 psUSBDMAInst->pfnChannelDisable(psUSBDMAInst, ui32Channel) 367 #define USBLibDMATransfer(psUSBDMAInst, ui32Channel, pvBuffer, ui32Size) \ 368 psUSBDMAInst->pfnTransfer(psUSBDMAInst, ui32Channel, \ 388 #define USBLibDMAIntHandler(psUSBDMAInst, ui32Status) \ 389 psUSBDMAInst->pfnIntHandler(psUSBDMAInst, ui32Status) 414 #define USBLibDMAChannelAllocate(psUSBDMAInst, ui8Endpoint, ui32MaxPacketSize,\ 416 psUSBDMAInst->pfnChannelAllocate(psUSBDMAInst, \ 435 #define USBLibDMAChannelRelease(psUSBDMAInst, ui8Endpoint) \ 436 psUSBDMAInst->pfnChannelRelease(psUSBDMAInst, ui8Endpoint) 455 #define USBLibDMAUnitSizeSet(psUSBDMAInst, ui32Channel, ui32BitSize) \ 456 psUSBDMAInst->pfnUnitSizeSet(psUSBDMAInst, ui32Channel, \ 475 #define USBLibDMAArbSizeSet(psUSBDMAInst, ui32Channel, ui32ArbSize) \ 476 psUSBDMAInst->pfnArbSizeSet(psUSBDMAInst, ui32Channel, \ 492 #define USBLibDMAChannelIntEnable(psUSBDMAInst, ui32Channel) \ 493 psUSBDMAInst->pfnChannelIntEnable(psUSBDMAInst, ui32Channel) 508 #define USBLibDMAChannelIntDisable(psUSBDMAInst, ui32Channel) \ 509 psUSBDMAInst->pfnChannelIntDisable(psUSBDMAInst, ui32Channel) 527 #endif // __USBLIBPRIV_H__ void InternalUSBStartOfFrameTick(uint32_t ui32TicksmS)
Definition: usbtick.c:191
#define USB_MAX_DMA_CHANNELS
Definition: usblibpriv.h:142
void(* pfnIntStatusClear)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Status)
Definition: usblibpriv.h:222
uint32_t(* pfnStatus)(tUSBDMAInstance *psUSBDMAInst)
Definition: usblibpriv.h:224
void USBHostIntHandlerInternal(uint32_t ui32Index, uint32_t ui32Status)
Definition: usbhostenum.c:3790
uint32_t g_ui32CurrentUSBTick
Definition: usbtick.c:60
uint32_t pui32Count[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:189
int32_t InternalUSBRegisterTickHandler(tUSBTickHandler pfnHandler, void *pvInstance)
Definition: usbtick.c:142
uint32_t(* pfnTransfer)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel, void *pvBuffer, uint32_t ui32Size)
Definition: usblibpriv.h:225
uint32_t(* pfnIntStatus)(tUSBDMAInstance *psUSBDMAInst)
Definition: usblibpriv.h:221
void(* pfnChannelRelease)(tUSBDMAInstance *psUSBDMAInst, uint8_t ui8Endpoint)
Definition: usblibpriv.h:211
void InternalUSBHCDSendEvent(uint32_t ui32Index, tEventInfo *psEvent, uint32_t ui32EvFlag)
Definition: usbhostenum.c:4557
uint32_t * ppui32Data[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:187
void(* pfnChannelIntDisable)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usblibpriv.h:215
uint32_t ui32Base
Definition: usblibpriv.h:179
void(* pfnUnitSizeSet)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel, uint32_t ui32BitSize)
Definition: usblibpriv.h:228
uint32_t ui32IntNum
Definition: usblibpriv.h:181
void(* pfnIntHandler)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Status)
Definition: usblibpriv.h:219
uint32_t g_ui32USBSOFCount
Definition: usbtick.c:69
uint32_t ui32Complete
Definition: usblibpriv.h:199
uint32_t pui32EPDMAMode0[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:193
void USBDeviceIntHandlerInternal(uint32_t ui32Index, uint32_t ui32Status)
Definition: usbdenum.c:3005
void(* tUSBTickHandler)(void *pvInstance, uint32_t ui32TicksmS)
Definition: usblibpriv.h:78
void(* pfnChannelDisable)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usblibpriv.h:209
uint32_t ui32Pending
Definition: usblibpriv.h:197
void * USBLibDMAAddrGet(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usbdma.c:655
uint32_t pui32MaxPacketSize[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:185
void InternalUSBTickInit(void)
Definition: usbtick.c:84
void(* pfnChannelEnable)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usblibpriv.h:207
Definition: usblibpriv.h:177
uint32_t(* pfnChannelStatus)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usblibpriv.h:213
void(* pfnArbSizeSet)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel, uint32_t ui32ArbSize)
Definition: usblibpriv.h:201
void(* pfnChannelIntEnable)(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usblibpriv.h:217
tUSBDMAInstance * USBLibDMAInit(uint32_t ui32Index)
Definition: usbdma.c:698
uint8_t pui8Endpoint[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:191
void InternalUSBTickReset(void)
Definition: usbtick.c:112
uint32_t pui32EPDMAMode1[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:195
Definition: usblib.h:1340
uint32_t(* pfnChannelAllocate)(tUSBDMAInstance *psUSBDMAInst, uint8_t ui8Endpoint, uint32_t ui32MaxPacketSize, uint32_t ui32Config)
Definition: usblibpriv.h:203
uint32_t pui32Config[USB_MAX_DMA_CHANNELS]
Definition: usblibpriv.h:183
uint32_t USBLibDMASizeGet(tUSBDMAInstance *psUSBDMAInst, uint32_t ui32Channel)
Definition: usbdma.c:676