Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Highly flexible Composite USB Device Library

License

NotificationsYou must be signed in to change notification settings

IntergatedCircuits/USBDevice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project implements a platform-independent, highly flexible USB Device software framework,which allows you to create a full-feature USB 2.0 device firmwarewith multiple independent interfaces.

Features

  • Effective compliance to USB 2.0 specification
  • Interfaces are independent of the device and can be added or removed in runtime
  • Interface classes support multiple instantiation
  • All USB descriptors are created internally (no need for user definition)
  • Code size optimized for resource-constrained systems
  • Platform-independent stack
  • A console interface template provides zero-effort implementation for standard I/O through a CDC serial port

Supported device classes

  • Communications Device Class (CDC - ACM) specification version 1.10
  • Network Control Model (CDC -NCM) specification version 1.0
  • Human Interface Device Class (HID) specification version 1.11 - with helper macros for report definition
  • Mass Storage Class Bulk-Only Transport (MSC - BOT) revision 1.0 with transparent SCSI command set
  • Device Firmware Upgrade Class (DFU) specification version 1.1(or DFU STMicroelectronics Extension(DFUSE) 1.1AusingUSBD_DFU_ST_EXTENSION compile switch)

Contents

The project consists of the followings:

  • The USB 2.0 device framework is located in theDevice folder.
  • Common USB classes are implemented as part of the project, under theClass folder.
  • TheTemplates folder containsusbd_config.h configuration file and various example files.
  • TheDoc folder contains a prepareddoxyfile for Doxygen documentation generation.

Platform support

Currently the following hardware platforms are supported:

Basis of operation

The interface implementations are completely separated from the USB device control.Each of them should use its class-specific API fromusbd_<class>.h.There are only two steps to mount an interface to a device:

  1. Setting the interface's endpoint addresses;
  2. Cross-referencing the interface and the device with aUSBD_<CLASS>_MountInterface() call.

The interfaces are added to the device configuration in the order of the mount calls.It is possible to change the active interfaces during runtime by unmounting all and mounting the new ones.The only requirement is that the device has to be logically disconnected from the host when it is done.

The device control of the library is limited to the global state managementusing the public API inusbd.h. The bulk of the device operation is servicingthe device peripheral events:

  • USB Reset signal on bus ->USBD_ResetCallback()
  • USB control pipe setup request received ->USBD_SetupCallback()
  • USB endpoint data transfer completed ->USBD_EpInCallback() orUSBD_EpOutCallback()

The USBD handles are used as a shared management structure for both this stackand the peripheral driver. Any additional fields that the peripheral driver requirescan be defined in the driver-specificusbd_pd_def.h header, while theusbd_types.h shallbe included by the driver.

Example Projects

A virtual network with a single lwIP server (DNS, DHCP, HTTP) is presented by the device(as a network adapter). Composite USB device demonstrating the CDC-NCM function usageand a reduced DFU interface to enter ROM bootloader.

A generic USB device bootloader firmware for STM32 controllers.USB device with a single DFU interfacewhich is mountable on both the bootloader's and the application's device stack.

A debug serial port with selectable output power and battery charging.Composite USB device with one CDC (serial port),two HID interfaces (onboard sensors and power management)and the bootloader's DFU interface.

A CAN bus gateway which uses a custom protocol over a USB serial port emulation.Composite USB device with CDC-ACM function and the bootloader's DFU interface.

How to contribute

This project is free to use for everyone as long as the license terms are met.Any found defects or suggestions should be reported as a GitHub issue.Improvements in the form of pull requests are also welcome.

Authors

About

Highly flexible Composite USB Device Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp