pub trait Endpoint {
// Required methods
fn address(&self) -> u8;
fn endpoint_num(&self) -> u8;
fn transfer_type(&self) -> TransferType;
fn direction(&self) -> Direction;
fn max_packet_size(&self) -> u16;
fn in_toggle(&self) -> bool;
fn set_in_toggle(&mut self, toggle: bool);
fn out_toggle(&self) -> bool;
fn set_out_toggle(&mut self, toggle: bool);
}
Expand description
Endpoint
defines the USB endpoint for various transfers.
Required Methods§
Sourcefn endpoint_num(&self) -> u8
fn endpoint_num(&self) -> u8
Endpoint number, irrespective of direction. (e.g., for both
endpoint addresses, 0x81
and 0x01
, this function would
return 0x01
).
Sourcefn transfer_type(&self) -> TransferType
fn transfer_type(&self) -> TransferType
The type of transfer this endpoint uses.
Sourcefn max_packet_size(&self) -> u16
fn max_packet_size(&self) -> u16
The maximum packet size for this endpoint.
Sourcefn in_toggle(&self) -> bool
fn in_toggle(&self) -> bool
The data toggle sequence bit for the next transfer from the device to the host.
Sourcefn set_in_toggle(&mut self, toggle: bool)
fn set_in_toggle(&mut self, toggle: bool)
The USBHost
will, when required, update the data toggle
sequence bit for the next device to host transfer.
Sourcefn out_toggle(&self) -> bool
fn out_toggle(&self) -> bool
The data toggle sequence bit for the next transfer from the host to the device.
Sourcefn set_out_toggle(&mut self, toggle: bool)
fn set_out_toggle(&mut self, toggle: bool)
The USBHost
will, when required, update the data toggle
sequence bit for the next host to device transfer.