增加所有文件

This commit is contained in:
2025-11-07 09:57:14 +08:00
parent b598c1d479
commit 97bc808489
9392 changed files with 3483224 additions and 21 deletions

View File

@@ -0,0 +1,225 @@
/*
*********************************************************************************************************
* uC/USB-Device
* The Embedded USB Device Stack
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* USB AUDIO DEVICE CONFIGURATION FILE
*
* Filename : usbd_audio_dev_cfg.c
* Version : V4.06.01
*********************************************************************************************************
* Note(s) : (1) This audio configuration file allows to build the following topologies:
*
* (a) Speaker
*
* IT (USB OUT) ---------------> FU ---------------> OT (speaker)
*
* (b) Microphone
*
* OT (USB IN) <--------------- FU <--------------- IT (microphone)
*
* (a) Headset
*
* IT (USB OUT) ---------------> FU ---------------> OT (speaker)
* OT (USB IN) <--------------- FU <--------------- IT (microphone)
*********************************************************************************************************
*/
#include <usbd_audio_dev_cfg.h>
/*
*********************************************************************************************************
* USB AUDIO DEVICE CONFIGURATION
*
* Note(s) : (1) Type I format type descriptor reports the sampling frequency capabilities of the
* isochronous data endpoint with the field 'bSamFreqType'. The possible values are:
*
* (a) USBD_AUDIO_FMT_TYPE_I_SAM_FREQ_CONTINUOUS Continuous sampling frequency
*
* (b) 1..255 number of discrete sampling frequencies
* supported by the isochronous data endpoint.
*
* (2) These fields relates to 'bLockDelayUnits' and 'wLockDelay' fields of Class-Specific AS
* Isochronous Audio Data Endpoint Descriptor. 'bLockDelayUnits' and 'wLockDelay' indicate
* to the Host how long it takes for the clock recovery circuitry of this endpoint to lock
* and reliably produce or consume the audio data stream. Only applicable for synchronous
* and adaptive endpoints.
* See 'USB Device Class Definition for Audio Devices, Release 1.0, March 18, 1998',
* section 4.6.1.2 for more details about class-specific endpoint descriptor.
*
* (3) Feedback endpoint refresh rate represents the exponent of power of 2 ms. The value must
* be between 1 (2 ms) and 9 (512 ms).
*********************************************************************************************************
*/
#define COUNT_OF(a) (sizeof(a)/sizeof((a)[0u]))
CPU_INT08U Mic_IT_ID;
CPU_INT08U Mic_OT_USB_IN_ID;
CPU_INT08U Mic_FU_ID;
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_ENABLED)
CPU_INT08U Speaker_IT_USB_OUT_ID;
CPU_INT08U Speaker_OT_ID;
CPU_INT08U Speaker_FU_ID;
#endif
/* --------------- INPUT TERMINAL CFG ----------------- */
const USBD_AUDIO_IT_CFG USBD_IT_MIC_Cfg = { /* MICROPHONE. */
USBD_AUDIO_TERMINAL_TYPE_MIC,
USBD_AUDIO_MONO, /* Nbr of log output ch in Terminal Output. */
USBD_AUDIO_SPATIAL_LOCATION_LEFT_FRONT, /* Spatial location of log ch. */
DEF_DISABLED, /* Dis or En Copy Protection. */
USBD_AUDIO_CPL_NONE, /* Copy Protection Level. */
"IT Microphone" /* Str describing IT. Obtained by Str Desc. */
};
const USBD_AUDIO_IT_CFG USBD_IT_USB_OUT_Cfg = { /* USB STREAMING OUT. */
USBD_AUDIO_TERMINAL_TYPE_USB_STREAMING,
USBD_AUDIO_MONO, /* Nbr of log output ch in Terminal Output. */
USBD_AUDIO_SPATIAL_LOCATION_LEFT_FRONT, /* Spatial location of log ch. */
DEF_DISABLED, /* Dis or En Copy Protection. */
USBD_AUDIO_CPL_NONE, /* Copy Protection Level. */
"IT USB OUT" /* Str describing IT. Obtained by Str Desc. */
};
/* -------------- OUTPUT TERMINAL CFG ----------------- */
const USBD_AUDIO_OT_CFG USBD_OT_USB_IN_Cfg = {
USBD_AUDIO_TERMINAL_TYPE_USB_STREAMING,
DEF_DISABLED, /* Dis or En Copy Protection. */
"OT USB IN" /* Str describing OT. Obtained by Str Desc. */
};
const USBD_AUDIO_OT_CFG USBD_OT_SPEAKER_Cfg = {
USBD_AUDIO_TERMINAL_TYPE_SPEAKER,
DEF_DISABLED, /* Dis or En Copy Protection. */
"OT Speaker" /* Str describing OT. Obtained by Str Desc. */
};
/* ---------------- FEATURE UNIT CFG ------------------ */
CPU_INT16U FU_LogChCtrlTbl[] = {
(USBD_AUDIO_FU_CTRL_MUTE | USBD_AUDIO_FU_CTRL_VOL), /* Master ch. */
USBD_AUDIO_FU_CTRL_NONE, /* Log ch #1. */
USBD_AUDIO_FU_CTRL_NONE /* Log ch #2. */
};
const USBD_AUDIO_FU_CFG USBD_FU_SPEAKER_Cfg = {
USBD_AUDIO_MONO, /* Nbr of log ch. */
&FU_LogChCtrlTbl[0u], /* Ptr to Feature Unit Controls tbl. */
"FU Speaker" /* Str describing FU. Obtained by Str Desc. */
};
const USBD_AUDIO_FU_CFG USBD_FU_MIC_Cfg = {
USBD_AUDIO_MONO, /* Nbr of log ch. */
&FU_LogChCtrlTbl[0u], /* Ptr to Feature Unit Controls tbl. */
"FU Microphone" /* Str describing FU. Obtained by Str Desc. */
};
/* -------------- AUDIO STREAMING IF CFG -------------- */
const USBD_AUDIO_STREAM_CFG USBD_MicStreamCfg = {
USBD_AUDIO_DEV_CFG_RECORD_NBR_BUF,
USBD_AUDIO_DEV_CFG_RECORD_CORR_PERIOD,
USBD_AUDIO_DEV_CFG_RECORD_EXTRA_PCK
};
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_ENABLED)
const USBD_AUDIO_STREAM_CFG USBD_SpeakerStreamCfg = {
USBD_AUDIO_DEV_CFG_PLAYBACK_NBR_BUF,
USBD_AUDIO_DEV_CFG_PLAYBACK_CORR_PERIOD,
USBD_AUDIO_DEV_CFG_PLAYBACK_EXTRA_PCK
};
#endif
CPU_INT32U AS_SamFreqTbl[] = {
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_DISABLED)
USBD_AUDIO_FMT_TYPE_I_SAMFREQ_44_1KHZ,
#endif
USBD_AUDIO_FMT_TYPE_I_SAMFREQ_48KHZ
};
const USBD_AUDIO_AS_ALT_CFG USBD_AS_IF1_Alt1_SpeakerCfg = {
/* AS IF RELATED: */
1u, /* Delay introduced by the data path. */
USBD_AUDIO_DATA_FMT_TYPE_I_PCM, /* Audio data fmt used to comm with this IF. */
USBD_AUDIO_MONO, /* Nbr of physical ch in the audio data stream. */
USBD_AUDIO_FMT_TYPE_I_SUBFRAME_SIZE_2, /* Nbr of bytes occupied by one audio subframe. */
USBD_AUDIO_FMT_TYPE_I_BIT_RESOLUTION_16, /* Effectively used bits in an audio subframe. */
COUNT_OF(AS_SamFreqTbl), /* Nbr of sampling frequencies (see Note #1). */
0u, /* Lower bound in Hz of the sampling freq range. */
0u, /* Upper bound in Hz of the sampling freq range. */
&AS_SamFreqTbl[0u], /* Tbl of discrete sampling frequencies. */
/* ENDPOINT CONFIG: */
DEF_NO, /* Direction OUT */
USBD_EP_TYPE_SYNC_ADAPTIVE, /* Synchronization type supported by Isoc EP. */
/* CLASS SPECIFIC EP RELATED: */
USBD_AUDIO_AS_EP_CTRL_SAMPLING_FREQ, /* Class specific controls supported by Isoc EP. */
USBD_AUDIO_AS_EP_LOCK_DLY_UND, /* See Note #2. */
0u, /* See Note #2. */
/* SYNCH EP RELATED: */
0u, /* Refresh Rate (see Note #3). */
};
const USBD_AUDIO_AS_ALT_CFG USBD_AS_IF2_Alt1_MicCfg = {
/* AS IF RELATED: */
1u, /* Delay introduced by the data path. */
USBD_AUDIO_DATA_FMT_TYPE_I_PCM, /* Audio data fmt used to comm with this IF. */
/* TYPE I FMT RELATED: */
USBD_AUDIO_MONO, /* Nbr of physical ch in the audio data stream. */
USBD_AUDIO_FMT_TYPE_I_SUBFRAME_SIZE_2, /* Nbr of bytes occupied by one audio subframe. */
USBD_AUDIO_FMT_TYPE_I_BIT_RESOLUTION_16, /* Effectively used bits in an audio subframe. */
COUNT_OF(AS_SamFreqTbl), /* Nbr of sampling frequencies (see Note #1). */
0u, /* Lower bound in Hz of the sampling freq range. */
0u, /* Upper bound in Hz of the sampling freq range. */
&AS_SamFreqTbl[0u], /* Tbl of discrete sampling frequencies. */
/* ENDPOINT CONFIG: */
DEF_YES, /* Direction IN */
USBD_EP_TYPE_SYNC_ASYNC, /* Synchronization type supported by Isoc EP. */
/* CLASS SPECIFIC EP RELATED: */
USBD_AUDIO_AS_EP_CTRL_SAMPLING_FREQ, /* Class specific controls supported by Isoc EP. */
USBD_AUDIO_AS_EP_LOCK_DLY_UND, /* See Note #2. */
0u, /* See Note #2. */
/* SYNCH EP RELATED: */
0u, /* Refresh Rate (see Note #3). */
};
USBD_AUDIO_AS_ALT_CFG *USBD_AS_IF1_Alt_SpeakerCfgTbl[] = {
&USBD_AS_IF1_Alt1_SpeakerCfg,
};
USBD_AUDIO_AS_ALT_CFG *USBD_AS_IF2_Alt_MicCfgTbl[] = {
&USBD_AS_IF2_Alt1_MicCfg,
};
USBD_AUDIO_AS_IF_CFG USBD_AS_IF1_SpeakerCfg = {
&USBD_AS_IF1_Alt_SpeakerCfgTbl[0u],
COUNT_OF(USBD_AS_IF1_Alt_SpeakerCfgTbl),
};
USBD_AUDIO_AS_IF_CFG USBD_AS_IF2_MicCfg = {
&USBD_AS_IF2_Alt_MicCfgTbl[0u],
COUNT_OF(USBD_AS_IF2_Alt_MicCfgTbl),
};
USBD_AUDIO_AS_IF_CFG *USBD_AS_IF_Cfg_Tbl[] = {
&USBD_AS_IF1_SpeakerCfg,
&USBD_AS_IF2_MicCfg,
};
CPU_INT08U USBD_AS_IF_Cfg_Nbr = COUNT_OF(USBD_AS_IF_Cfg_Tbl);

