vusbd11di.c 2.3 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*********************************************************************/

#include "os_bb.h"
#include "osint.h"

/*FUNCTION*----------------------------------------------------------------
* 
* Function Name  : _usb_dci_vusb11_deinit_endpoint
* Returned Value : None
* Comments       :
*     Resets the endpoint registers e.g. to disable TX, RX, control
* 
*END*--------------------------------------------------------------------*/
void _usb_dci_vusb11_deinit_endpoint
   (
      /* [IN] Handle to the USB device */
      _usb_device_handle   handle,
            
      /* [IN] the endpoint number */
      uint_8               ep,
      
      /* [IN] The transfer descriptor for this endpoint */
      XD_STRUCT_PTR        pxd
   )
{ /* Body */
      USB_DEV_STATE_STRUCT_PTR usb_dev_ptr;
      
      usb_dev_ptr = (USB_DEV_STATE_STRUCT_PTR)handle;
      
      switch (pxd->TYPE) {
         case USB_ISOCHRONOUS_ENDPOINT:
            pxd->CTL = 0;
            usb_dev_ptr->ENDPT_REGS[ep] &= ~VUSB_ENDPT_ISO_BIDIR;
            break;
         case USB_INTERRUPT_ENDPOINT:
            pxd->CTL = 0;
            usb_dev_ptr->ENDPT_REGS[ep] &= ~VUSB_ENDPT_BULK_BIDIR;
            break;
         case USB_CONTROL_ENDPOINT:
            pxd->CTL = 0;
            usb_dev_ptr->ENDPT_REGS[ep] &= ~VUSB_ENDPT_CONTROL;
            break;
         case USB_BULK_ENDPOINT:
            pxd->CTL = 0;
            usb_dev_ptr->ENDPT_REGS[ep] &= ~VUSB_ENDPT_BULK_BIDIR;
         default:
            break;
      } /* Endswitch */
      
} /* EndBody */