vusbd11sh.c 2.05 KB
/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved                                          
***                                                              
*** This software embodies materials and concepts which are      
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license   
*** agreement with ARC International             
***
*** File: vusbd11.c
***
*** Comments:      
***   This file contains the low-level VUSB1.1 routines.
***                                                               
**************************************************************************
*END*********************************************************************/
#ifdef __USB_OS_MQX__
#include "mqx.h"
#include "bsp.h"
#else
#include "devapi.h"
#include "usb.h"
#include "vusb11.h"
#endif
#include "usbprv.h"
#include "usbdprv.h"


/*FUNCTION*----------------------------------------------------------------
* 
* Function Name  : _usb_dci_vusb11_shutdown
* Returned Value : None
* Comments       :
*     Shutdown the device
* 
*END*--------------------------------------------------------------------*/
void _usb_dci_vusb11_shutdown
   (
      /* [IN] Handle to the USB device */
      _usb_device_handle   handle
   )
{ /* Body */
      USB_DEV_STATE_STRUCT_PTR usb_dev_ptr;
      uint_8 i;
      
      usb_dev_ptr = (USB_DEV_STATE_STRUCT_PTR)handle;

      /* disable the VUSB */
      usb_dev_ptr->USB->CONTROL = 0;
      /* mask all interrupts */
      usb_dev_ptr->USB->INTENABLE = 0;
      
      /* disable all endpoints */
      for (i = 0; i < usb_dev_ptr->MAX_ENDPOINTS; i++) {
         usb_dev_ptr->ENDPT_REGS[i] = VUSB_ENDPT_DISABLE;
      } /* Endfor */

      /* Free all the Callback function structure memory */
      USB_memfree(usb_dev_ptr->USB_BDT_PAGE_BLOCK);
      
} /* EndBody */

/* EOF */