View File

@@ -0,0 +1,114 @@
/*
*********************************************************************************************************
* uC/USB-Device
* The Embedded USB Device Stack
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* USB AUDIO DEVICE CONFIGURATION FILE
*
* Filename : usbd_audio_dev_cfg.h
* Version : V4.06.01
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*********************************************************************************************************
* MODULE
*********************************************************************************************************
*********************************************************************************************************
*/
#ifndef USBD_AUDIO_DEV_CFG_MODULE_PRESENT /* See Note #1. */
#define USBD_AUDIO_DEV_CFG_MODULE_PRESENT
/*
*********************************************************************************************************
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*********************************************************************************************************
*/
#include <Class/Audio/usbd_audio.h>
#include "app_usbd.h"
/*
*********************************************************************************************************
*********************************************************************************************************
* DEFINES
*********************************************************************************************************
*********************************************************************************************************
*/
#define USBD_AUDIO_DEV_CFG_RECORD_CORR_PERIOD 16u /* Record correction period in ms. */
#define USBD_AUDIO_DEV_CFG_RECORD_EXTRA_PCK 0u
#define USBD_AUDIO_DEV_CFG_RECORD_NBR_BUF USBD_AUDIO_STREAM_NBR_BUF_18
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_ENABLED)
#define USBD_AUDIO_DEV_CFG_PLAYBACK_CORR_PERIOD 16u /* Playback correction period in ms. */
#define USBD_AUDIO_DEV_CFG_PLAYBACK_EXTRA_PCK 0u
#define USBD_AUDIO_DEV_CFG_NBR_ENTITY 6u /* Nbr of entities (units/terminals) used by audio fnct.*/
#define USBD_AUDIO_DEV_CFG_PLAYBACK_NBR_BUF USBD_AUDIO_STREAM_NBR_BUF_18
#else
#define USBD_AUDIO_DEV_CFG_NBR_ENTITY 3u /* Nbr of entities (units/terminals) used by audio fnct.*/
#endif
/*
*********************************************************************************************************
* USB AUDIO FUNCTION TOPOLOGY 1 CONFIGURATION
*********************************************************************************************************
*/
/* -------------- TERMINAL AND UNIT IDS --------------- */
extern CPU_INT08U Mic_IT_ID;
extern CPU_INT08U Mic_OT_USB_IN_ID;
extern CPU_INT08U Mic_FU_ID;
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_ENABLED)
extern CPU_INT08U Speaker_IT_USB_OUT_ID;
extern CPU_INT08U Speaker_OT_ID;
extern CPU_INT08U Speaker_FU_ID;
#endif
/* ----------- TERMINAL, UNIT AND AS IF CFG ----------- */
extern const USBD_AUDIO_IT_CFG USBD_IT_MIC_Cfg;
extern const USBD_AUDIO_OT_CFG USBD_OT_USB_IN_Cfg;
extern const USBD_AUDIO_FU_CFG USBD_FU_MIC_Cfg;
extern const USBD_AUDIO_STREAM_CFG USBD_MicStreamCfg;
extern const USBD_AUDIO_AS_IF_CFG USBD_AS_IF2_MicCfg;
#if (APP_CFG_USBD_AUDIO_SIMULATION_LOOP_EN == DEF_ENABLED)
extern const USBD_AUDIO_IT_CFG USBD_IT_USB_OUT_Cfg;
extern const USBD_AUDIO_OT_CFG USBD_OT_SPEAKER_Cfg;
extern const USBD_AUDIO_FU_CFG USBD_FU_SPEAKER_Cfg;
extern const USBD_AUDIO_STREAM_CFG USBD_SpeakerStreamCfg;
extern const USBD_AUDIO_AS_IF_CFG USBD_AS_IF1_SpeakerCfg;
#endif
/*
*********************************************************************************************************
*********************************************************************************************************
* MODULE END
*********************************************************************************************************
*********************************************************************************************************
*/
#endif

