- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, our FPGA will send two different format data:
- Img Data: It needs to send out to PC.
- Info Data: FX3 parses this data and don’t need to send out.
There is one pin “Switch_pin” which provided by FPGA to decide the data format is Img Data or info data.
Therefore, in the GPIF, I want to use “Switch_pin” to judge how to handle this data in FX3. Pseudo code:
If the data is Img Data, FX3 uses CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE to receive it, and then send out to PC by USB bulk endpoint directly.
If the data is Info Data, FX3 uses CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE to receive it, and parse it inside the FX3 CPU.
It means that GPIF can decide that it want to use Auto DMA or Manual DMA to receive one piece of data, and the data will be handled differently in FX3.
Is it possible to achieve?
Any help will be highly appreciated!
Solved! Go to Solution.
- Labels:
-
USB Superspeed Peripherals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?
If yes, only one DMA channel can be created at a time with particular producer and consumer sockets.
In the firmware, based on the status of the GPIO (switch_pin) an interrupt (like CY_U3P_GPIO_INTR_LOW_LEVEL/ CY_U3P_GPIO_INTR_HIGH_LEVEL) can be registered and based on the interrupt trigger the DMA channel can be created (this is the case when no DMA channel was created earlier). Please note that if the gpio interrupt is triggered when a DMA channel (for example: CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) is already created, the existing DMA channel (CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) should be destroyed before creating new (CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE)
Please let me know if any queries on this
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?
If yes, only one DMA channel can be created at a time with particular producer and consumer sockets.
In the firmware, based on the status of the GPIO (switch_pin) an interrupt (like CY_U3P_GPIO_INTR_LOW_LEVEL/ CY_U3P_GPIO_INTR_HIGH_LEVEL) can be registered and based on the interrupt trigger the DMA channel can be created (this is the case when no DMA channel was created earlier). Please note that if the gpio interrupt is triggered when a DMA channel (for example: CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) is already created, the existing DMA channel (CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) should be destroyed before creating new (CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE)
Please let me know if any queries on this
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Rashi:
Thanks for your quickly reply!
From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?
Yes!
According to your description, the switch_pin is detected by FW(not GPIF), so the flow is like:
switch_pin is triggered --> FW create correspond DMA channel --> GPIF receive data
Therefore, GPIF need to be announced(by FW_TRG action) after the correspond DMA channel has been created as the pseudo code:
Besides, GPIF don't need to judge that the incoming data is Img_Data or Info_Data.
Is my understanding correct?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Yes, your understanding is correct.
The pseudo state machine seems fine.
Rashi