![]() |
LUFA Library
120219
|
Pipe control request definitions. More...
Modules | |
Pipe Control Request Management (AVR8) | |
Pipe control request management definitions for the Atmel AVR8 architecture. | |
Pipe Control Request Management (UC3) | |
Pipe control request management definitions for the Atmel AVR32 UC3 architecture. | |
Enumerations | |
enum | USB_Host_SendControlErrorCodes_t { HOST_SENDCONTROL_Successful = 0, HOST_SENDCONTROL_DeviceDisconnected = 1, HOST_SENDCONTROL_PipeError = 2, HOST_SENDCONTROL_SetupStalled = 3, HOST_SENDCONTROL_SoftwareTimeOut = 4 } |
Functions | |
uint8_t | USB_Host_SendControlRequest (void *const BufferPtr) |
uint8_t | USB_Host_SetDeviceConfiguration (const uint8_t ConfigNumber) |
uint8_t | USB_Host_GetDeviceConfiguration (uint8_t *const ConfigNumber) ATTR_NON_NULL_PTR_ARG(1) |
uint8_t | USB_Host_GetDescriptor (const uint8_t Type, const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3) |
uint8_t | USB_Host_GetDeviceStatus (uint8_t *const FeatureStatus) ATTR_NON_NULL_PTR_ARG(1) |
uint8_t | USB_Host_ClearEndpointStall (const uint8_t EndpointAddress) |
uint8_t | USB_Host_SetInterfaceAltSetting (const uint8_t InterfaceIndex, const uint8_t AltSetting) |
uint8_t | USB_Host_GetInterfaceAltSetting (const uint8_t InterfaceIndex, uint8_t *const AltSetting) ATTR_NON_NULL_PTR_ARG(2) |
static uint8_t | USB_Host_GetDeviceDescriptor (USB_Descriptor_Device_t *const DeviceDescriptorPtr) ATTR_NON_NULL_PTR_ARG(1) |
static uint8_t | USB_Host_GetDeviceStringDescriptor (const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(2) |
Module for host mode request processing. This module allows for the transmission of standard, class and vendor control requests to the default control endpoint of an attached device while in host mode.
Enum for the USB_Host_SendControlRequest() return code, indicating the reason for the error if the transfer of the request is unsuccessful.
uint8_t USB_Host_ClearEndpointStall | ( | const uint8_t | EndpointAddress | ) |
Clears a stall condition on the given pipe, via a CLEAR FEATURE standard request to the attached device.
[in] | EndpointAddress | Address of the endpoint to clear, including the endpoint's direction. |
uint8_t USB_Host_GetDescriptor | ( | const uint8_t | Type, |
const uint8_t | Index, | ||
void *const | Buffer, | ||
const uint8_t | BufferLength | ||
) |
Sends a GET DESCRIPTOR standard request to the attached device, requesting the descriptor of the specified type and index.
[in] | Type | Type of descriptor to retrieve, a value from the USB_DescriptorTypes_t enum. |
[in] | Index | Index of the descriptor to retrieve. |
[out] | Buffer | Pointer to the destination buffer where the retrieved string descriptor is to be stored. |
[in] | BufferLength | Maximum size of the string descriptor which can be stored into the buffer. |
uint8_t USB_Host_GetDeviceConfiguration | ( | uint8_t *const | ConfigNumber | ) |
Sends a GET CONFIGURATION standard request to the attached device, to retrieve the currently selected device configuration index.
[out] | ConfigNumber | Pointer to a location where the retrieved configuration index should be stored. |
static uint8_t USB_Host_GetDeviceDescriptor | ( | USB_Descriptor_Device_t *const | DeviceDescriptorPtr | ) | [inline, static] |
Sends a GET DESCRIPTOR standard request to the attached device, requesting the device descriptor. This can be used to easily retrieve information about the device such as its VID, PID and power requirements. This is a convenience wrapper for USB_Host_GetDescriptor().
[out] | DeviceDescriptorPtr | Pointer to the destination device descriptor structure where the read data is to be stored. |
uint8_t USB_Host_GetDeviceStatus | ( | uint8_t *const | FeatureStatus | ) |
Retrieves the current feature status of the attached device, via a GET STATUS standard request. The retrieved feature status can then be examined by masking the retrieved value with the various FEATURE_*
masks for bus/self power information and remote wakeup support.
[out] | FeatureStatus | Location where the retrieved feature status should be stored. |
static uint8_t USB_Host_GetDeviceStringDescriptor | ( | const uint8_t | Index, |
void *const | Buffer, | ||
const uint8_t | BufferLength | ||
) | [inline, static] |
Sends a GET DESCRIPTOR standard request to the attached device, requesting the string descriptor of the specified index. This can be used to easily retrieve string descriptors from the device by index, after the index is obtained from the Device or Configuration descriptors. This is a convenience wrapper for USB_Host_GetDescriptor().
[in] | Index | Index of the string descriptor to retrieve. |
[out] | Buffer | Pointer to the destination buffer where the retrieved string descriptor is to be stored. |
[in] | BufferLength | Maximum size of the string descriptor which can be stored into the buffer. |
uint8_t USB_Host_GetInterfaceAltSetting | ( | const uint8_t | InterfaceIndex, |
uint8_t *const | AltSetting | ||
) |
Retrieves the current alternative setting for the specified interface, via a GET INTERFACE standard request to the attached device.
[in] | InterfaceIndex | Index of the interface whose alternative setting is to be altered. |
[out] | AltSetting | Pointer to a location where the retrieved alternative setting value should be stored. |
uint8_t USB_Host_SendControlRequest | ( | void *const | BufferPtr | ) |
Sends the request stored in the USB_ControlRequest global structure to the attached device, and transfers the data stored in the buffer to the device, or from the device to the buffer as requested. The transfer is made on the currently selected pipe.
[in] | BufferPtr | Pointer to the start of the data buffer if the request has a data stage, or NULL if the request transfers no data to or from the device. |
uint8_t USB_Host_SetDeviceConfiguration | ( | const uint8_t | ConfigNumber | ) |
Sends a SET CONFIGURATION standard request to the attached device, with the given configuration index.
This routine will automatically update the USB_HostState and USB_Host_ConfigurationNumber state variables according to the given function parameters and the result of the request.
[in] | ConfigNumber | Configuration index to send to the device. |
uint8_t USB_Host_SetInterfaceAltSetting | ( | const uint8_t | InterfaceIndex, |
const uint8_t | AltSetting | ||
) |
Selects a given alternative setting for the specified interface, via a SET INTERFACE standard request to the attached device.
[in] | InterfaceIndex | Index of the interface whose alternative setting is to be altered. |
[in] | AltSetting | Index of the interface's alternative setting which is to be selected. |