![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Pipe control request definitions. More...
Modules | |
Pipe Control Request Management (LPC) | |
Pipe control request management definitions for the NXP LPC 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 (const uint8_t corenum, 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. | |
uint8_t | USB_Host_SetDeviceConfiguration (const uint8_t corenum, const uint8_t ConfigNumber) |
Sends a SET CONFIGURATION standard request to the attached device, with the given configuration index. | |
uint8_t | USB_Host_GetDeviceDescriptor (const uint8_t corenum, void *const DeviceDescriptorPtr) ATTR_NON_NULL_PTR_ARG(2) |
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. | |
uint8_t | USB_Host_GetDeviceStringDescriptor (const uint8_t corenum, const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3) |
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. | |
uint8_t | USB_Host_GetDeviceStatus (const uint8_t corenum, uint8_t *const FeatureStatus) ATTR_NON_NULL_PTR_ARG(2) |
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. | |
uint8_t | USB_Host_ClearEndpointStall (const uint8_t corenum, const uint8_t EndpointAddress) |
Clears a stall condition on the given pipe, via a CLEAR FEATURE standard request to the attached device. | |
uint8_t | USB_Host_SetInterfaceAltSetting (const uint8_t corenum, 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. | |
Pipe control request definitions.
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.
Definition at line 71 of file HostStandardReq.h.
uint8_t USB_Host_ClearEndpointStall | ( | const uint8_t | corenum, |
const uint8_t | EndpointAddress | ||
) |
Clears a stall condition on the given pipe, via a CLEAR FEATURE standard request to the attached device.
corenum | : USB port number |
EndpointAddress | : Address of the endpoint to clear, including the endpoint's direction. |
Definition at line 299 of file HostStandardReq.c.
uint8_t USB_Host_GetDeviceDescriptor | ( | const uint8_t | corenum, |
void *const | DeviceDescriptorPtr | ||
) |
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.
corenum | : USB port number |
DeviceDescriptorPtr | : Pointer to the destination device descriptor structure where the read data is to be stored. |
Definition at line 248 of file HostStandardReq.c.
uint8_t USB_Host_GetDeviceStatus | ( | const uint8_t | corenum, |
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.
corenum | : USB port number |
FeatureStatus | : Location where the retrieved feature status should be stored. |
Definition at line 283 of file HostStandardReq.c.
uint8_t USB_Host_GetDeviceStringDescriptor | ( | const uint8_t | corenum, |
const uint8_t | Index, | ||
void *const | Buffer, | ||
const uint8_t | BufferLength | ||
) |
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.
corenum | : USB port number |
Index | : Index of the string index to retrieve. |
Buffer | : Pointer to the destination buffer where the retrieved string descriptor is to be stored. |
BufferLength | : Maximum size of the string descriptor which can be stored into the buffer. |
Definition at line 264 of file HostStandardReq.c.
uint8_t USB_Host_SendControlRequest | ( | const uint8_t | corenum, |
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.
corenum | : USB port number |
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. |
Definition at line 45 of file HostStandardReq.c.
uint8_t USB_Host_SetDeviceConfiguration | ( | const uint8_t | corenum, |
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.
corenum | : USB port number |
ConfigNumber | : Configuration index to send to the device. |
Definition at line 224 of file HostStandardReq.c.
uint8_t USB_Host_SetInterfaceAltSetting | ( | const uint8_t | corenum, |
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.
corenum | : USB port number |
InterfaceIndex | : Index of the interface whose alternative setting is to be altered. |
AltSetting | : Index of the interface's alternative setting which is to be selected. |
Definition at line 315 of file HostStandardReq.c.