Interrupt IN Endpoint Configuration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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.     
  3. 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.       
    3. Notification?
      I assume CY_U3P_DMA_CB_PROD_EVENT
    4.       
    5. 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).
    6.      
  4.     
  5. How and where do you access the dma data buffer?
    How:
       I think you use the CyU3PDmaChannelCommitBuffer() command.
    Where:
       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()?
  6.    
   

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.

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Hi,

   

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.

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

 It's all working now thanks!

0 Likes