2.2.4.20 USB_DEVICE_EndpointIsStalled Function

C

bool USB_DEVICE_EndpointIsStalled(
    USB_DEVICE_HANDLE usbDeviceHandle, 
    USB_ENDPOINT_ADDRESS endpoint
);

Summary

This function returns the stall status of the specified endpoint and direction.

Precondition

The USB Device should be in a configured state.

Parameters

Parameters Description
usbDeviceHandle USB device handle returned by USB_DEVICE_Open
endpoint Specifies the endpoint and direction

Returns

Returns true if endpoint is stalled, false otherwise.

Example

// This code example shows of how the
// USB_DEVICE_EndpointIsStalled function can be used to obtain the
// stall status of the endpoint 1 and IN direction.

USB_ENDPOINT_ADDRESS ep;

ep = 0x1|USB_EP_DIRECTION_IN;

if(true == USB_DEVICE_EndpointIsStalled (handle, ep))
{
    // Endpoint stall is enabled. Clear the stall.

    USB_DEVICE_EndpointStallClear(handle, ep);

}

Remarks

None.