You are here

Interrupt IN Endpoint Configuration | Cypress Semiconductor

Interrupt IN Endpoint Configuration

Summary: 3 Replies, Latest post by nate89 on 02 Mar 2015 11:35 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
nate89's picture
13 posts

 Hi all,

I'm trying to setup an interrupt in endpoint on the FX3 and can't find any examples.  The senario is there are multiple threads running on the cpu, one of them will occasionaly need to post "data avialble" alerts to the host over the interrupt pipe.  Only the CPU and the host are involved in the process (i.e. the other serial ports are not involved).   I've tried to do my homework before posting such a broad question.  I need a few specific questions answered:

  1. What type of socket do you use for an interrupt in endpoint?
    I assume you use a consumer.
  2. How do you configure the dma channel (specifics below)?
    1. How do you configure the producer/consumer sockets?
        I assume you set the producer to the cpu socket and the consumer to the interrupt if my first assumption is true.
    2. Notification?
      I assume CY_U3P_DMA_CB_PROD_EVENT
    3. DMA Type?
      I assume CY_U3P_DMA_TYPE_MANUAL_OUT, but maybe CY_U3P_DMA_TYPE_AUTO will work since I'm not doing any work in the callback (see question 3).
  3. How and where do you access the dma data buffer?
       I think you use the CyU3PDmaChannelCommitBuffer() command.
       I suppose with the notification set as CY_U3P_DMA_CB_PROD_EVENT the callback will be triggered whenever I call CyU3PDmaChannelCommitBuffer() from wihtin the CPU thread.  
    Or if set the DMA type to 
    CY_U3P_DMA_TYPE_AUTO, does that mean my alert will be sent everytime I call CyU3PDmaChannelCommitBuffer()?

I haven't finished this setup yet, so please let me know if I'm headed in the correct direction.  If there's anything I can do to clarify please let me know. That includes adjusting the formatting above.  Thanks.


mady's picture
Cypress Employee
964 posts


Here you are going to send the data from CPU to USB socket (endpoint). So the prod socket must be CPU and cons socket must be a UIB_CONS_SOCKET. When CPU is producer, the channel type must always be MANUL_OUT.

The notification is optional. There is no need to set the notification to PROD_EVENT. This is because, it is you (CPU) who are filling the buffer in case of MANUAL_OUT channel. So you do not have to get a notification after you fill the buffer.

You have to use the CyU3PDmaChannelGetBuffer for getting the pointer to a buffer, fill it and use CyU3PDmaChannelCommitBuffer API to send the buffer to PC.

I have attached a project in which uses interrupt endpoint. This firmware enumertaes FX3 into a HID Mouse device. As soon as you load the firmware into FX3, FX3 becomes a mouse and it continuously sends character "a" to the PC.


- Madhu Sudhan

nate89's picture
13 posts

 Hey Madhu that helps a lot.  I'll post again when it is all working.

nate89's picture
13 posts

 It's all working now thanks!

Log in to post new comments.