Commit cf14a60f authored by Johann Fischer's avatar Johann Fischer Committed by Carles Cufi
Browse files

include: usb: add descriptor and data section macros



This patch adds USB descriptor and data section macros.

Use USBD_DESCR_..._DEFINE macros to place the parts of USB device
descriptor in predetermined order in the USB descriptor
section. The parts of a device descriptor are also
sorted according to the macro argument. All parts of a
particular device descriptor must use the same argument.

Use USBD_CFG_DATA_DEFINE macro to place the data struct
of a class driver or function in the USB data section.

Signed-off-by: default avatarJohann Fischer <j.fischer@phytec.de>
parent b35a41f9
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -43,6 +43,30 @@
extern "C" {
#endif

/*
 * These macros should be used to place the USB descriptors
 * in predetermined order in the RAM.
 */
#define USBD_DEVICE_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 0) __used
#define USBD_CLASS_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 1) __used
#define USBD_MISC_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 2) __used
#define USBD_USER_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 3) __used
#define USBD_STRING_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 4) __used
#define USBD_TERM_DESCR_DEFINE(p) \
	static __in_section(usb, descriptor_##p, 5) __used

/*
 * This macro should be used to place the struct usb_cfg_data
 * inside usb data section in the RAM.
 */
#define USBD_CFG_DATA_DEFINE(name) \
	static __in_section(usb, data, name) __used

/*************************************************************************
 *  USB configuration
 **************************************************************************/