cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

FrPo_1282226
New Contributor II

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

0 Likes
1 Solution
Len_CONSULTRON
Honored Contributor II

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

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

3 Replies