aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb
diff options
context:
space:
mode:
authorAdam Simpkins <[email protected]>2024-04-07 14:37:52 -0700
committerAdam Simpkins <[email protected]>2024-04-09 10:31:19 -0700
commit03a87add156258ebb14d96e7d0b6b8597015e69a (patch)
tree8bee3b529d8e6dde2798fc4cae963d676d037da6 /embassy-usb
parent029636e6fc06b484898c5935957b33b60a9c88b2 (diff)
USB: fix comments about the config.max_packet_size_0 field
Fix the comment about the default value: this defaults to 64 rather than 8 bytes. It seems like the max packet size for endpoint 0 should normally be selected automatically, rather than being part of the config. At best it seems like this setting should just be a hint that gets used if when the bus is operating at full speed. The contents of the device descriptor should ideally be updated with the correct max packet size after bus enumeration completes. In practice always using 64 is probably fine if low speed environments never need to be supported. (Super speed requires a max packet size of 512 bytes, which I didn't list in the comments here.)
Diffstat (limited to 'embassy-usb')
-rw-r--r--embassy-usb/src/builder.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs
index c06107396..387b780de 100644
--- a/embassy-usb/src/builder.rs
+++ b/embassy-usb/src/builder.rs
@@ -38,11 +38,12 @@ pub struct Config<'a> {
38 38
39 /// Maximum packet size in bytes for the control endpoint 0. 39 /// Maximum packet size in bytes for the control endpoint 0.
40 /// 40 ///
41 /// Valid values are 8, 16, 32 and 64. There's generally no need to change this from the default 41 /// Valid values depend on the speed at which the bus is enumerated.
42 /// value of 8 bytes unless a class uses control transfers for sending large amounts of data, in 42 /// - low speed: 8
43 /// which case using a larger packet size may be more efficient. 43 /// - full speed: 8, 16, 32, or 64
44 /// - high speed: 64
44 /// 45 ///
45 /// Default: 8 bytes 46 /// Default: 64 bytes
46 pub max_packet_size_0: u8, 47 pub max_packet_size_0: u8,
47 48
48 /// Manufacturer name string descriptor. 49 /// Manufacturer name string descriptor.