| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
Device Definitions and General Functions (LPC18xx)
Device Management

## Detailed Description

Device Definitions and General Functions for the LPC architecture.

Functions, macros, variables, enums and types related to usb device.

## Macros
#define | USB_DEVICE_OPT_FULLSPEED (0 << 0)
#define | USE_INTERNAL_SERIAL 0xDC
#define | INTERNAL_SERIAL_LENGTH_BITS 80
#define | INTERNAL_SERIAL_START_ADDRESS 0x0E

## Functions
void | USB_Device_SendRemoteWakeup (void)
| Sends a Remote Wakeup request to the host. This signals to the host that the device should be taken out of suspended mode, and communications should resume.
static uint16_t | USB_Device_GetFrameNumber (uint8_t corenum) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT
| Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host) the frame number is incremented by one.
static void | USB_Device_EnableSOFEvents (void) ATTR_ALWAYS_INLINE
| Enables the device mode Start Of Frame events. When enabled, this causes the EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus, at the start of each USB frame when enumerated in device mode.
static void | USB_Device_DisableSOFEvents (void) ATTR_ALWAYS_INLINE
| Disables the device mode Start Of Frame events. When disabled, this stops the firing of the EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.

## Macro Definition Documentation

#define INTERNAL_SERIAL_LENGTH_BITS 80

Length of the device's unique internal serial number, in bits, if present on the selected microcontroller model.

Definition at line 92 of file Device_LPC18xx.h.

#define INTERNAL_SERIAL_START_ADDRESS 0x0E

Start address of the internal serial number, in the appropriate address space, if present on the selected microcontroller model.

Definition at line 97 of file Device_LPC18xx.h.

#define USB_DEVICE_OPT_FULLSPEED (0 << 0)

Mask for the Options parameter of the USB_Init() function. This indicates that the USB interface should be initialized in full speed (12Mb/s) mode.

Definition at line 75 of file Device_LPC18xx.h.

#define USE_INTERNAL_SERIAL 0xDC

String descriptor index for the device's unique serial number string descriptor within the device. This unique serial number is used by the host to associate resources to the device (such as drivers or COM port number allocations) to a device regardless of the port it is plugged in to on the host. Some microcontrollers contain a unique serial number internally, and setting the device descriptors serial number string index to this value will cause it to use the internal serial number.

On unsupported devices, this will evaluate to NO_DESCRIPTOR and so will force the host to create a pseudo-serial number for the device.

Definition at line 87 of file Device_LPC18xx.h.

## Function Documentation

static void USB_Device_DisableSOFEvents | ( | void |  | ) |
| inline static

Disables the device mode Start Of Frame events. When disabled, this stops the firing of the EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.

Note
  Not available when the `NO_SOF_EVENTS` compile time token is defined.

Returns
  Nothing.

Definition at line 166 of file Device_LPC18xx.h.

static void USB_Device_EnableSOFEvents | ( | void |  | ) |
| inline static

Enables the device mode Start Of Frame events. When enabled, this causes the EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus, at the start of each USB frame when enumerated in device mode.

Note
  Not available when the `NO_SOF_EVENTS` compile time token is defined.

Returns
  Nothing.

Definition at line 154 of file Device_LPC18xx.h.

static uint16_t USB_Device_GetFrameNumber | ( | uint8_t | corenum | ) |
| inline static

Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host) the frame number is incremented by one.

Parameters

  corenum | : ID Number of USB Core to be processed.

Returns
  Current frame number.

Definition at line 138 of file Device_LPC18xx.h.

void USB_Device_SendRemoteWakeup | ( | void |  | ) |

Sends a Remote Wakeup request to the host. This signals to the host that the device should be taken out of suspended mode, and communications should resume.

Typically, this is implemented so that HID devices (mice, keyboards, etc.) can wake up the host computer when the host has suspended all USB devices to enter a low power state.

Note
  This macro should only be used if the device has indicated to the host that it supports the Remote Wakeup feature in the device descriptors, and should only be issued if the host is currently allowing remote wakeup events from the device (i.e., the USB_Device_RemoteWakeupEnabled flag is set). When the `NO_DEVICE_REMOTE_WAKEUP` compile time option is used, this macro is unavailable.
  The USB clock must be running for this function to operate. If the stack is initialized with the USB_OPT_MANUAL_PLL option enabled, the user must ensure that the PLL is running before attempting to call this function.

See Also
  USB Descriptors for more information on the RMWAKEUP feature and device descriptors.

Returns
  Nothing.

Definition at line 39 of file Device.c.