add TUP_USBIP_FSDEV and TUP_USBIP_FSDEV_STM32, clean up ifdef with stm32
This commit is contained in:
@@ -66,71 +66,41 @@
|
|||||||
|
|
||||||
// Use ring buffer if it's available, some MCUs need extra RAM requirements
|
// Use ring buffer if it's available, some MCUs need extra RAM requirements
|
||||||
#ifndef TUD_AUDIO_PREFER_RING_BUFFER
|
#ifndef TUD_AUDIO_PREFER_RING_BUFFER
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT
|
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT
|
||||||
#define TUD_AUDIO_PREFER_RING_BUFFER 0
|
#define TUD_AUDIO_PREFER_RING_BUFFER 0
|
||||||
#else
|
#else
|
||||||
#define TUD_AUDIO_PREFER_RING_BUFFER 1
|
#define TUD_AUDIO_PREFER_RING_BUFFER 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
|
// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
|
||||||
// is available or driver is would need to be changed dramatically
|
// is available or driver is would need to be changed dramatically
|
||||||
|
|
||||||
// Only STM32 and dcd_transdimension use non-linear buffer for now
|
// Only STM32 and dcd_transdimension use non-linear buffer for now
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || \
|
// dwc2 except esp32sx (since it may use dcd_esp32sx)
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F1 || \
|
#if (defined(TUP_USBIP_DWC2) && !TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)) || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F2 || \
|
defined(TUP_USBIP_FSDEV) || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F3 || \
|
CFG_TUSB_MCU == OPT_MCU_RX63X || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F4 || \
|
CFG_TUSB_MCU == OPT_MCU_RX65X || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F7 || \
|
CFG_TUSB_MCU == OPT_MCU_RX72N || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32H7 || \
|
CFG_TUSB_MCU == OPT_MCU_LPC18XX || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32L0 || \
|
CFG_TUSB_MCU == OPT_MCU_LPC43XX || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32L1 || \
|
CFG_TUSB_MCU == OPT_MCU_MIMXRT || \
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32L4 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32G4 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32WB || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_RX63X || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_RX65X || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_RX72N || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_GD32VF103 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_LPC18XX || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_LPC43XX || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_MIMXRT || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_MSP432E4
|
CFG_TUSB_MCU == OPT_MCU_MSP432E4
|
||||||
#if TUD_AUDIO_PREFER_RING_BUFFER
|
#if TUD_AUDIO_PREFER_RING_BUFFER
|
||||||
#define USE_LINEAR_BUFFER 0
|
#define USE_LINEAR_BUFFER 0
|
||||||
|
#else
|
||||||
|
#define USE_LINEAR_BUFFER 1
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define USE_LINEAR_BUFFER 1
|
#define USE_LINEAR_BUFFER 1
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define USE_LINEAR_BUFFER 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(STM32F102x6) || defined(STM32F102xB) || \
|
|
||||||
defined(STM32F103x6) || defined(STM32F103xB) || \
|
|
||||||
defined(STM32F103xE) || defined(STM32F103xG)
|
|
||||||
#define STM32F1_FSDEV
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(STM32L412xx) || defined(STM32L422xx) || \
|
|
||||||
defined(STM32L432xx) || defined(STM32L433xx) || \
|
|
||||||
defined(STM32L442xx) || defined(STM32L443xx) || \
|
|
||||||
defined(STM32L452xx) || defined(STM32L462xx)
|
|
||||||
#define STM32L4_FSDEV
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Temporarily put the check here for stm32_fsdev
|
// Temporarily put the check here for stm32_fsdev
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || \
|
#ifdef TUP_USBIP_FSDEV
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32F3 || \
|
#define USE_ISO_EP_ALLOCATION 1
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32L0 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32L1 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32G4 || \
|
|
||||||
CFG_TUSB_MCU == OPT_MCU_STM32WB || \
|
|
||||||
(TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) || \
|
|
||||||
(TU_CHECK_MCU(OPT_MCU_STM32L4) && defined(STM32L4_FSDEV))
|
|
||||||
#define USE_ISO_EP_ALLOCATION 1
|
|
||||||
#else
|
#else
|
||||||
#define USE_ISO_EP_ALLOCATION 0
|
#define USE_ISO_EP_ALLOCATION 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Declaration of buffers
|
// Declaration of buffers
|
||||||
@@ -142,143 +112,159 @@
|
|||||||
|
|
||||||
// EP IN software buffers and mutexes
|
// EP IN software buffers and mutexes
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
|
#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ];
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_FIFO_MUTEX
|
||||||
osal_mutex_def_t ep_in_ff_mutex_wr_1; // No need for read mutex as only USB driver reads from FIFO
|
osal_mutex_def_t ep_in_ff_mutex_wr_1; // No need for read mutex as only USB driver reads from FIFO
|
||||||
#endif
|
#endif
|
||||||
#endif // CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
|
#endif // CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
|
||||||
#if CFG_FIFO_MUTEX
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ];
|
||||||
osal_mutex_def_t ep_in_ff_mutex_wr_2; // No need for read mutex as only USB driver reads from FIFO
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t ep_in_ff_mutex_wr_2; // No need for read mutex as only USB driver reads from FIFO
|
||||||
#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
|
#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ];
|
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
|
||||||
osal_mutex_def_t ep_in_ff_mutex_wr_3; // No need for read mutex as only USB driver reads from FIFO
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ];
|
||||||
#endif
|
#if CFG_FIFO_MUTEX
|
||||||
#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
|
osal_mutex_def_t ep_in_ff_mutex_wr_3; // No need for read mutex as only USB driver reads from FIFO
|
||||||
|
#endif
|
||||||
|
#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
|
||||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||||
|
|
||||||
// Linear buffer TX in case:
|
// Linear buffer TX in case:
|
||||||
// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
|
// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
|
||||||
// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
|
// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_ENCODING)
|
#if CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_ENCODING)
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX > 0
|
#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX > 0
|
||||||
#endif
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX];
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX > 0
|
#endif
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX];
|
|
||||||
#endif
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX > 0
|
||||||
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX];
|
||||||
|
#endif
|
||||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
||||||
|
|
||||||
// EP OUT software buffers and mutexes
|
// EP OUT software buffers and mutexes
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
|
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
|
#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ];
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_FIFO_MUTEX
|
||||||
osal_mutex_def_t ep_out_ff_mutex_rd_1; // No need for write mutex as only USB driver writes into FIFO
|
osal_mutex_def_t ep_out_ff_mutex_rd_1; // No need for write mutex as only USB driver writes into FIFO
|
||||||
#endif
|
#endif
|
||||||
#endif // CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
|
#endif // CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
|
||||||
#if CFG_FIFO_MUTEX
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ];
|
||||||
osal_mutex_def_t ep_out_ff_mutex_rd_2; // No need for write mutex as only USB driver writes into FIFO
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t ep_out_ff_mutex_rd_2; // No need for write mutex as only USB driver writes into FIFO
|
||||||
#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
|
#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ];
|
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
|
||||||
osal_mutex_def_t ep_out_ff_mutex_rd_3; // No need for write mutex as only USB driver writes into FIFO
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ];
|
||||||
#endif
|
#if CFG_FIFO_MUTEX
|
||||||
#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
|
osal_mutex_def_t ep_out_ff_mutex_rd_3; // No need for write mutex as only USB driver writes into FIFO
|
||||||
|
#endif
|
||||||
|
#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
|
||||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
|
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
|
||||||
|
|
||||||
// Linear buffer RX in case:
|
// Linear buffer RX in case:
|
||||||
// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
|
// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
|
||||||
// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
|
// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX > 0
|
#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX];
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX > 0
|
||||||
#endif
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX];
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX > 0
|
#endif
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX];
|
|
||||||
#endif
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX > 0
|
||||||
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX];
|
||||||
|
#endif
|
||||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
|
||||||
|
|
||||||
// Control buffers
|
// Control buffers
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_1[CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_1[CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ];
|
||||||
|
|
||||||
#if CFG_TUD_AUDIO > 1
|
#if CFG_TUD_AUDIO > 1
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_2[CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_2[CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUD_AUDIO > 2
|
#if CFG_TUD_AUDIO > 2
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_3[CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_3[CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Active alternate setting of interfaces
|
// Active alternate setting of interfaces
|
||||||
uint8_t alt_setting_1[CFG_TUD_AUDIO_FUNC_1_N_AS_INT];
|
uint8_t alt_setting_1[CFG_TUD_AUDIO_FUNC_1_N_AS_INT];
|
||||||
|
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_N_AS_INT > 0
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_N_AS_INT > 0
|
||||||
uint8_t alt_setting_2[CFG_TUD_AUDIO_FUNC_2_N_AS_INT];
|
uint8_t alt_setting_2[CFG_TUD_AUDIO_FUNC_2_N_AS_INT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_N_AS_INT > 0
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_N_AS_INT > 0
|
||||||
uint8_t alt_setting_3[CFG_TUD_AUDIO_FUNC_3_N_AS_INT];
|
uint8_t alt_setting_3[CFG_TUD_AUDIO_FUNC_3_N_AS_INT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Software encoding/decoding support FIFOs
|
// Software encoding/decoding support FIFOs
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
|
#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
|
#if CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ];
|
||||||
tu_fifo_t tx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO];
|
tu_fifo_t tx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO];
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_FIFO_MUTEX
|
||||||
osal_mutex_def_t tx_supp_ff_mutex_wr_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
osal_mutex_def_t tx_supp_ff_mutex_wr_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
|
||||||
tu_fifo_t tx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ];
|
||||||
#if CFG_FIFO_MUTEX
|
tu_fifo_t tx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO];
|
||||||
osal_mutex_def_t tx_supp_ff_mutex_wr_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t tx_supp_ff_mutex_wr_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ > 0
|
#endif
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ];
|
|
||||||
tu_fifo_t tx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO];
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ > 0
|
||||||
#if CFG_FIFO_MUTEX
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ];
|
||||||
osal_mutex_def_t tx_supp_ff_mutex_wr_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
tu_fifo_t tx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO];
|
||||||
#endif
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t tx_supp_ff_mutex_wr_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
|
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
|
||||||
#if CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
|
#if CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ];
|
||||||
tu_fifo_t rx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO];
|
tu_fifo_t rx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO];
|
||||||
#if CFG_FIFO_MUTEX
|
#if CFG_FIFO_MUTEX
|
||||||
osal_mutex_def_t rx_supp_ff_mutex_rd_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
osal_mutex_def_t rx_supp_ff_mutex_rd_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
|
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ];
|
#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
|
||||||
tu_fifo_t rx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO];
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ];
|
||||||
#if CFG_FIFO_MUTEX
|
tu_fifo_t rx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO];
|
||||||
osal_mutex_def_t rx_supp_ff_mutex_rd_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t rx_supp_ff_mutex_rd_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
||||||
#endif
|
#endif
|
||||||
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ > 0
|
#endif
|
||||||
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ];
|
|
||||||
tu_fifo_t rx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO];
|
#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ > 0
|
||||||
#if CFG_FIFO_MUTEX
|
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ];
|
||||||
osal_mutex_def_t rx_supp_ff_mutex_rd_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
tu_fifo_t rx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO];
|
||||||
#endif
|
#if CFG_FIFO_MUTEX
|
||||||
#endif
|
osal_mutex_def_t rx_supp_ff_mutex_rd_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -48,7 +48,9 @@
|
|||||||
* - RHPORT_HIGHSPEED: support highspeed with on-chip PHY
|
* - RHPORT_HIGHSPEED: support highspeed with on-chip PHY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//------------- NXP -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// NXP
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
|
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 5
|
#define TUP_DCD_ENDPOINT_MAX 5
|
||||||
|
|
||||||
@@ -89,12 +91,16 @@
|
|||||||
#elif TU_CHECK_MCU(OPT_MCU_MM32F327X)
|
#elif TU_CHECK_MCU(OPT_MCU_MM32F327X)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 16
|
#define TUP_DCD_ENDPOINT_MAX 16
|
||||||
|
|
||||||
//------------- Nordic -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Nordic
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||||
// 8 CBI + 1 ISO
|
// 8 CBI + 1 ISO
|
||||||
#define TUP_DCD_ENDPOINT_MAX 9
|
#define TUP_DCD_ENDPOINT_MAX 9
|
||||||
|
|
||||||
//------------- Microchip -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Microchip
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_SAMD21, OPT_MCU_SAMD51, OPT_MCU_SAME5X) || \
|
#elif TU_CHECK_MCU(OPT_MCU_SAMD21, OPT_MCU_SAMD51, OPT_MCU_SAME5X) || \
|
||||||
TU_CHECK_MCU(OPT_MCU_SAMD11, OPT_MCU_SAML21, OPT_MCU_SAML22)
|
TU_CHECK_MCU(OPT_MCU_SAMD11, OPT_MCU_SAML21, OPT_MCU_SAML22)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
@@ -117,19 +123,30 @@
|
|||||||
#define TUP_DCD_ENDPOINT_MAX 16
|
#define TUP_DCD_ENDPOINT_MAX 16
|
||||||
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
|
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
|
||||||
|
|
||||||
//------------- ST -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// ST
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32F0)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F0)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32F1)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F1)
|
||||||
|
// - F102, F103 use fsdev
|
||||||
|
// - F105, F107 use dwc2
|
||||||
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
|
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
|
||||||
defined (STM32F107xB) || defined (STM32F107xC)
|
defined (STM32F107xB) || defined (STM32F107xC)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_USBIP_DWC2_STM32
|
#define TUP_USBIP_DWC2_STM32
|
||||||
|
|
||||||
#define TUP_DCD_ENDPOINT_MAX 4
|
#define TUP_DCD_ENDPOINT_MAX 4
|
||||||
#else
|
#elif defined(STM32F102x6) || defined(STM32F102xB) || \
|
||||||
|
defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
#else
|
||||||
|
#error "Unsupported STM32F1 mcu"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32F2)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F2)
|
||||||
@@ -140,6 +157,8 @@
|
|||||||
#define TUP_DCD_ENDPOINT_MAX 6
|
#define TUP_DCD_ENDPOINT_MAX 6
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32F3)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F3)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32F4)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F4)
|
||||||
@@ -168,12 +187,18 @@
|
|||||||
#define TUP_DCD_ENDPOINT_MAX 9
|
#define TUP_DCD_ENDPOINT_MAX 9
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32G4)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32G4)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32L4)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32L4)
|
||||||
|
// - L4x2, L4x3 use fsdev
|
||||||
|
// - L4x4, L4x6, L4x7, L4x9 use dwc2
|
||||||
#if defined (STM32L475xx) || defined (STM32L476xx) || \
|
#if defined (STM32L475xx) || defined (STM32L476xx) || \
|
||||||
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
|
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
|
||||||
defined (STM32L4A6xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || \
|
defined (STM32L4A6xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || \
|
||||||
@@ -183,11 +208,18 @@
|
|||||||
#define TUP_USBIP_DWC2_STM32
|
#define TUP_USBIP_DWC2_STM32
|
||||||
|
|
||||||
#define TUP_DCD_ENDPOINT_MAX 6
|
#define TUP_DCD_ENDPOINT_MAX 6
|
||||||
#else
|
#elif defined(STM32L412xx) || defined(STM32L422xx) || defined(STM32L432xx) || defined(STM32L433xx) || \
|
||||||
|
defined(STM32L442xx) || defined(STM32L443xx) || defined(STM32L452xx) || defined(STM32L462xx)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
#else
|
||||||
|
#error "Unsupported STM32L4 mcu"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32WB)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32WB)
|
||||||
|
#define TUP_USBIP_FSDEV
|
||||||
|
#define TUP_USBIP_FSDEV_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_STM32U5)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32U5)
|
||||||
@@ -195,24 +227,32 @@
|
|||||||
#define TUP_USBIP_DWC2_STM32
|
#define TUP_USBIP_DWC2_STM32
|
||||||
#define TUP_DCD_ENDPOINT_MAX 6
|
#define TUP_DCD_ENDPOINT_MAX 6
|
||||||
|
|
||||||
//------------- Sony -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Sony
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 7
|
#define TUP_DCD_ENDPOINT_MAX 7
|
||||||
#define TUP_RHPORT_HIGHSPEED 1
|
#define TUP_RHPORT_HIGHSPEED 1
|
||||||
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
|
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
|
||||||
|
|
||||||
//------------- TI -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// TI
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_MSP430x5xx)
|
#elif TU_CHECK_MCU(OPT_MCU_MSP430x5xx)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129)
|
#elif TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
//------------- ValentyUSB -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// ValentyUSB (Litex)
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_VALENTYUSB_EPTRI)
|
#elif TU_CHECK_MCU(OPT_MCU_VALENTYUSB_EPTRI)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 16
|
#define TUP_DCD_ENDPOINT_MAX 16
|
||||||
|
|
||||||
//------------- Nuvoton -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Nuvoton
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_NUC121, OPT_MCU_NUC126)
|
#elif TU_CHECK_MCU(OPT_MCU_NUC121, OPT_MCU_NUC126)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
@@ -223,47 +263,65 @@
|
|||||||
#define TUP_DCD_ENDPOINT_MAX 12
|
#define TUP_DCD_ENDPOINT_MAX 12
|
||||||
#define TUP_RHPORT_HIGHSPEED 1
|
#define TUP_RHPORT_HIGHSPEED 1
|
||||||
|
|
||||||
//------------- Espressif -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Espressif
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_DCD_ENDPOINT_MAX 6
|
#define TUP_DCD_ENDPOINT_MAX 6
|
||||||
|
|
||||||
//------------- Dialog -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Dialog
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_DA1469X)
|
#elif TU_CHECK_MCU(OPT_MCU_DA1469X)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 4
|
#define TUP_DCD_ENDPOINT_MAX 4
|
||||||
|
|
||||||
//------------- Raspberry Pi -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Raspberry Pi
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
|
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 16
|
#define TUP_DCD_ENDPOINT_MAX 16
|
||||||
|
|
||||||
#define TU_ATTR_FAST_FUNC __attribute__((section(".time_critical.tinyusb")))
|
#define TU_ATTR_FAST_FUNC __attribute__((section(".time_critical.tinyusb")))
|
||||||
|
|
||||||
//------------- Silabs -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Silabs
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG)
|
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_DCD_ENDPOINT_MAX 7
|
#define TUP_DCD_ENDPOINT_MAX 7
|
||||||
|
|
||||||
//------------- Renesas -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Renesas
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
|
#elif TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 10
|
#define TUP_DCD_ENDPOINT_MAX 10
|
||||||
|
|
||||||
//------------- GigaDevice -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// GigaDevice
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
|
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_DCD_ENDPOINT_MAX 4
|
#define TUP_DCD_ENDPOINT_MAX 4
|
||||||
|
|
||||||
//------------- Broadcom -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Broadcom
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
|
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
#define TUP_RHPORT_HIGHSPEED 1
|
#define TUP_RHPORT_HIGHSPEED 1
|
||||||
|
|
||||||
//------------- Broadcom -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Infineon
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
|
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
|
||||||
#define TUP_USBIP_DWC2
|
#define TUP_USBIP_DWC2
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
|
|
||||||
//------------- BridgeTek -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// BridgeTek
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
|
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 8
|
#define TUP_DCD_ENDPOINT_MAX 8
|
||||||
#define TUP_RHPORT_HIGHSPEED 1
|
#define TUP_RHPORT_HIGHSPEED 1
|
||||||
@@ -272,7 +330,9 @@
|
|||||||
#define TUP_DCD_ENDPOINT_MAX 16
|
#define TUP_DCD_ENDPOINT_MAX 16
|
||||||
#define TUP_RHPORT_HIGHSPEED 1
|
#define TUP_RHPORT_HIGHSPEED 1
|
||||||
|
|
||||||
//------------ Allwinner -------------//
|
//--------------------------------------------------------------------+
|
||||||
|
// Allwinner
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
|
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
|
||||||
#define TUP_DCD_ENDPOINT_MAX 4
|
#define TUP_DCD_ENDPOINT_MAX 4
|
||||||
|
|
||||||
|
@@ -101,32 +101,15 @@
|
|||||||
|
|
||||||
#include "tusb_option.h"
|
#include "tusb_option.h"
|
||||||
|
|
||||||
#if defined(STM32F102x6) || defined(STM32F102xB) || \
|
#if CFG_TUD_ENABLED && defined(TUP_USBIP_FSDEV)
|
||||||
defined(STM32F103x6) || defined(STM32F103xB) || \
|
|
||||||
defined(STM32F103xE) || defined(STM32F103xG)
|
|
||||||
#define STM32F1_FSDEV
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(STM32L412xx) || defined(STM32L422xx) || \
|
|
||||||
defined(STM32L432xx) || defined(STM32L433xx) || \
|
|
||||||
defined(STM32L442xx) || defined(STM32L443xx) || \
|
|
||||||
defined(STM32L452xx) || defined(STM32L462xx)
|
|
||||||
#define STM32L4_FSDEV
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_TUD_ENABLED && \
|
|
||||||
( TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F3, OPT_MCU_STM32L0, OPT_MCU_STM32L1, OPT_MCU_STM32G4, OPT_MCU_STM32WB) || \
|
|
||||||
(TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) || \
|
|
||||||
(TU_CHECK_MCU(OPT_MCU_STM32L4) && defined(STM32L4_FSDEV)) \
|
|
||||||
)
|
|
||||||
|
|
||||||
// In order to reduce the dependence on HAL, we undefine this.
|
|
||||||
// Some definitions are copied to our private include file.
|
|
||||||
#undef USE_HAL_DRIVER
|
|
||||||
|
|
||||||
#include "device/dcd.h"
|
#include "device/dcd.h"
|
||||||
#include "portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h"
|
|
||||||
|
|
||||||
|
#ifdef TUP_USBIP_FSDEV_STM32
|
||||||
|
// Undefine to reduce the dependence on HAL
|
||||||
|
#undef USE_HAL_DRIVER
|
||||||
|
#include "portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
* Configuration
|
* Configuration
|
||||||
@@ -153,10 +136,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TU_VERIFY_STATIC((MAX_EP_COUNT) <= STFSDEV_EP_COUNT, "Only 8 endpoints supported on the hardware");
|
TU_VERIFY_STATIC((MAX_EP_COUNT) <= STFSDEV_EP_COUNT, "Only 8 endpoints supported on the hardware");
|
||||||
|
TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) + (DCD_STM32_BTABLE_LENGTH))<=(PMA_LENGTH), "BTABLE does not fit in PMA RAM");
|
||||||
TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) + (DCD_STM32_BTABLE_LENGTH))<=(PMA_LENGTH),
|
|
||||||
"BTABLE does not fit in PMA RAM");
|
|
||||||
|
|
||||||
TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) % 8) == 0, "BTABLE base must be aligned to 8 bytes");
|
TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) % 8) == 0, "BTABLE base must be aligned to 8 bytes");
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@@ -1,12 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
* Copyright(c) 2016 STMicroelectronics
|
||||||
* @file dcd_stm32f0_pvt_st.h
|
* Copyright(c) N Conrad
|
||||||
* @brief DCD utilities from ST code
|
|
||||||
******************************************************************************
|
|
||||||
* @attention
|
|
||||||
*
|
|
||||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
|
||||||
* <h2><center>© parts COPYRIGHT(c) N Conrad</center></h2>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
* are permitted provided that the following conditions are met:
|
* are permitted provided that the following conditions are met:
|
||||||
@@ -30,7 +24,7 @@
|
|||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
**********/
|
*/
|
||||||
|
|
||||||
// This file contains source copied from ST's HAL, and thus should have their copyright statement.
|
// This file contains source copied from ST's HAL, and thus should have their copyright statement.
|
||||||
|
|
||||||
@@ -41,10 +35,7 @@
|
|||||||
#ifndef PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
|
#ifndef PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
|
||||||
#define PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
|
#define PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
|
||||||
|
|
||||||
#if defined(STM32F042x6) || \
|
#if CFG_TUSB_MCU == OPT_MCU_STM32F0
|
||||||
defined(STM32F070x6) || defined(STM32F070xB) || \
|
|
||||||
defined(STM32F072xB) || \
|
|
||||||
defined(STM32F078xx)
|
|
||||||
#include "stm32f0xx.h"
|
#include "stm32f0xx.h"
|
||||||
#define PMA_LENGTH (1024u)
|
#define PMA_LENGTH (1024u)
|
||||||
// F0x2 models are crystal-less
|
// F0x2 models are crystal-less
|
||||||
@@ -52,7 +43,7 @@
|
|||||||
// 070RB: 2 x 16 bits/word memory LPM Support, BCD Support
|
// 070RB: 2 x 16 bits/word memory LPM Support, BCD Support
|
||||||
// PMA dedicated to USB (no sharing with CAN)
|
// PMA dedicated to USB (no sharing with CAN)
|
||||||
|
|
||||||
#elif defined(STM32F1_FSDEV)
|
#elif CFG_TUSB_MCU == OPT_MCU_STM32F1
|
||||||
#include "stm32f1xx.h"
|
#include "stm32f1xx.h"
|
||||||
#define PMA_LENGTH (512u)
|
#define PMA_LENGTH (512u)
|
||||||
// NO internal Pull-ups
|
// NO internal Pull-ups
|
||||||
|
Reference in New Issue
Block a user