USE GPIF to forwards GPIO to USB3 in both directions | Cypress Semiconductor
USE GPIF to forwards GPIO to USB3 in both directions
I am trying to use the CYUSB3KIT-0003 FX3 to forwards GPIO to USB3 through GPIF.
I created two DMA channels :
- One from USB3 channel 1 ( INPUT 0x01) to GPIF PIB BLOCK 0 .
- One from GPIF PIB BLOCK 4 to USB3 channel 1 (OUTPUT 0x81).
Next I have the configuration for my GPIF state machine where I wait for a DMA request on thread0 and write the data on the corresponding DATA_BUS (8bits). After writing I jump to another state where I compare (with the action CMP_DATA) the value of one bit on the databus that I come to write. Indeed, I want to read back my data bus value to the USB3 channel OUTPUT only when I receive from my USB3 channel INPUT a packet with the bit 5 at 1.
Can I compare the value of the databus using CMP_DATA with the value databus value I come to set ?
I don't know if the mistake come from my state model or my DMA configuration.
Below how are configured my DMA channels :
dmaCfg.prodSckId = CY_U3P_UIB_SOCKET_PROD_1;
dmaCfg.consSckId = (CyU3PDmaSocketId_t)CyU3PDmaGetSckId (CY_U3P_PIB_IP_BLOCK_ID, 0);
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleUSBIn,
dmaCfg.prodSckId = (CyU3PDmaSocketId_t)CyU3PDmaGetSckId (CY_U3P_PIB_IP_BLOCK_ID, 4);
dmaCfg.consSckId = CY_U3P_UIB_SOCKET_CONS_1;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleUSBOut,
The state machine attached.
I hope I was clear enough.
Thank you by advance.