View File

@@ -0,0 +1,484 @@
/*
*********************************************************************************************************
* uC/USB-Device
* The Embedded USB Device Stack
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* USB DEVICE CONFIGURATION FILE
*
* TEMPLATE
*
* Filename : usbd_cfg.h
* Version : V4.06.01
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MODULE
*
* Note(s) : (1) This USB configuration header file is protected from multiple pre-processor inclusion
* through use of the USB configuration module present pre-processor macro definition.
*********************************************************************************************************
*/
#ifndef USBD_CFG_MODULE_PRESENT /* See Note #1. */
#define USBD_CFG_MODULE_PRESENT
/*
*********************************************************************************************************
* USB DEVICE GENERIC CONFIGURATION
*********************************************************************************************************
*/
/* uC/USB-Device Code Optimization. */
#define USBD_CFG_OPTIMIZE_SPD DEF_ENABLED
/* DEF_ENABLED Optimizes uC/USBD for speed performance.*/
/* DEF_DISABLED Optimizes uC/USBD for memory footprint. */
/* Maximum Number of Devices. */
#define USBD_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Buffer Alignment in uC/USB-Device. */
#define USBD_CFG_BUF_ALIGN_OCTETS 4u
/* Must be between 1u and 2^(CPU_CFG_DATA_SIZE * 8). */
/*
*********************************************************************************************************
* USB DEVICE ARGUMENT CHECK CONFIGURATION
*
* Note(s) : (1) Configure USBD_ERR_CFG_ARG_CHK_EXT_EN to enable or disable argument checks.
*
* (a) When DEF_ENABLED, ALL arguments received from any API provided by the developer
* or application are checked/validated.
* (b) When DEF_DISABLED, NO arguments received from any API provided by the developer
* or application are checked/validated.
*********************************************************************************************************
*/
/* Argument Check Feature. */
#define USBD_CFG_ERR_ARG_CHK_EXT_EN DEF_ENABLED
/* See Note #1. */
/*
*********************************************************************************************************
* USB DEVICE MICROSOFT OS DESCRIPTOR CONFIGURATION
*
* Note(s) : (1) Configure USBD_CFG_MS_OS_DESC_EN to enable or disable Microsoft OS descriptor.
*
* (a) When DEF_ENABLED, Microsoft descriptors and MS OS string descriptor are enabled.
* (b) When DEF_DISABLED, Microsoft descriptors and MS OS string descriptor are disabled.
*********************************************************************************************************
*/
/* Microsoft Descriptor Support. */
#define USBD_CFG_MS_OS_DESC_EN DEF_DISABLED
/* See Note #1. */
/*
*********************************************************************************************************
* USB DEVICE CONFIGURATIONS
*
* Note(s) : (1) This configuration should be set to DEF_ENABLED if the USB device controller supports
* high-speed, or to DEF_DISABLED if otherwise.
*********************************************************************************************************
*/
/* Maximum Number of Configurations. */
#define USBD_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Configure Isochronous Support in uC/USB-Device. */
#define USBD_CFG_EP_ISOC_EN DEF_DISABLED
/* DEF_ENABLED Isochronous enpoints are available. */
/* DEF_DISABLED Isochronous enpoints are not available. */
/* Configure High-Speed Support in uC/USB-Device. */
#define USBD_CFG_HS_EN DEF_ENABLED
/* See Note #1. */
/* Timeout for Data/Status Phases of Control Transfer. */
#define USBD_CFG_CTRL_REQ_TIMEOUT_mS 5000u
/* Must be between 1u and 65535u. */
/*
*********************************************************************************************************
* USB DEVICE INTERFACES CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of Interfaces. */
#define USBD_CFG_MAX_NBR_IF 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Alternate Interfaces. */
#define USBD_CFG_MAX_NBR_IF_ALT 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Interface Groups. */
#define USBD_CFG_MAX_NBR_IF_GRP 1u
/* Must be between 0u and 255u. */
/* Maximum Number of Endpoint Descriptors. */
#define USBD_CFG_MAX_NBR_EP_DESC 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Opened Endpoints. */
#define USBD_CFG_MAX_NBR_EP_OPEN 4u
/* Must be between 2u and 255u. */
/* Maximum Number of Additional URBs. */
/* These URBs are used for async queueing. */
#define USBD_CFG_MAX_NBR_URB_EXTRA 0u
/* Must be between 0u and 255u. */
/*
*********************************************************************************************************
* USB DEVICE STRING CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of String Descriptors. */
#define USBD_CFG_MAX_NBR_STR 10u
/* Must be between 0u and 255u. */
/*
*********************************************************************************************************
* USB DEVICE DEBUG CONFIGURATION
*********************************************************************************************************
*/
/* Debug Module Trace Support. */
#define USBD_CFG_DBG_TRACE_EN DEF_DISABLED
/* DEF_ENABLED Trace debug module is available. */
/* DEF_DISABLED Trace debug module is not available. */
/* Maximum Number of Trace Events. */
#define USBD_CFG_DBG_TRACE_NBR_EVENTS 10u
/* Must be between 1u and 255u. */
/* Debug Module Built-In Statistics Support. */
#define USBD_CFG_DBG_STATS_EN DEF_DISABLED
/* DEF_ENABLED Built-in statistics are available. */
/* DEF_DISABLED Built-in statistics are not available. */
/* Debug Module Built-In Statistics Counter Data Type. */
#define USBD_CFG_DBG_STATS_CNT_TYPE CPU_INT08U
/* CPU_INT08U, CPU_INT16U or CPU_INT32U. */
/*
*********************************************************************************************************
* AUDIO CLASS CONFIGURATION
*
* Note(s) : (1) Among all class-specific requests supported by Audio 1.0 class, Graphic Equalizer control
* of the Feature Unit use the longest payload size for the SET_CUR request.
* See 'USB Device Class Definition for Audio Devices, Release 1.0, March 18, 1998',
* Table 5-27 for more details.
*
* (2) Audio buffers allocated for each AudioStreaming interface requires to be aligned
* properly according to DMA requirement. Most of the time, a DMA is used to transfer
* audio data between the codec and the USB stack in order to offload the CPU.
*********************************************************************************************************
*/
/* Audio Playback Support. */
#define USBD_AUDIO_CFG_PLAYBACK_EN DEF_ENABLED
/* DEF_ENABLED Enable audio playback capabilities. */
/* DEF_DISABLED Disable audio playback capabilities. */
/* Audio Record Support. */
#define USBD_AUDIO_CFG_RECORD_EN DEF_ENABLED
/* DEF_ENABLED Enable audio record capabilities. */
/* DEF_DISABLED Disable audio record capabilities. */
/* Feature Unit with all or Minimum of Controls. */
#define USBD_AUDIO_CFG_FU_MAX_CTRL DEF_DISABLED
/* DEF_ENABLED FU with all ctrls. */
/* DEF_DISABLED FU with only mute & vol ctrls. */
/* Maximum Number of Audio Class Instances. */
#define USBD_AUDIO_CFG_MAX_NBR_AIC 1u
/* Must be between 1u and 254u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_AUDIO_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 254u. */
/* Maximum Number of Input Terminals. */
#define USBD_AUDIO_CFG_MAX_NBR_IT 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Output Terminals. */
#define USBD_AUDIO_CFG_MAX_NBR_OT 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Feature Units. */
#define USBD_AUDIO_CFG_MAX_NBR_FU 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Mixer Units. */
#define USBD_AUDIO_CFG_MAX_NBR_MU 0u
/* Must be between 1u and 255u. */
/* Maximum Number of Selector Units. */
#define USBD_AUDIO_CFG_MAX_NBR_SU 0u
/* Must be between 1u and 255u. */
/* Maximum Number of Playback AudioStreaming Interfaces */
/* per Class Instance. */
#define USBD_AUDIO_CFG_MAX_NBR_AS_IF_PLAYBACK 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Record AudioStreaming Interfaces */
/* per Class Instance. */
#define USBD_AUDIO_CFG_MAX_NBR_AS_IF_RECORD 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Operational Alternate Interfaces */
/* per Class Instance. */
#define USBD_AUDIO_CFG_MAX_NBR_IF_ALT 2u
/* Must be between 1u and 255u. */
/* Maximum Class Specific Payload Length. */
#define USBD_AUDIO_CFG_CLASS_REQ_MAX_LEN 4u
/* Must be between 1u and 34u (see Note #1). */
/* Audio Buffer Alignment Requirement. */
#define USBD_AUDIO_CFG_BUF_ALIGN_OCTETS USBD_CFG_BUF_ALIGN_OCTETS
/* See Note #2. */
/* Playback Feedback Support. */
#define USBD_AUDIO_CFG_PLAYBACK_FEEDBACK_EN DEF_DISABLED
/* DEF_ENABLED Enable playback feedback. */
/* DEF_DISABLED Disable playback feedback. */
/* Playback Stream Correction Support. */
#define USBD_AUDIO_CFG_PLAYBACK_CORR_EN DEF_DISABLED
/* DEF_ENABLED Enable playback stream correction. */
/* DEF_DISABLED Disable playback stream correction. */
/* Record Stream Correction Support. */
#define USBD_AUDIO_CFG_RECORD_CORR_EN DEF_DISABLED
/* DEF_ENABLED Enable record stream correction. */
/* DEF_DISABLED Disable record stream correction. */
/* Audio Statistics Support. */
#define USBD_AUDIO_CFG_STAT_EN DEF_DISABLED
/* DEF_ENABLED Enable audio class statistics. */
/* DEF_DISABLED Disable audio class statistics. */
/*
*********************************************************************************************************
* COMMUNICATION DEVICE CLASS (CDC) CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of CDC Class Instances. */
#define USBD_CDC_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_CDC_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Maximum Number of CDC Data Interfaces. */
#define USBD_CDC_CFG_MAX_NBR_DATA_IF 1u
/* Must be between 1u and 255u. */
/*
*********************************************************************************************************
* CDC ABSTRACT CONTROL MODEL (ACM) SERIAL CLASS CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of ACM Sub-Class Instances. */
#define USBD_ACM_SERIAL_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/*
*********************************************************************************************************
* CDC ETHERNET EMULATION MODEL (EEM) CLASS CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of Class Instances */
#define USBD_CDC_EEM_CFG_MAX_NBR_DEV 1u
/* Maximum Number of Configurations per Class Instance */
#define USBD_CDC_EEM_CFG_MAX_NBR_CFG 2u
/* Length of receive buffer(s). */
#define USBD_CDC_EEM_CFG_RX_BUF_LEN 1520u
/* Length of buffer used for echo response command. */
#define USBD_CDC_EEM_CFG_ECHO_BUF_LEN 64u
/*
*********************************************************************************************************
* HID CLASS CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of HID Class Instances. */
#define USBD_HID_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_HID_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Report ID. */
#define USBD_HID_CFG_MAX_NBR_REPORT_ID 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Push/Pop Items. */
#define USBD_HID_CFG_MAX_NBR_REPORT_PUSHPOP 0u
/* Must be between 0u and 255u. */
/*
*********************************************************************************************************
* MASS STORAGE CLASS (MSC) CONFIGURATION
*
* Note(s) : (1) USBD_MSC_CFG_MICRIUM_FS is used to enable the Mass Storage Class interface with the
* various storage media supported by uC/FS such as SD-Card, NAND, etc.
*
* DEF_ENABLED Use the uC/FS' MSC class interface.
* DEF_DISABLED Use uC/USB-Device's own RAMDisk implementation without a File System.
*
* (2) USBD_MSC_CFG_FS_REFRESH_TASK_EN is only used when MSC class interfaces with uC/FS. It
* should be DEF_ENABLED when using a removable media such as SD card. Fixed media such as
* RAMDisk, NAND should have this constant set to DEF_DISABLED.
*
* DEF_ENABLED Create FS Refresh task for polling media status.
* DEF_DISABLED Do not create FS Refresh task.
*
* (3) USBD_RAMDISK_CFG_BASE_ADDR is used to define the data area of the RAM disk. If it is
* defined with a value other than 0, the RAM disk data area will be set from this base
* address directly. Conversely, if it is equal to 0, the RAM disk data area will be
* represented as a table from the program's data area.
*********************************************************************************************************
*/
/* Maximum Number of MSC Class Instances. */
#define USBD_MSC_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_MSC_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Logical Units. */
#define USBD_MSC_CFG_MAX_LUN 1u
/* Must be between 1u and 255u. */
/* Data Buffer Length, in octets. */
#define USBD_MSC_CFG_DATA_LEN 2048u
/* Must be between 1u and DEF_INT_32U_MAX_VAL. */
/* Use uC/FS MSC class interface. */
#define USBD_MSC_CFG_MICRIUM_FS DEF_DISABLED
/* See Note #1. */
/* Removable Device Refresh Task. */
#define USBD_MSC_CFG_FS_REFRESH_TASK_EN DEF_DISABLED
/* See Note #2. */
/* Removable Device Refresh Task Polling Delay. */
#define USBD_MSC_CFG_DEV_POLL_DLY_mS 100u
/* Must be between 1u and DEF_INT_32U_MAX_VAL. */
/* Number of RAMDisk units. */
#define USBD_RAMDISK_CFG_NBR_UNITS 1u
/* Must be at least 1. */
/* RAMDisk block size. */
#define USBD_RAMDISK_CFG_BLK_SIZE 512u
/* Must be at least 1. */
/* RAMDisk number of blocks. */
#define USBD_RAMDISK_CFG_NBR_BLKS 44u
/* Must be at least 1. */
/* RAMDisk base address in memory. */
#define USBD_RAMDISK_CFG_BASE_ADDR 0u
/* See Note #3. */
/*
*********************************************************************************************************
* PERSONAL HEALTHCARE DEVICE CLASS (PHDC) CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of PHDC Class Instances. */
#define USBD_PHDC_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_PHDC_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Opaque Data Buffer Length. */
#define USBD_PHDC_CFG_DATA_OPAQUE_MAX_LEN 43u
/* Must be between 1u and 255u. */
/* QoS Scheduler. */
#define USBD_PHDC_OS_CFG_SCHED_EN DEF_ENABLED
/* DEF_ENABLED Enable QoS scheduler. */
/* DEF_DISABLED Disable QoS scheduler. */
/*
*********************************************************************************************************
* VENDOR CLASS CONFIGURATION
*********************************************************************************************************
*/
/* Maximum Number of Vendor Class Instances. */
#define USBD_VENDOR_CFG_MAX_NBR_DEV 1u
/* Must be between 1u and 255u. */
/* Maximum Number of Configurations per Class Instance. */
#define USBD_VENDOR_CFG_MAX_NBR_CFG 2u
/* Must be between 1u and 255u. */
/* Maximum Number of Microsoft Extended Properties. */
#define USBD_VENDOR_CFG_MAX_NBR_MS_EXT_PROPERTY 1u
/* Must be between 1u and 255u. */
/*
*********************************************************************************************************
* MODULE END
*********************************************************************************************************
*/
#endif

