adding variable reference freqency support. Currently only 48kHz work

This commit is contained in:
Keith Au
2020-01-16 15:05:41 +08:00
parent 1ef566a570
commit 2f4da7f262
3 changed files with 18 additions and 1 deletions

View File

@@ -233,6 +233,13 @@
#define DEFAULT_AUDOUT_FREQ (48000)
#endif
/**
* @brief Default Reference input sampling frequency
*/
#ifndef DEFAULT_AUDIN_FREQ
#define DEFAULT_AUDIN_FREQ (48000)
#endif
/* Audio Class Defines */
/**

View File

@@ -2599,6 +2599,13 @@ unsigned char cfgDesc_Audio1[] =
NUM_USB_CHAN_OUT_FS, /* nrChannels */
FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES, /* subFrameSize */
FS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS, /* bitResolution */
#ifdef USB_CMD_CFG_SAMP_FREQ
USB_OUT_SAMP_FREQ_NUM,
CHARIFY_SR(USB_OUT_SAMP_FREQ_0),
CHARIFY_SR(USB_OUT_SAMP_FREQ_1),
CHARIFY_SR(USB_OUT_SAMP_FREQ_2),
#else
num_freqs_a1, /* SamFreqType - sample freq count */
@@ -2652,6 +2659,7 @@ unsigned char cfgDesc_Audio1[] =
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
0x00, 0x77, 0x01, /* sampleFreq - 96KHz */
#endif
#endif //USB_CMD_CFG_SAMP_FREQ
/* Standard AS Isochronous Audio Data Endpoint Descriptor 4.6.1.1 */
0x09,

View File

@@ -55,12 +55,14 @@ extern unsigned char mixSel[MAX_MIX_COUNT][MIX_INPUTS];
#ifdef USB_CMD_CFG_SAMP_FREQ
extern unsigned int g_curAudOut_SamFreq;
extern unsigned int g_curAudIn_SamFreq;
#endif
/* Global var for current frequency, set to default freq */
#ifdef USB_CMD_CFG_SAMP_FREQ
#define g_curUSBin_SamFreq g_curAudOut_SamFreq
unsigned int g_curUSBout_SamFreq = DEFAULT_FREQ;
#define g_curUSBout_SamFreq g_curAudIn_SamFreq
unsigned int g_curSamFreq = DEFAULT_FREQ; // should no longer be used
#else
unsigned int g_curUSBin_SamFreq = DEFAULT_FREQ;