@@ -64,7 +64,14 @@ pub enum EndpointType {
64
64
/// used only endpoint 0.
65
65
Control ,
66
66
/// Isochronous endpoint. Used for time-critical unreliable data.
67
- Isochronous ( ( IsochronousSynchronizationType , IsochronousUsageType ) ) ,
67
+ ///
68
+ /// See USB 2.0 spec section 5.12 "Special Considerations for Isochronous Transfers"
69
+ Isochronous {
70
+ /// Synchronization model used for the data stream that this endpoint relates to.
71
+ synchronization : IsochronousSynchronizationType ,
72
+ /// Endpoint's role in the synchronization model selected by [Self::Isochronous::synchronization].
73
+ usage : IsochronousUsageType ,
74
+ } ,
68
75
/// Bulk endpoint. Used for large amounts of best-effort reliable data.
69
76
Bulk ,
70
77
/// Interrupt endpoint. Used for small amounts of time-critical reliable data.
@@ -76,14 +83,17 @@ impl EndpointType {
76
83
pub fn to_bm_attributes ( & self ) -> u8 {
77
84
match self {
78
85
EndpointType :: Control => 0b00 ,
79
- EndpointType :: Isochronous ( ( sync_type, usage_type) ) => {
80
- let sync_bits = match sync_type {
86
+ EndpointType :: Isochronous {
87
+ synchronization,
88
+ usage,
89
+ } => {
90
+ let sync_bits = match synchronization {
81
91
IsochronousSynchronizationType :: NoSynchronization => 0b00 ,
82
92
IsochronousSynchronizationType :: Asynchronous => 0b01 ,
83
93
IsochronousSynchronizationType :: Adaptive => 0b10 ,
84
94
IsochronousSynchronizationType :: Synchronous => 0b11 ,
85
95
} ;
86
- let usage_bits = match usage_type {
96
+ let usage_bits = match usage {
87
97
IsochronousUsageType :: Data => 0b00 ,
88
98
IsochronousUsageType :: Feedback => 0b01 ,
89
99
IsochronousUsageType :: ImplicitFeedbackData => 0b10 ,
0 commit comments