View File

@@ -0,0 +1,65 @@
/*
*********************************************************************************************************
* uC/USB-Device
* The Embedded USB Device Stack
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* USB DEVICE CONFIGURATION FILE
*
* TEMPLATE
*
* Filename : usbd_dev_cfg.c
* Version : V4.06.01
*********************************************************************************************************
*/
#include <Source/usbd_core.h>
#include <usbd_dev_cfg.h>
#include <bsp_usbd_template.h>
/*
*********************************************************************************************************
* USB DEVICE CONFIGURATION
*********************************************************************************************************
*/
const USBD_DEV_CFG USBD_DevCfg_Template = {
0xFFFE, /* Vendor ID. */
0x1234, /* Product ID. */
0x0100, /* Device release number. */
"MICRIUM MANUFACTURER", /* Manufacturer string. */
"MICRIUM PRODUCT", /* Product string. */
"1234567890ABCDEF", /* Serial number string. */
USBD_LANG_ID_ENGLISH_US /* String language ID. */
};
/*
*********************************************************************************************************
* USB DEVICE DRIVER CONFIGURATION
*********************************************************************************************************
*/
const USBD_DRV_CFG USBD_DrvCfg_Template = {
0x00000000, /* Base addr of device controller hw registers. */
0x00000000, /* Base addr of device controller dedicated mem. */
0u, /* Size of device controller dedicated mem. */
USBD_DEV_SPD_FULL, /* Speed of device controller. */
USBD_DrvEP_InfoTbl_Template /* EP Info tbl of device controller. */
};

View File

@@ -0,0 +1,67 @@
/*
*********************************************************************************************************
* uC/USB-Device
* The Embedded USB Device Stack
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* USB DEVICE CONFIGURATION FILE
*
* TEMPLATE
*
* Filename : usbd_dev_cfg.h
* Version : V4.06.01
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MODULE
*
* Note(s) : (1) This USB device configuration header file is protected from multiple pre-processor
* inclusion through use of the USB device configuration module present pre-processor
* macro definition.
*********************************************************************************************************
*/
#ifndef USBD_DEV_CFG_MODULE_PRESENT /* See Note #1. */
#define USBD_DEV_CFG_MODULE_PRESENT
/*
*********************************************************************************************************
* USB DEVICE CONFIGURATION
*********************************************************************************************************
*/
extern const USBD_DEV_CFG USBD_DevCfg_Template;
/*
*********************************************************************************************************
* USB DEVICE DRIVER CONFIGURATION
*********************************************************************************************************
*/
extern const USBD_DRV_CFG USBD_DrvCfg_Template;
/*
*********************************************************************************************************
* MODULE END
*********************************************************************************************************
*/
#endif