This commit is contained in:
hathach 2021-07-21 17:00:02 +07:00
parent a226dbaa4d
commit 37cac414f8
5 changed files with 29 additions and 12 deletions

View File

@ -30,13 +30,24 @@
#include "common/tusb_common.h"
#include "osal/osal.h"
#include "common/tusb_fifo.h"
#include "dcd_attr.h"
#ifdef __cplusplus
extern "C" {
#endif
//--------------------------------------------------------------------+
// Configuration
//--------------------------------------------------------------------+
#ifndef CFG_TUD_ENDPPOINT_MAX
#define CFG_TUD_ENDPPOINT_MAX DCD_ATTR_ENDPOINT_MAX
#endif
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
//--------------------------------------------------------------------+
typedef enum
{
DCD_EVENT_INVALID = 0,

View File

@ -33,6 +33,7 @@
// - ENDPOINT_MAX: max (logical) number of endpoint
// - ENDPOINT_EXCLUSIVE_NUMBER: endpoint number with different direction IN and OUT aren't allowed,
// e.g EP1 OUT & EP1 IN cannot exist together
// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
//------------- NXP -------------//
#if TU_CHECK_MCU(LPC11UXX) || TU_CHECK_MCU(LPC13XX) || TU_CHECK_MCU(LPC15XX)
@ -48,7 +49,11 @@
#elif TU_CHECK_MCU(LPC51UXX)
#define DCD_ATTR_ENDPOINT_MAX 5
#elif TU_CHECK_MCU(LPC54XXX) || TU_CHECK_MCU(LPC55XX)
#elif TU_CHECK_MCU(LPC54XXX)
// TODO USB0 has 5, USB1 has 6
#define DCD_ATTR_ENDPOINT_MAX 6
#elif TU_CHECK_MCU(LPC55XX)
// TODO USB0 has 5, USB1 has 6
#define DCD_ATTR_ENDPOINT_MAX 6
@ -143,4 +148,9 @@
#define DCD_ATTR_ENDPOINT_MAX 8
#endif
// Default to fullspeed if not defined
//#ifndef PORT_HIGHSPEED
// #define DCD_ATTR_PORT_HIGHSPEED 0x00
//#endif
#endif

View File

@ -37,18 +37,10 @@
// USBD Configuration
//--------------------------------------------------------------------+
#ifndef CFG_TUD_ENDPOINT0_SIZE
#define CFG_TUD_ENDPOINT0_SIZE 64
#endif
#ifndef CFG_TUD_TASK_QUEUE_SZ
#define CFG_TUD_TASK_QUEUE_SZ 16
#endif
#ifndef CFG_TUD_ENDPPOINT_MAX
#define CFG_TUD_ENDPPOINT_MAX DCD_ATTR_ENDPOINT_MAX
#endif
//--------------------------------------------------------------------+
// Device Data
//--------------------------------------------------------------------+

View File

@ -27,12 +27,12 @@
#ifndef _TUSB_USBD_H_
#define _TUSB_USBD_H_
#include "common/tusb_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "common/tusb_common.h"
//--------------------------------------------------------------------+
// Application API
//--------------------------------------------------------------------+

View File

@ -210,6 +210,10 @@
// DEVICE OPTIONS
//--------------------------------------------------------------------
#ifndef CFG_TUD_ENDPOINT0_SIZE
#define CFG_TUD_ENDPOINT0_SIZE 64
#endif
#ifndef CFG_TUD_CDC
#define CFG_TUD_CDC 0
#endif