Go to the documentation of this file.
8#define USB_DESC_WORD(__VALUE) \
9 ((uint16_t)(__VALUE) >> 0) & 0xFF, ((uint16_t)(__VALUE) >> 8) & 0xFF
11#define USB_DESC_DWORD(__VALUE) \
12 ((__VALUE) >> 0) & 0xFF, ((__VALUE) >> 8) & 0xFF, \
13 ((__VALUE) >> 16) & 0xFF, ((__VALUE) >> 24) & 0xFF
15#define USB_DESC_DEV_LEN USB_DT_DEVICE_SIZE
16#define USB_DESC_DEV(__VERSION, __CLASS, __SUBCLASS, __PROTOCOL, __EP0_SIZE, __VID, __PID, __BCD_VER, __I_MANUFACTURER, __I_PRODUCT, __I_SERIAL_NUM, __CONFIG_NUM)\
19 USB_DESC_WORD(__VERSION), \
24 USB_DESC_WORD(__VID), \
25 USB_DESC_WORD(__PID), \
26 USB_DESC_WORD(__BCD_VER), \
32#define USB_DESC_DEV_IAD_LEN (USB_DESC_IAD_LEN + USB_DESC_DEV_LEN)
33#define USB_DESC_DEV_IAD(__VERSION, __EP0_SIZE, __VID, __PID, __BCD_VER, __I_MANUFACTURER, __I_PRODUCT, __I_SERIAL_NUM, __CONFIG_NUM)\
34 USB_DESC_DEV((__VERSION), 0xEF, 0x02, 0x01, (__EP0_SIZE), (__VID), (__PID), (__BCD_VER), (__I_MANUFACTURER), (__I_PRODUCT), (__I_SERIAL_NUM), (__CONFIG_NUM))
36#define USB_DESC_CFG_LEN USB_DT_CONFIG_SIZE
37#define USB_DESC_CFG(__CFG_SIZE, __IFS_NUM, __CONFIG_VALUE, __I_CONFIG, __ATTR, __MAX_POWER)\
40 USB_DESC_WORD(__CFG_SIZE), \
47#define USB_DESC_IFS_LEN USB_DT_INTERFACE_SIZE
48#define USB_DESC_IFS(__IFS_NUM, __ALT_SETTING, __EP_NUM, __CLASS, __SUBCLASS, __PROTOCOL, __I_IFS)\
59#define USB_DESC_EP_LEN USB_DT_ENDPOINT_SIZE
60#define USB_DESC_EP(__EP_NUM, __EP_ATTR, __EP_SIZE, __EP_INTERVAL) \
65 USB_DESC_WORD(__EP_SIZE), \
68#define USB_DESC_QUALIFIER_LEN USB_DT_DEVICE_QUALIFIER_SIZE
69#define USB_DESC_QUALIFIER(__VERSION, __CLASS, __SUB_CLASS, __PROTOCOL, __EP0_SIZE, __CONFIG_NUM)\
70 USB_DESC_QUALIFIER_LEN, \
71 USB_DT_DEVICE_QUALIFIER, \
72 USB_DESC_WORD(__VERSION), \
80#define USB_DESC_IAD_LEN USB_DT_INTERFACE_ASSOCIATION_SIZE
81#define USB_DESC_IAD(__IFS_START, __IFS_NUM, __CLASS, __SUBCLASS, __PROTOCOL, __I_FUNC)\
83 USB_DT_INTERFACE_ASSOCIATION, \
91#define USB_DESC_STRING_LEN(__STR_LEN) ((__STR_LEN) + 2)
92#define USB_DESC_STRING(__STR_LEN, ...) \
93 USB_DESC_STRING_LEN(__STR_LEN), \