3 Replies Latest reply on Mar 2, 2015 11:35 AM by nathan.price

    Interrupt IN Endpoint Configuration

    nathan.price

       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.