Skip to content

Commit

Permalink
Merge pull request #134 from ianrrees/doc-update
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
ryan-summers authored Nov 15, 2023
2 parents 7a80498 + d78e794 commit 7d2b12a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.3.1] - 2023-11-15

### Added
* `LangID` in `prelude` and `class_prelude`, `StringDescriptors` in `prelude`
* `BuilderError`, `LangID`, `StringDescriptors` now in `prelude`
* `LangID` now in `class_prelude`

### Changed
* Updated documentation, including example code

## [0.3.0] - 2023-11-13

Expand Down Expand Up @@ -65,7 +71,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

This is the initial release to crates.io.

[Unreleased]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.1...HEAD
[0.3.1]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.9...v0.3.0
[0.2.9]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.8...v0.2.9
[0.2.8]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.7...v0.2.8
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "usb-device"
description = "Experimental device-side USB stack for embedded devices."
version = "0.3.0"
description = "USB stack for embedded devices."
version = "0.3.1"
edition = "2018"
readme = "README.md"
keywords = ["no-std", "embedded", "usb"]
license = "MIT"
authors = ["Matti Virkkunen <[email protected]>"]
repository = "https://github.com/mvirkkunen/usb-device"
repository = "https://github.com/rust-embedded-community/usb-device"

[dependencies]
defmt = { version = "0.3", optional = true }
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
usb-device
==========

Experimental device-side USB stack for embedded devices in Rust.

This crate is still under development and should not be considered production ready or even USB
compliant.
USB stack for embedded devices in Rust.

The UsbDevice object represents a composite USB device and is the most important object for
application implementors. The UsbDevice combines a number of UsbClasses (either custom ones, or
Expand Down Expand Up @@ -39,7 +36,7 @@ Class crates

* [usbd-hid](https://github.com/twitchyliquid64/usbd-hid) [![Crates.io](https://img.shields.io/crates/v/usbd-hid.svg)](https://crates.io/crates/usbd-hid) - HID class
* [usbd-human-device-interface](https://github.com/dlkj/usbd-human-interface-device) [![Crates.io](https://img.shields.io/crates/v/usbd-human-interface-device.svg)](https://crates.io/crates/usbd-human-device-interface) - HID class
* [usbd-serial](https://github.com/mvirkkunen/usbd-serial) [![Crates.io](https://img.shields.io/crates/v/usbd-serial.svg)](https://crates.io/crates/usbd-serial) - CDC-ACM serial port class
* [usbd-serial](https://github.com/rust-embedded-community/usbd-serial) [![Crates.io](https://img.shields.io/crates/v/usbd-serial.svg)](https://crates.io/crates/usbd-serial) - CDC-ACM serial port class
* [usbd-storage](https://github.com/apohrebniak/usbd-storage) [![Crates.io](https://img.shields.io/crates/v/usbd-storage.svg)](https://crates.io/crates/usbd-storage) - (Experimental) Mass storage port class
* [usbd-dfu](https://github.com/vitalyvb/usbd-dfu) [![Crates.io](https://img.shields.io/crates/v/usbd-dfu.svg)](https://crates.io/crates/usbd-dfu) - Device Firmware Upgrade class
* [usbd-picotool-reset](https://github.com/ithinuel/usbd-picotool-reset) [![Crates.io](https://img.shields.io/crates/v/usbd-picotool-reset.svg)](https://crates.io/crates/usbd-picotool-reset) - picotool-reset class
Expand Down
4 changes: 4 additions & 0 deletions src/device_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ macro_rules! builder_fields {
}

#[derive(Copy, Clone, Debug, PartialEq)]
/// Error type for the USB device builder
pub enum BuilderError {
/// String descriptors were provided in more languages than are supported
TooManyLanguages,
/// Control endpoint can only be 8, 16, 32, or 64 byte max packet size
InvalidPacketSize,
/// Configuration specifies higher USB power draw than allowed
PowerTooHigh,
}

Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ pub mod endpoint;
/// // product name. If using an existing class, remember to check the class crate documentation
/// // for correct values.
/// let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x5824, 0x27dd))
/// .product(&["Serial port"])
/// .strings(&[StringDescriptors::new(LangID::EN)
/// .product("Serial port")])
/// .expect("Failed to set strings")
/// .device_class(usb_serial::DEVICE_CLASS)
/// .build();
///
Expand Down Expand Up @@ -185,6 +187,7 @@ pub mod prelude {
pub use crate::device::{
StringDescriptors, UsbDevice, UsbDeviceBuilder, UsbDeviceState, UsbVidPid,
};
pub use crate::device_builder::BuilderError;
pub use crate::LangID;
pub use crate::UsbError;
}
Expand Down

0 comments on commit 7d2b12a

Please sign in to comment.