40 extern uint8_t USBXCORE_overflowBuffer[];
73 USBD_State_TypeDef newState)
78 if (newState == USBD_STATE_SUSPENDED)
83 if (newState == USBD_STATE_CONFIGURED)
87 if (newState < USBD_STATE_CONFIGURED)
108 USB_Status_TypeDef retval = USB_STATUS_REQ_UNHANDLED;
112 if (setup->Type == USB_SETUP_TYPE_VENDOR)
115 switch (setup->bRequest)
119 switch (setup->wValue)
135 USBD_AbortTransfer(USBXPRESS_IN_EP_ADDR);
146 retval = USB_STATUS_OK;
152 retval = USB_STATUS_OK;
158 retval = USB_STATUS_OK;
163 USBD_Write(USBXPRESS_SETUP_EP_ADDR, &usbxpressVersion, 2, NULL);
164 retval = USB_STATUS_OK;
174 USBD_Write(USBXPRESS_SETUP_EP_ADDR, &usbxpressPartNumber, 1, NULL);
175 retval = USB_STATUS_OK;
182 if (retval == USB_STATUS_OK)
194 if (setup->bmRequestType == (USB_SETUP_DIR_D2H
195 | USB_SETUP_TYPE_STANDARD
196 | USB_SETUP_RECIPIENT_DEVICE))
198 if ((setup->bRequest == GET_DESCRIPTOR)
199 && ((setup->wValue >> 8) == USB_STRING_DESCRIPTOR))
201 if ((setup->wValue & 0xFF) == 0xEE)
203 USBD_Write(USBXPRESS_SETUP_EP_ADDR,
204 (uint8_t *) &USBXCORE_microsoftOsDesc,
205 USBXCORE_microsoftOsDesc[0],
208 retval = USB_STATUS_OK;
214 else if ((setup->bmRequestType == (USB_SETUP_DIR_D2H
215 | USB_SETUP_TYPE_VENDOR_MASK
216 | USB_SETUP_RECIPIENT_DEVICE))
223 if (length > setup->wLength)
225 length = setup->wLength;
228 USBD_Write(USBXPRESS_SETUP_EP_ADDR,
229 (uint8_t *) &USBXCORE_extendedCompatIdOsFeatureDesc,
232 retval = USB_STATUS_OK;
236 else if ((setup->bmRequestType == (USB_SETUP_DIR_D2H
237 | USB_SETUP_TYPE_VENDOR_MASK
238 | USB_SETUP_RECIPIENT_INTERFACE))
241 || (setup->wIndex == 0)))
246 if (length > setup->wLength)
248 length = setup->wLength;
251 USBD_Write(USBXPRESS_SETUP_EP_ADDR,
252 (uint8_t *) &USBXCORE_extendedPropertiesDesc,
255 retval = USB_STATUS_OK;
274 if (status == USB_STATUS_OK)
283 if ((xferred) && (xferred % USB_FS_BULK_EP_MAXSIZE == 0))
285 USBD_Write(USBXPRESS_IN_EP_ADDR,
320 if (status == USB_STATUS_OK)
340 else if (USBXCORE_zlpActive)
345 USBXCORE_zlpActive =
false;
351 USBXCORE_rxOverflowPacketAvailable =
true;
352 USBXCORE_rxOverflowPacketSize = xferred;
357 USBXCORE_zlpActive =
true;
358 USBD_Read(USBXPRESS_OUT_EP_ADDR,
359 USBXCORE_overflowBuffer,
uint32_t USBXCORE_apiEa
Enable or disable status of USB_API interrupts.
void USBX_jumpCallback(void)
Conditionally jumps to the user call-back routine.
bool USBXCORE_zlpActive
Boolean indicating whether a ZLP read is active.
bool USBXCORE_rxOverflowPacketAvailable
Boolean indicating if data was received while expecting a ZLP.
#define SL_ALIGN(X)
Macro for aligning a variable. Use this macro before the variable definition. X denotes the stora...
#define SI_USBXPRESS_REQUEST
Request.
void USBXCORE_resetState(void)
Resets internal USBXpress variables.
#define SI_USBXPRESS_CLEAR_TO_SEND
Value.
#define USBX_RX_OVERRUN
Data received with no place to put it.
uint32_t USBXCORE_apiIntValue
Byte holding the current USB_API interrupts.
#define SI_USBXPRESS_NOT_CLEAR_TO_SEND
Value.
#define USBX_RX_COMPLETE
Receive Complete Interrupt has occurred.
#define FEATURE_EXTENDED_COMPATIBILITY_ID
Extended Compatibility ID Descriptor.
#define USBX_TX_COMPLETE
Transmit Complete Interrupt has occurred.
#define SI_CP210X_GET_PART_NUMBER
Value.
uint32_t USBXCORE_rxOverflowPacketSize
Size of Rx Overflow Packet.
#define SI_CP210X_REQUEST
Request.
int USBX_SetupCmdCb(const USB_Setup_TypeDef *setup)
USB setup command call-back.
uint32_t * USBXCORE_byteCountOutPtr
Pointer to variable holding number of bytes read.
Primary header file. Contains internal global declarations and definitions.
#define SL_ATTRIBUTE_ALIGN(X)
GCC style macro for aligning a variable.
uint32_t USBXCORE_readSize
Number of bytes sent to USBX_blockRead() as numBytes.
#define USBX_DEV_SUSPEND
USB suspend signaling present on bus.
#define EXT_COMP_VENDOR_CODE
Vendor-defined Extended Compatibility Code.
uint32_t * USBXCORE_byteCountInPtr
Pointer to variable holding number of bytes written.
#define FEATURE_EXTENDED_PROPERTIES_ID
Extended Properties ID Descriptor.
void USBX_ResetCb(void)
USB Reset call-back.
Header file for the USBXpress firmware library. Includes function prototypes, type definitions...
#define USBX_DEV_CONFIGURED
Device has entered configured state.
#define USBX_DEV_OPEN
Device Instance Opened on host side.
#define USBX_FIFO_PURGE
Receive and Transmit FIFO's were purged.
#define SI_USBXPRESS_FLUSH_BUFFERS
Value.
int USBX_inXferCompleteCb(USB_Status_TypeDef, uint16_t, uint16_t remaining)
USBXpress IN Endpoint Transfer Complete Callback.
uint32_t USBXCORE_writeSize
Number of bytes sent to USBX_blockWrite() as numBytes.
void USBX_DeviceStateChangeCb(USBD_State_TypeDef oldState, USBD_State_TypeDef newState)
USB device state change call-back.
#define USBX_DEV_CLOSE
Device Instance Closed on host side.
#define SI_USBXPRESS_GET_VERSION
Value.
Header file for USB and VCP Initial Descriptors.
#define SI_USBXPRESS_PART_NUMBER_EFM32
EFM32 USBXpress Part Number.
#define EXT_COMP_DESC_SIZE
Size of Extended Compatibility Descriptor.
#define USBX_RESET
USB Reset Interrupt has occurred.
int USBX_outXferCompleteCb(USB_Status_TypeDef, uint16_t, uint16_t remaining)
USBXpress OUT Endpoint Transfer Complete Callback.
#define USBXPRESS_LIBRARY_VERSION
#define PROPERTIES_DESCRIPTOR_SIZE
Total Size of Extended Properties Descriptor.