add Auto descriptor endpoint num config to support lpc17xx

CFG_TUD_DESC_*_EPNUM
This commit is contained in:
hathach
2018-11-28 16:10:31 +07:00
parent a3cc52829b
commit 8b03b6d3b4
3 changed files with 57 additions and 31 deletions

View File

@@ -52,7 +52,7 @@
// defined by compiler flags for flexibility
#ifndef CFG_TUSB_MCU
#error CFG_TUSB_MCU should be defined using compiler flags
#error CFG_TUSB_MCU must be defined
#endif
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX
@@ -93,12 +93,22 @@
*/
#define CFG_TUD_DESC_AUTO 1
/* USB VID/PID if not defined, tinyusb to use default value
/* If USB VID/PID is not defined, tinyusb will use default value
* Note: different class combination e.g CDC and (CDC + MSC) should have different
* PID since Host OS will "remembered" device driver after the first plug */
// #define CFG_TUD_DESC_VID 0xCAFE
// #define CFG_TUD_DESC_PID 0x0001
// LPC175x_6x's endpoint type (bulk/interrupt/iso) are fixed by its number
// Therefor we need to force endpoint number to correct type on lpc17xx
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
#define CFG_TUD_DESC_CDC_EPNUM_NOTIF 1
#define CFG_TUD_DESC_CDC_EPNUM 2
#define CFG_TUD_DESC_MSC_EPNUM 5
#define CFG_TUD_DESC_HID_KEYBOARD_EPNUM 4
#define CFG_TUD_DESC_HID_MOUSE_EPNUM 7
#endif
//------------- CLASS -------------//
#define CFG_TUD_CDC 1
#define CFG_TUD_MSC 1
@@ -114,7 +124,6 @@
#define CFG_TUD_HID_KEYBOARD_BOOT 1
#define CFG_TUD_HID_MOUSE_BOOT 1
//--------------------------------------------------------------------
// CDC
//--------------------------------------------------------------------