USBD_DrvEP_Open

Description

Open and configure a device endpoint, given its characteristics (e.g., endpoint type, endpoint address, maximum packet size, etc).

Files

Every device driver’s usbd_drv.c

Prototype

static  void  USBD_DrvEP_Open (USBD_DEV    *p_drv,
                               CPU_INT08U   ep_addr,
                               CPU_INT08U   ep_type,
                               CPU_INT16U   max_pkt_size,
                               CPU_INT08U   transaction_frame,
                               USBD_ERR    *p_err);


Arguments

p_drv

Pointer to USB device driver structure.

ep_addr

Endpoint address.

ep_type

Endpoint type:

USB_EP_TYPE_CTRL,
USB_EP_TYPE_ISOC,
USB_EP_TYPE_BULK,
USB_EP_TYPE_INTR.

max_pkt_size

Maximum packet size.

transaction_frame

Endpoint transactions per frame.

p_err

Pointer to variable that will receive the return error code from this function.

Returned Value

None.

Callers

USB device core layer.

Notes / Warnings

  1. Typically, the endpoint open function performs the following operations:
    1. Configure endpoint information in the device controller. This may include not only assigning the type and maximum packet size, but also making certain that the endpoint is successfully configured (or realized or mapped). For some device controllers, this may not be necessary.
    2. max_pkt_size is the maximum packet size the endpoint can send or receive.