Struct Request
pub struct Request {
pub direction: Direction,
pub request_type: RequestType,
pub recipient: Recipient,
pub request: u8,
pub value: u16,
pub index: u16,
pub length: u16,
}Expand description
A control request read from a SETUP packet.
Fields§
§direction: DirectionDirection of the request.
request_type: RequestTypeType of the request.
recipient: RecipientRecipient of the request.
request: u8Request code. The meaning of the value depends on the previous fields.
value: u16Request value. The meaning of the value depends on the previous fields.
index: u16Request index. The meaning of the value depends on the previous fields.
length: u16Length of the DATA stage. For control OUT transfers this is the exact length of the data the host sent. For control IN transfers this is the maximum length of data the device should return.
Implementations§
§impl Request
impl Request
pub const GET_STATUS: u8 = 0
pub const GET_STATUS: u8 = 0
Standard USB control request Get Status
pub const CLEAR_FEATURE: u8 = 1
pub const CLEAR_FEATURE: u8 = 1
Standard USB control request Clear Feature
pub const SET_FEATURE: u8 = 3
pub const SET_FEATURE: u8 = 3
Standard USB control request Set Feature
pub const SET_ADDRESS: u8 = 5
pub const SET_ADDRESS: u8 = 5
Standard USB control request Set Address
pub const GET_DESCRIPTOR: u8 = 6
pub const GET_DESCRIPTOR: u8 = 6
Standard USB control request Get Descriptor
pub const SET_DESCRIPTOR: u8 = 7
pub const SET_DESCRIPTOR: u8 = 7
Standard USB control request Set Descriptor
pub const GET_CONFIGURATION: u8 = 8
pub const GET_CONFIGURATION: u8 = 8
Standard USB control request Get Configuration
pub const SET_CONFIGURATION: u8 = 9
pub const SET_CONFIGURATION: u8 = 9
Standard USB control request Set Configuration
pub const GET_INTERFACE: u8 = 10
pub const GET_INTERFACE: u8 = 10
Standard USB control request Get Interface
pub const SET_INTERFACE: u8 = 11
pub const SET_INTERFACE: u8 = 11
Standard USB control request Set Interface
pub const SYNCH_FRAME: u8 = 12
pub const SYNCH_FRAME: u8 = 12
Standard USB control request Synch Frame
pub const FEATURE_ENDPOINT_HALT: u16 = 0
pub const FEATURE_ENDPOINT_HALT: u16 = 0
Standard USB feature Endpoint Halt for Set/Clear Feature
pub const FEATURE_DEVICE_REMOTE_WAKEUP: u16 = 1
pub const FEATURE_DEVICE_REMOTE_WAKEUP: u16 = 1
Standard USB feature Device Remote Wakeup for Set/Clear Feature
pub const fn descriptor_type_index(&self) -> (u8, u8)
pub const fn descriptor_type_index(&self) -> (u8, u8)
Gets the descriptor type and index from the value field of a GET_DESCRIPTOR request.