USBD_DevFrameNbrGet

Description

Gets the current frame number from the USB device driver.

Files

usbd_core.h/usbd_core.c

Prototype

CPU_INT16U  USBD_DevFrameNbrGet (CPU_INT08U   dev_nbr,
                                 USBD_ERR    *p_err);


Arguments

dev_nbr

Device number.

p_err

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

USBD_ERR_NONE
USBD_ERR_DEV_INVALID_NBR
USBD_ERR_DEV_INVALID_STATE

Returned Value

The current frame number.

Callers

Application.

Notes / Warnings

  1. The frame number will always be in the range 0-2047 (11 bits).
  2. Frame number returned to the caller contains the frame and microframe numbers. It is encoded using a 16-bit format: bit 0 to 10 contains the frame numer, bit 11 to 13 contains the microframe number. The caller must use the macros USBD_FRAME_NBR_GET() or USBD_MICROFRAME_NBR_GET() to get the frame or microframe number only.