USBD_BulkAdd

Description

Adds a bulk endpoint to alternate setting interface.

Files

usbd_core.h/usbd_core.c

Prototype

CPU_INT08U  USBD_BulkAdd (CPU_INT08U    dev_nbr,
                          CPU_INT08U    cfg_nbr,
                          CPU_INT08U    if_nbr,
                          CPU_INT08U    if_alt_nbr,
                          CPU_BOOLEAN   dir_in,
                          CPU_INT16U    max_pkt_len,
                          USBD_ERR     *p_err);


Arguments

dev_nbr

Device number.

cfg_nbr

Configuration number.

if_nbr

Interface number.

if_alt_nbr

Interface alternate setting number.

dir_in

Endpoint direction.

ValueDirection
DEF_YES
IN
DEF_NO
OUT

max_pkt_len

Endpoint maximum packet length (see Note #1).

p_err

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

USBD_ERR_NONE
USBD_ERR_INVALID_ARG
USBD_ERR_DEV_INVALID_NBR
USBD_ERR_CFG_INVALID_NBR
USBD_ERR_IF_INVALID_NBR
USBD_ERR_EP_NONE_AVAIL
USBD_ERR_EP_ALLOC

Returned Value

Endpoint address, if no error(s).

USBD_EP_ADDR_NONE, otherwise.

Callers

Classes.

Notes / Warnings

  1. If the max_pkt_len argument is '0', the stack will allocate the first available bulk endpoint regardless its maximum packet size.