USBEnableEndpoint Function

Microchip USB Device Library

USB Device Library Help
USBEnableEndpoint Function
C
void USBEnableEndpoint(
    BYTE ep, 
    BYTE options
);
Description

This function will enable the specified endpoint with the specified options. 

Typical Usage:

void USBCBInitEP(void)
{
    USBEnableEndpoint(MSD_DATA_IN_EP,USB_IN_ENABLED|USB_OUT_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
    USBMSDInit();
}

 

In the above example endpoint number MSD_DATA_IN_EP is being configured for both IN and OUT traffic with handshaking enabled. Also since MSD_DATA_IN_EP is not endpoint 0 (MSD does not allow this), then we can explicitly disable SETUP packets on this endpoint.

Preconditions

None

Parameters
Parameters 
Description 
BYTE ep 
the endpoint to be configured 
BYTE options 
optional settings for the endpoint. The options should be ORed together to form a single options string. The available optional settings for the endpoint. The options should be ORed together to form a single options string. The available options are the following:
  • USB_HANDSHAKE_ENABLED enables USB handshaking (ACK, NAK)
  • USB_HANDSHAKE_DISABLED disables USB handshaking (ACK, NAK)
  • USB_OUT_ENABLED enables the out direction
  • USB_OUT_DISABLED disables the out direction
  • USB_IN_ENABLED enables the in direction
  • USB_IN_DISABLED disables the in direction
  • USB_ALLOW_SETUP enables control transfers
  • USB_DISALLOW_SETUP disables control transfers
  • USB_STALL_ENDPOINT STALLs this endpoint
 
Returns

None

Remarks

None

Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.