Partager via


UsbDbgPdd_Disconnect (Compact 2013)

10/16/2014

Implement this function to disconnect the USB function controller from the USB bus.

Syntax

extern "C" BOOL UsbDbgPdd_Disconnect( )

Parameters

None.

Return Value

Implement this function so that it returns TRUE if the USB function controller is successfully disconnected from the USB bus; otherwise, return FALSE.

Remarks

This function is called by the model device driver (MDD) to detach the USB function controller from the USB bus.

Example

The following example shows a typical implementation of the UsbDbgPdd_Disconnect function.

Important

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

extern "C" BOOL UsbDbgPdd_Disconnect( )
{
    USBFN_PDD *pPdd = (USBFN_PDD *)&usbfn_pdd;
    CSP_USB_REGS* pUSBDRegs = pPdd->pUSBDRegs;

    USBDBGMSG(USBDBG_ZONE_FUNC, (L"usbdbgpdd: +UsbDbgPdd_Disconnect\r\n"));

    // Disconnect hardware
    USBControllerRun( pUSBDRegs, FALSE);

    USBDBGMSG(USBDBG_ZONE_FUNC, (L"usbdbgpdd: -UsbDbgPdd_Disconnect\r\n"));

    return TRUE;

}

Requirements

Header

UsbDbgDdsi.h

See Also

Reference

USBDBG PDD Functions