Jump to main content

##

# 2.2.4.3 USB_DEVICE_Status Function

## C

    SYS_STATUS USB_DEVICE_Status(
        SYS_MODULE_OBJ object
    );

## Summary

This function provides the current status of the USB device layer.

## Precondition

The USB_DEVICE_Initialize function must have been called before calling this function.

## Parameters

Parameters | Description
object | Driver object handle, returned from USB_DEVICE_Initialize

## Returns

SYS_STATUS_READY - Indicates that the device is busy with a previous system level operation and cannot start another.

SYS_STATUS_UNINITIALIZED - Indicates that the device layer is in a deinitialized state.

## Example

    // This code example shows how the USB_DEVICE_Status function
    // can be used to check if the USB Device Layer is ready
    // for client operations.

    SYS_MODULE_OBJ      object;     // Returned from DRV_USB_Initialize
    SYS_STATUS          status;

    status = USB_DEVICE_Status(object);

    if (SYS_STATUS_READY != status)
    {
        // Handle error
    }

## Remarks

None.