Checking EP State

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

cross mob
JaLe_2074191
Level 3
Level 3
First like received

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 Solution
JaLe_2074191
Level 3
Level 3
First like received

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

View solution in original post

0 Likes
1 Reply
JaLe_2074191
Level 3
Level 3
First like received

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

0 Likes