Go to the documentation of this file.
18#ifndef __VSF_USBD_CDCNCM_DESC_H__
19#define __VSF_USBD_CDCNCM_DESC_H__
32#define USB_DESC_CDC_NCM3(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
33 __I_MAC, __MAX_SEG_SIZE, __NETWORK_CAPABILITIES, __MC_FITER_NUM, __PWR_FILTER_NUM)\
34 USB_DESC_IFS((__IFS_START), 0, 1, USB_CLASS_COMM, 0x0D, 0x00, (__I_FUNC))\
39 USB_DESC_WORD(0x0110), \
52 USB_DESC_WORD(__MAX_SEG_SIZE), \
53 USB_DESC_WORD(__MC_FITER_NUM), \
59 USB_DESC_WORD(0x0100), \
60 (__NETWORK_CAPABILITIES), \
62 USB_DESC_EP(USB_DIR_IN | (__INT_IN_EP), USB_ENDPOINT_XFER_INT, 16, (__INT_EP_INTERVAL))\
63 USB_DESC_IFS((__IFS_START) + 1, 0, 0, USB_CLASS_CDC_DATA, 0x00, 0x01, (__I_FUNC))\
64 USB_DESC_IFS((__IFS_START) + 1, 1, 2, USB_CLASS_CDC_DATA, 0x00, 0x01, (__I_FUNC))\
65 USB_DESC_EP(USB_DIR_IN | (__BULK_IN_EP), USB_ENDPOINT_XFER_BULK, (__BULK_EP_SIZE), 0x00)\
66 USB_DESC_EP(USB_DIR_OUT | (__BULK_OUT_EP), USB_ENDPOINT_XFER_BULK, (__BULK_EP_SIZE), 0x00)
67#define USB_DESC_CDC_NCM2(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
68 __I_MAC, __MAX_SEG_SIZE, __NETWORK_CAPABILITIES, __MC_FITER_NUM) \
69 USB_DESC_CDC_NCM3(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
70 __I_MAC, __MAX_SEG_SIZE, __NETWORK_CAPABILITIES, __MC_FITER_NUM, 0)
71#define USB_DESC_CDC_NCM1(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
72 __I_MAC, __MAX_SEG_SIZE, __NETWORK_CAPABILITIES) \
73 USB_DESC_CDC_NCM2(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
74 __I_MAC, __MAX_SEG_SIZE, __NETWORK_CAPABILITIES, 0)
75#define USB_DESC_CDC_NCM0(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
76 __I_MAC, __MAX_SEG_SIZE) \
77 USB_DESC_CDC_NCM1(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
78 __I_MAC, __MAX_SEG_SIZE, 0)
82#define USB_DESC_CDC_NCM(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
83 __I_MAC, __MAX_SEG_SIZE, ...) \
84 __PLOOC_EVAL(USB_DESC_CDC_NCM, __VA_ARGS__) \
85 (__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
86 __I_MAC, __MAX_SEG_SIZE, ##__VA_ARGS__)
87#define USB_DESC_CDC_NCM_LEN \
88 ( USB_DT_INTERFACE_SIZE + 5 + 5 + 13 + 6 + USB_DT_ENDPOINT_SIZE + \
89 2 * USB_DT_INTERFACE_SIZE + 2 * USB_DT_ENDPOINT_SIZE)
91#define USB_DESC_CDC_NCM_IAD(__IFS_START, __I_FUNC, __INT_IN_EP, __BULK_IN_EP, __BULK_OUT_EP, __BULK_EP_SIZE, __INT_EP_INTERVAL,\
93 USB_DESC_IAD((__IFS_START), 2, USB_CLASS_COMM, 0x0D, 0x00, (__I_FUNC))\
94 USB_DESC_CDC_NCM((__IFS_START), (__I_FUNC), (__INT_IN_EP), (__BULK_IN_EP), (__BULK_OUT_EP), (__BULK_EP_SIZE), (__INT_EP_INTERVAL),\
95 __I_MAC, ##__VA_ARGS__)
96#define USB_DESC_CDC_NCM_IAD_LEN (USB_DESC_IAD_LEN + USB_DESC_CDC_NCM_LEN)