Partager via


UsbDbgPdd_Connect (Compact 2013)

10/16/2014

Implement this function to logically attach the device to the USB bus.

Syntax

extern "C" BOOL UsbDbgPdd_Connect(
    USBDBG_DEVICE_DESCRIPTOR* pDeviceDesc
)

Parameters

  • pDeviceDesc
    [in] Pointer to a device descriptor that is returned by the model device driver (MDD) to the host.

Return Value

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

Remarks

This function is called by the MDD during initialization to attach to the USB bus.

Example

The following example shows a typical implementation of the UsbDbgPdd_Connect 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_Connect(USBDBG_DEVICE_DESCRIPTOR* pDeviceDesc)
{

    USBFN_PDD *pPdd = (USBFN_PDD *)&usbfn_pdd;
    CSP_USB_REGS* pUSBDRegs = pPdd->pUSBDRegs;

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

    // Connect the line
    USBControllerRun( pUSBDRegs, TRUE);

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

    return TRUE;

}

Requirements

Header

UsbDbgDdsi.h

See Also

Reference

USBDBG PDD Functions
USBDBG_DEVICE_DESCRIPTOR
USBDBGMSG