USBD_DrvAddrSet
Description
The next API function to implement is the device address set/AddrSet()
function. The device address set function is called while processing a SET_ADDRESS
setup request.
Files
Every device driver’s usbd_drv.c
Prototype
static CPU_BOOLEAN USBD_DrvAddrSet (USBD_DRV *p_drv, CPU_INT08U dev_addr);
Arguments
p_drv
Pointer to USB device driver structure.
dev_addr
Device address assigned by the host.
Returned Value
DEF_OK
, if NO error(s).
DEF_FAIL
, otherwise.
Callers
USB device core layer.
Notes / Warnings
- For device controllers that have hardware assistance to enable the device address after the status stage has completed, the assignment of the device address can also be combined with enabling the device address mode.
- For device controllers that change the device address immediately, without waiting the status phase to complete, see
USBD_DrvAddrEn
.