- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I need to be able to get control messages from the EP0.
I'm using a PSoC 5LP, and I can successfully read and Write USB messages on EP1 and EP2.
For compatibility reason I need to use the Endpoint 0 to configure the PSOC.
I have tried the following code, but is not working:
#define EP0 0
uint8_t NewUSBMessage()
{
uint8_t retVal;
retVal =0;
if (USB_bGetEPState(EP0)!= USB_OUT_BUFFER_EMPTY)
{
USB_ReadOutEP(EP0,Message,length);
retVal = 1;
}
return retVal;
}
Can somebody help me please? send me some example link, etc.
Thanks,
Francesco
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Tags:
- usb
- usb endpoint ep0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Francesco,
I'm not a USB configuration expert but here goes:
I'm assuming NewUSBMessage() is an ISR you want called when EP0 is activated.
You may need to make the following changes if you already haven't:
Rename the function NewUSBMessage() to <comp_name>_EP_0_ISR_ExitCallback()
Add the following lines into file cyapicallbacks.h:
#define <comp_name>_EP_0_ISR_EXIT_CALLBACK
void <comp_name>_EP_0_ISR_ExitCallback();
Note: <comp_name> needs to be substituted with the name of your USBFS component.
I've used USBFS and EP0 and these are the changes I had to add to get EP0 to be processes with my own code.
Len
"Engineering is an Art. The Art of Compromise."