X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/e071f3897a0946c6be1e1b5e1f78eda8dcbf6fc7..03ee87b35abdb8b92e8b55ec040fa943f9a6786c:/LUFA/Drivers/USB/LowLevel/Host.h?ds=sidebyside diff --git a/LUFA/Drivers/USB/LowLevel/Host.h b/LUFA/Drivers/USB/LowLevel/Host.h index a602cee77..07ff0fce7 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.h +++ b/LUFA/Drivers/USB/LowLevel/Host.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -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. @@ -312,7 +328,7 @@ */ }; - /** Enum for the error codes for the \ref EVENT_USB_HostError() event. + /** Enum for the error codes for the \ref EVENT_USB_Host_HostError() event. * * \see \ref Group_Events for more information on this event. */ @@ -326,14 +342,14 @@ */ }; - /** Enum for the error codes for the \ref EVENT_USB_DeviceEnumerationFailed() event. + /** Enum for the error codes for the \ref EVENT_USB_Host_DeviceEnumerationFailed() event. * * \see \ref Group_Events for more information on this event. */ enum USB_Host_EnumerationErrorCodes_t { HOST_ENUMERROR_NoError = 0, /**< No error occurred. Used internally, this is not a valid - * ErrorCode parameter value for the \ref EVENT_USB_DeviceEnumerationFailed() + * ErrorCode parameter value for the \ref EVENT_USB_Host_DeviceEnumerationFailed() * event. */ HOST_ENUMERROR_WaitStage = 1, /**< One of the delays between enumeration steps failed @@ -366,7 +382,7 @@ #define USB_Host_VBUS_Auto_Off() MACROS{ OTGCON |= (1 << VBUSRQC); }MACROE #define USB_Host_VBUS_Manual_Off() MACROS{ PORTE &= ~(1 << 7); }MACROE - #define USB_Host_SetDeviceAddress(addr) MACROS{ UHADDR = (addr & 0x7F); }MACROE + #define USB_Host_SetDeviceAddress(addr) MACROS{ UHADDR = ((addr) & 0x7F); }MACROE /* Enums: */ enum USB_Host_WaitMSErrorCodes_t