I have a question regarding Control Endpoint usage, because USB 3.0(CYUSB3014-BZX) enable only 1/4 speed of data transmission compared USB 2.0(CY7C68013A).
In other words, USB 3.0 is slower 4times than USB2.0
Now I programmed through SDK V1.1 and following is Callback Function source coding regarding Control Endpoint.
Indeed source is only the returns against variables of error handling
At the PC application layer, I used only Read Function of CCyControlEndPoint.
CyControlEndPoint->Read((PUCHAR )pParam, len);
And firmware, I used coding as following.
/* Callback to handle the USB setup requests. */
/* Fast enumeration is used. Only class, vendor and unknown requests
* are received by this function. These are not handled in this
* application. Hence return CyFalse. */
// return CyFalse;
uint8_t attr, rqt, i2cAddr = 0;
uint16_t value, index, length;
CyBool_t isHandled = CyTrue;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
uint8_t bytRet, i, read_byte;
/* Parse the control request parameters. */
attr = (uint8_t) (setupdat0 & 0x000000FF);
rqt = (uint8_t)((setupdat0 & 0x0000FF00) >> 8);
value = (uint16_t) (setupdat0 >> 16);
index = (uint16_t) (setupdat1 & 0x0000FFFF);
length = (uint16_t) (setupdat1 >> 16);
param = (uint8_t) (value & 0x00FF);
param = (uint8_t) ((value & 0xFF00) >> 8);
param = (uint8_t) (index & 0x00FF);
param = (uint8_t) ((index & 0xFF00) >> 8);
/* Fast enumeration is used. Only vendor is handled here. */
if ((attr & CY_U3P_USB_TYPE_MASK) != CY_U3P_USB_VENDOR_RQT)
length = 1;
glEp0Buffer = GET_ERRORCODE();
status = CyU3PUsbSendEP0Data(length, glEp0Buffer);
Read function of internal memory value get.
the same behavior with a thousand times, and used the average value is Test time
Performance measurement to use the "QueryPerformanceCounter function" of API