44 #ifndef __CONFIGDESCRIPTOR_H__
45 #define __CONFIGDESCRIPTOR_H__
48 #include "../../../Common/Common.h"
54 #if defined(__cplusplus)
59 #if !defined(__INCLUDE_FROM_USB_DRIVER)
60 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
77 #define DESCRIPTOR_PCAST(DescriptorPtr, Type) ((Type*)(DescriptorPtr))
91 #define DESCRIPTOR_CAST(DescriptorPtr, Type) (*DESCRIPTOR_PCAST(DescriptorPtr, Type))
97 #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Type
100 #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Size
160 const uint8_t ConfigNumber,
161 uint16_t*
const ConfigSizePtr,
162 void*
const BufferPtr,
174 void** const CurrConfigLoc,
190 void** const CurrConfigLoc,
192 const uint8_t BeforeType)
193 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
206 void** const CurrConfigLoc,
208 const uint8_t AfterType)
209 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
252 void** const CurrConfigLoc,
263 void** CurrConfigLoc) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
265 void** CurrConfigLoc)
269 if (*BytesRem < CurrDescriptorSize)
270 CurrDescriptorSize = *BytesRem;
272 *CurrConfigLoc = (
void*)((uintptr_t)*CurrConfigLoc + CurrDescriptorSize);
273 *BytesRem -= CurrDescriptorSize;
277 #if defined(__cplusplus)