Skip to content

Commit 7d2b12a

Browse files
authored
Merge pull request #134 from ianrrees/doc-update
Documentation updates
2 parents 7a80498 + d78e794 commit 7d2b12a

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [0.3.1] - 2023-11-15
11+
1012
### Added
11-
* `LangID` in `prelude` and `class_prelude`, `StringDescriptors` in `prelude`
13+
* `BuilderError`, `LangID`, `StringDescriptors` now in `prelude`
14+
* `LangID` now in `class_prelude`
15+
16+
### Changed
17+
* Updated documentation, including example code
1218

1319
## [0.3.0] - 2023-11-13
1420

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

6672
This is the initial release to crates.io.
6773

68-
[Unreleased]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.0...HEAD
74+
[Unreleased]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.1...HEAD
75+
[0.3.1]: https://github.com/rust-embedded-community/usb-device/compare/v0.3.0...v0.3.1
6976
[0.3.0]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.9...v0.3.0
7077
[0.2.9]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.8...v0.2.9
7178
[0.2.8]: https://github.com/rust-embedded-community/usb-device/compare/v0.2.7...v0.2.8

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "usb-device"
3-
description = "Experimental device-side USB stack for embedded devices."
4-
version = "0.3.0"
3+
description = "USB stack for embedded devices."
4+
version = "0.3.1"
55
edition = "2018"
66
readme = "README.md"
77
keywords = ["no-std", "embedded", "usb"]
88
license = "MIT"
99
authors = ["Matti Virkkunen <[email protected]>"]
10-
repository = "https://github.com/mvirkkunen/usb-device"
10+
repository = "https://github.com/rust-embedded-community/usb-device"
1111

1212
[dependencies]
1313
defmt = { version = "0.3", optional = true }

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
usb-device
22
==========
33

4-
Experimental device-side USB stack for embedded devices in Rust.
5-
6-
This crate is still under development and should not be considered production ready or even USB
7-
compliant.
4+
USB stack for embedded devices in Rust.
85

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

4037
* [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
4138
* [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
42-
* [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
39+
* [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
4340
* [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
4441
* [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
4542
* [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

src/device_builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ macro_rules! builder_fields {
2424
}
2525

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

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ pub mod endpoint;
149149
/// // product name. If using an existing class, remember to check the class crate documentation
150150
/// // for correct values.
151151
/// let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x5824, 0x27dd))
152-
/// .product(&["Serial port"])
152+
/// .strings(&[StringDescriptors::new(LangID::EN)
153+
/// .product("Serial port")])
154+
/// .expect("Failed to set strings")
153155
/// .device_class(usb_serial::DEVICE_CLASS)
154156
/// .build();
155157
///
@@ -185,6 +187,7 @@ pub mod prelude {
185187
pub use crate::device::{
186188
StringDescriptors, UsbDevice, UsbDeviceBuilder, UsbDeviceState, UsbVidPid,
187189
};
190+
pub use crate::device_builder::BuilderError;
188191
pub use crate::LangID;
189192
pub use crate::UsbError;
190193
}

0 commit comments

Comments
 (0)