Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
c1fa2306
Commit
c1fa2306
authored
Dec 06, 2009
by
Dean Camera
Browse files
Add new USB_Host_GetDeviceStringDescriptor() convenience function.
parent
c49bdcb7
Changes
3
Hide whitespace changes
Inline
Side-by-side
LUFA/Drivers/USB/LowLevel/Host.c
View file @
c1fa2306
...
...
@@ -308,6 +308,22 @@ uint8_t USB_Host_GetDeviceDescriptor(void* const DeviceDescriptorPtr)
return
USB_Host_SendControlRequest
(
DeviceDescriptorPtr
);
}
uint8_t
USB_Host_GetDeviceStringDescriptor
(
uint8_t
Index
,
void
*
const
Buffer
,
uint8_t
BufferLength
)
{
USB_ControlRequest
=
(
USB_Request_Header_t
)
{
bmRequestType:
(
REQDIR_DEVICETOHOST
|
REQTYPE_STANDARD
|
REQREC_DEVICE
),
bRequest:
REQ_GetDescriptor
,
wValue:
(
DTYPE_String
<<
8
)
|
Index
,
wIndex:
0
,
wLength:
BufferLength
,
};
Pipe_SelectPipe
(
PIPE_CONTROLPIPE
);
return
USB_Host_SendControlRequest
(
Buffer
);
}
uint8_t
USB_Host_ClearPipeStall
(
uint8_t
EndpointNum
)
{
if
(
Pipe_GetPipeToken
()
==
PIPE_TOKEN_IN
)
...
...
LUFA/Drivers/USB/LowLevel/Host.h
View file @
c1fa2306
...
...
@@ -201,6 +201,22 @@
*/
uint8_t
USB_Host_GetDeviceDescriptor
(
void
*
const
DeviceDescriptorPtr
);
/** Convenience function. This routine sends a GetDescriptor 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.
*
* \note After this routine returns, the control pipe will be selected.
*
* \param[in] Index Index of the string index to retrieve
* \param[out] Buffer Pointer to the destination buffer where the retrieved string decriptor is
* to be stored
* \param[in] BufferLength Maximum size of the string descriptor which can be stored into the buffer
*
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
uint8_t
USB_Host_GetDeviceStringDescriptor
(
uint8_t
Index
,
void
*
const
Buffer
,
uint8_t
BufferLength
);
/** Clears a stall condition on the given pipe, via a ClearFeature request to the attached device.
*
* \note After this routine returns, the control pipe will be selected.
...
...
LUFA/ManPages/ChangeLog.txt
View file @
c1fa2306
...
...
@@ -22,6 +22,7 @@
* - Added new HID_ALIGN_DATA() macro to return the pre-retrieved value of a HID report item, left-aligned to a given datatype
* - Added new PreviousValue to the HID Report Parser report item structure, for easy monitoring of previous report item values
* - Added new EVK527 board target
* - Added new USB_Host_GetDeviceStringDescriptor() convenience function
*
* <b>Changed:</b>
* - Removed code in the Keyboard demos to send zeroed reports between two reports with differing numbers of keycodes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment