1 Reply Latest reply on Apr 25, 2019 7:43 AM by jalec_2074191

    Checking EP State

    jalec_2074191

      In the USB block and the method USBBULK_ReadOutEP, there is a comment about DMA with manual buffer management.

      How do I check if the DMA is finished and/or where do I find the \snippet /USBFS_sut_02.cydsn/main.c checking EPstate code?

      /*******************************************************************************

      * Function Name: USBBULK_ReadOutEP

      ****************************************************************************//**

      .......

      *   *DMA with Manual Buffer Management:*

      *   Configure DMA to transfer data from endpoint buffer to system RAM. Generate

      *   a DMA request. The firmware must wait until the DMA completes the data

      *   transfer after calling the USB4BULK_ReadOutEP() API. For example,

      *   by checking EPstate:

      *

      *   \snippet /USBFS_sut_02.cydsn/main.c checking EPstate

      *

        • 1. Re: Checking EP State
          jalec_2074191

          Guess this is the correct solution....

          while (USB_GetEPState(OUT_EP) != USB_OUT_BUFFER_FULL);

          /*******************************************************************************

          * Function Name: USB_GetEPState

          ****************************************************************************//

          ...

          *  Return Value           | Description

          *  -----------------------|-----------------------------------------------------

          ....

          *  USBFS_OUT_BUFFER_FULL  |An OUT transaction has occurred and data can be read