Keil Logo

Technical Support

On-Line Manuals

RL-ARM User's Guide (MDK v4)

RL-RTX RL-FlashFS RL-TCPnet RL-CAN RL-USB RL-USB for USB Device Applications RL-USB Device Library RL-USB Device Features RL-USB Device Software Stack RL-USB Device Functions RL-USB Device Source Files RL-USB Device Configuration Audio Device (ADC) Options Communication Device (CDC) - ACM Options Human Interface Device (HID) Options Mass Storage Device (MSC) Options Create USB Device Applications Create ADC Applications Create CDC ACM Applications Create HID Applications Create MSC Applications Create Composite Applications Test USB Device Applications Compliance Tests Test HID Client Application RL-USB for USB Host Applications RL-USB Host Library RL-USB Host Features RL-USB Host Software Stack RL-USB Host Functions RL-USB Host Source Files RL-USB Host Configuration Host Controller Driver Selection Host Controller Driver Configuration Host Class Driver Selection Create USB Host Applications Create USB Host HID Applications HID_Kbd Example Create USB Host MSC Applications Create USB Host Class Driver RL-USB Host Constants and Structures Error constants Speed constants Transaction Packet Type constants Transaction Error Type constants USB Request Block structure (USBH_URB) Endpoint structure (USBH_EP) Driver Capabilites structure (USBH_HCI_CAP) Device Class Instance structure (USBH_DCI) Host Controller Instance structure (USBH_HCI) Host Controller Driver structure (USBH_HCD) USB Concepts USB Transfer Rates USB Network Basic Communication Model USB Protocol Control Transfer Interrupt Transfer Isochronous Transfer Bulk Transfer Descriptors Device Configuration Device Descriptor Configuration Descriptor Interface Descriptor Endpoint Descriptor Device Qualifier Descriptor Example Programs Library Reference Appendix

RL-USB Device Configuration

RL-USB Device Configuration explains the options offered by the RL-USB Library for configuring USB Devices. Options are set in the file usb_config.c directly or using the µVision Configuration Wizard.

RL-USB Configuration Wizard

Where
  • USB Device - enables the USB Device functionality. This option corresponds to #define USBD_ENABLE.
    #define USBD_ENABLE                 1
    
  • High Speed - enables high speed support, if supported by the microcontroller. This option corresponds to #define  USBD_HS_ENABLE.
    #define USBD_ENABLE                 0
    
Device Settings
configure the settings of the USB Device that affect Device Descriptor.
  • Power sets default power source, Bus-powered or Self-powered. This option corresponds to #define USBD_POWER.
    #define USBD_POWER                0                         // 0 = Bus-powered;  1 = Self-powered;
    
  • Max Endpoint 0 Packet Size sets the maximum packet size of endpoint 0 (bMaxPacketSize0). Values of 8, 16, 32, and 64 Bytes are possible. This option corresponds to #define USBD_MAX_PACKET0.
    #define USBD_MAX_PACKET0          8                         // 8, 16, 32, and 64 Bytes
    
  • Vendor ID sets the vendor identification number (idVendor) assigned by the USB-IF. Values between 0x0000-0xFFFF are valid. This option corresponds to #define USBD_DEVDESC_IDVENDOR.
    #define USBD_DEVDESC_IDVENDOR     0xC251                    // ask USB-IF for a valid ID
    
  • Product ID sets the product identification number (idProduct) assigned by the manufacturer. Values between 0x0000-0xFFFF are valid. This option corresponds to #define USBD_DEVDESC_IDPRODUCT.
    #define USBD_DEVDESC_IDPRODUCT    0x1705                    // ask the manufacturer for a valid ID
    
  • Device Release Number sets the product release number (bcdDevice) assigned by the manufacturer. Values between 0x0000-0xFFFF are valid. This option corresponds to #define USBD_DEVDESC_BCDDEVICE.
    #define USBD_DEVDESC_BCDDEVICE    0x0100                    // ask manufacturer for release number
    
Configuration Settings
configure the settings of the USB Device that affect Configuration Descriptor.
  • Remote Wakeup sets the wakeup attribute (D5: of bmAttributes). This option corresponds to #define USBD_CFGDESC_BMATTRIBUTES.
    #define USBD_CFGDESC_BMATTRIBUTES 0xA0
    
  • Maximum Power Consumption (in mA) sets the maximum power consumption (bMaxPower) allowed when the device is fully operational. Values between 0..510 are possible. This option corresponds to #define USBD_CFGDESC_BMAXPOWER.
    #define USBD_CFGDESC_BMAXPOWER    0x32                      // value range 0..510
    
String Settings
configure the language, manufacturer name, product name, and product serial number.
  • Language ID sets the language. Numbers between 0x0000-0xFCFF are valid. This option corresponds to #define USBD_STRDESC_LANGID.
    #define USBD_STRDESC_LANGID       0x0409                    // 0x0409 - English (United States)
    
  • Manufacturer String sets the manufacturer name. The string can have 126 characters. This option corresponds to #define USBD_STRDESC_MAN.
    #define USBD_STRDESC_MAN          L"Keil Software"          // max. 126 characters
    
  • Product String sets the product name. The string can have 126 characters. This option corresponds to #define USBD_STRDESC_PROD.
    #define USBD_STRDESC_PROD         L"Keil USB Device"        // max. 126 characters
    
  • Serial Number enables the serial number string. This option corresponds to #define USBD_STRDESC_SER_ENABLE.
    #define USBD_STRDESC_SER_ENABLE   1                         // 1=enabled; 0=disabled;
    
  • Serial Number String sets the serial number. This option corresponds to #define USBD_STRDESC_SER.
    #define USBD_STRDESC_SER          L"0001A0000000"           // max. 126 characters
    
Class Support
enables class specific requests. This option corresponds to #define USBD_CLASS_ENABLE.
#define USBD_CLASS_ENABLE              1                         // 1=enabled; 0=disabled;
The USB Device class options are explained in:

Note

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.