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 Functions

RL-USB Device Functions can be used for creating USB Device applications. The functions are categorized into global functions and class specific functions.

  • Global functions.
    These RL-USB functions initialize and connect a USB Device. Use these functions prior to using any other class specific function.

    Function Name Description
    usbd_init Initializes the USB Device core and controller hardware. Use this function before using any other USB Device function.
    usbd_connect Connects or disconnects the USB Device.
    usbd_reset_core Resets the USB Device core.
    usbd_configured Returns the configuration status of the USB Device core.
  • Audio Device Class (ADC) functions.
    Use the following class specific functions to customize audio device functionality. Adapt these functions in the file usbd_user_adc.c.

    Function Name Description
    usbd_adc_init Initializes the USB Device user audio functionality.
    Custom functions to provide required USB Audio Device functionality. (For example timer interrupt routine to output audio samples on speaker)
  • Communication Device Class (CDC) - Abstract Control Model (ACM) functions.
    Use these class specific functions to customize a serial communication device of abstract control model type functionality. Adapt these functions in the file usbd_user_cdc_acm.c.

    Function Name Description
    USBD_CDC_ACM_PortInitialize Inititalizes the hardware resources of the port used as the Virtual COM Port.
    USBD_CDC_ACM_PortUninitialize Uninititalizes/releases the hardware resources of the port used as the Virtual COM Port.
    USBD_CDC_ACM_PortReset Resets the state of the port used as the Virtual COM Port.
    USBD_CDC_ACM_PortSetLineCoding Changes communication settings of the port used as the Virtual COM Port.
    USBD_CDC_ACM_PortGetLineCoding Retrieves communication settings of the port used as the Virtual COM Port.
    USBD_CDC_ACM_PortSetControlLineState Sets control line state on the port used as the Virtual COM Port.
    USBD_CDC_ACM_DataSend Puts requested data to the intermediate buffer and prepares it for sending over the Virtual COM Port and if sending is not in progess it send the data immediately.
    USBD_CDC_ACM_PutChar Puts requested data character to the intermediate buffer and prepares it for sending over the Virtual COM Port and if sending is not in progress it send the data immediately.
    USBD_CDC_ACM_DataRead Reads data from the intermediate buffer that was received over the Virtual COM Port.
    USBD_CDC_ACM_GetChar Reads data character from the intermediate buffer that was received over the Virtual COM Port.
    USBD_CDC_ACM_DataAvailable Retrieves number of bytes available in the intermediate buffer that were received over the Virtual COM Port.
    USBD_CDC_ACM_Notify Sends error and line status of the Virtual COM Port over the Interrupt endpoint.
  • Human Interface Device Class (HID) functions.
    Use the following class specific functions to customize a human interface device functionality. Adapt these functions in the file usbd_user_hid.c.

    Function Name Description
    usbd_hid_init Initializes the user USB Device user HID functionality.
    usbd_hid_get_report_trigger Asynchronously prepares USB HID report data to be sent to the USB Host upon first USB Host request for data.
    usbd_hid_get_report Prepares USB HID report data to be sent to the USB Host.
    usbd_hid_set_report Processes the USB HID report data that was received.
    usbd_hid_get_protocol Prepares USB HID get protocol response to be sent to the USB Host.
    usbd_hid_set_protocol Processes the USB HID set protocol request that was received.
  • Mass Storage Device Class (MSC) functions.
    Use the following class specific functions to customize a mass storage device functionality. Adapt these functions in the file usbd_user_msc.c.

    Function Name Description
    usbd_msc_init Initializes the USB Device user Mass Storage functionality.
    usbd_msc_read_sect Handles the read request of a USB Mass Storage Device.
    usbd_msc_write_sect Handles the write request of a USB Mass Storage Device.
    usbd_msc_start_stop Callback function called when USB Mass Storage Device receives START STOP UNIT command.
  • Custom Class functions.
    Use the following class specific functions to customize a custom class device functionality. Custom class can be used for implementing unsupported classes or vendor class. Template usbd_cls.c module can be found in ..\ARM\RL\USB\Template folder. Adapt these functions in the file usbd_cls.c.

    Function Name Description
    usbd_cls_init Initializes the USB Device user Custom Class Device functionality.
    usbd_cls_sof Handles Custom Class periodic communication on Start Of Frame.
    usbd_cls_dev_req Handles Custom Class Device Device request.
    usbd_cls_if_req Handles Custom Class Device Interface request.
    usbd_cls_ep_req Handles Custom Class Device Endpoint request.
  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.