コード例 #1
0
ファイル: usb_host.c プロジェクト: da-steve101/Geryon
//*****************************************************************************
//
// Clean up and release all USB hardware resources.
//
//*****************************************************************************
void
ScopeUSBHostTerm(void)
{
    //
    // If necessary, unmount the USB flash drive.
    //
    if((g_eState == STATE_DEVICE_ENUM) || (g_eState == STATE_DEVICE_READY))
    {
        FileMountUSB(false);
    }

    //
    // Nothing is connected any more.
    //
    g_eState = STATE_NO_DEVICE;

    //
    // Close our MSC drive instance.
    //
    USBHMSCDriveClose(g_ulMSCInstance);
    g_ulMSCInstance = 0;

    //
    // Tell the USB library that we are finished using the host controller.
    //
    USBHCDTerm(0);
}
コード例 #2
0
ファイル: usb_host.c プロジェクト: fejerson108/Stellarisware
//*****************************************************************************
//
// Clean up and release all USB hardware resources.
//
//*****************************************************************************
void
ScopeUSBHostTerm(void)
{
    //
    // If necessary, unmount the USB flash drive.
    //
    if((g_eState == STATE_DEVICE_ENUM) || (g_eState == STATE_DEVICE_READY))
    {
        FileMountUSB(false);
    }

    //
    // Nothing is connected any more.
    //
    g_eState = STATE_NO_DEVICE;

    //
    // Close our MSC drive instance.
    //
    USBHMSCDriveClose(g_ulMSCInstance);
    g_ulMSCInstance = 0;

    //
    // Tell the USB library that we are finished using the host controller.
    //
    USBHCDTerm(0);

    //
    // Turn off USB Phy clock.
    //
    SysCtlUSBPLLDisable();

    //
    // Disable the USB peripheral
    //
    SysCtlPeripheralDisable(SYSCTL_PERIPH_USB0);
}