viewing integer values from vendor command | Cypress Semiconductor
viewing integer values from vendor command
I am working on Cy7C68013-A usb HS controller. I need to issue a vendor command, where I am expecting an integer count value (int final_count). The value of "final_count" can comfortably go beyond 255. But since EP0BUF supports only a maximum value of 255 (8 bits), I am finding trouble to get any value beyond 255.
Where can I assign my "final_count" variable, so that I can correctly read the integer value even if it crosses the 255 limit.
I have my vendor command function as follows:
EP0BUF = final_count;
EP0BCH = 0;
EP0BCL = 1;
EP0CS |= bmHSNAK;
In the above case, the EP0BUF has a limit of 255, which will assign incorrect value from my "final_count". The "final_count" value can go near to 2000.
Please give me a solution, where I can read the value of "final_count" on issuing a vendor command ?