|
// Start USB for 5V operation and wait till enumeration is completeUSBFS_Start(0, USB_5V_OPERATION);while(!USBFS_bGetConfiguration());// Load the IN endpoint with data with no toggleUSBFS_LoadInEP(1, Data, 8, USB_NO_TOGGLE);while(1)Above code shows the general program flow when using an USBFS user module to send data to the PC using an IN Endpoint. If you notice, the USBFS_LoadInEP function call before the while loop uses “USB_NO_TOGGLE” and the call inside the while loop uses “USB_TOGGLE”. What is this TOGGLE and NO_TOGGLE? What is the significance of these constants? I can understand from the above code that the first time I call the USBFS_LoadInEP function, I have to use NO_TOGGLE option and TOGGLE for further transactions. Why is it so? These are some of the questions a first time user of USB faces.
The project measures 0-5V signals present on P0[3], P0[5], P3[1] and P3[6] of CY8C24794 device and displays the 14 bit signed ADC value on an LCD. The project uses the MUX_CRx registers to connect and disconnect the signals to the Analog Mux bus which is connected to a unity gain PGA and a 14 bit incremental ADC. The project can be tested on the CY3214 Evaluation board from Cypress Semiconductors.
|