www.beck-ipc.com

@CHIP-RTOS C Library - USB API


usbDeviceEnableEp

This function enables or disables communication in the OUT direction (Host to Device) of an endpoint. When the Host tries to send data on a disabled endpoint a NAK handshake will be returned (except for ISOCHRONOUS endpoints).

By default all configured endpoints are enabled after the Device has been started.

Note that this function will not stop reception immediately. At least two more packets can be received, because respective requests have already been handed to the controller hardware. Some more data may already have been received, but still be pending in a software queue inside the RTOS.

UsbError usbDeviceEnableEp( unsigned char epNumber

UsbBool enable );

Parameters

epNumber

Number of endpoint that is to be enabled/disabled

enable

Indicates whether the endpoint is to be enabled (TRUE) or disabled (FALSE)

Return Value

Error code

Comments

If the device is permanent unable to receive data, the endopint should be stalled.

To achieve sending of a NAK handshake in the IN direction (Device to Host) of an endpoint, simply stop sending on this endpoint. If the Host then tries to receive data on that endpoint, a NAK handshake is returned automatically.

RTOS API

This library function uses a dynamic link to reach the function USB_SERVICE_DEVICE_ENABLE_EP offered by RTOS USB Software Interrupt.

Related Topics

C-library function usbDeviceStallEp

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.20V1.20

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.13

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document