Add USB_TO_AUD_RATIO and MICS_TO_AUD_RATIO defaults

This commit is contained in:
Sam Chesney
2017-02-13 08:08:15 +00:00
parent fcf28537bb
commit e70b572551
2 changed files with 20 additions and 14 deletions

View File

@@ -4,8 +4,9 @@ sc_usb_audio Change Log
7.1.0 7.1.0
----- -----
- ADDED: UserBufferManagementInit() to reset any state required in UserBufferManagement() - ADDED: UserBufferManagementInit() to reset any state required in UserBufferManagement()
- ADDED: I2S output up-sampling (I2S_UPSAMPLE_FACTOR_OUT) - ADDED: I2S output up-sampling (enabled when USB_TO_AUD_RATIO is > 1)
- CHANGE: Rename I2S input down-sampling (I2S_DOWNSAMPLE_FACTOR to I2S_DOWNSAMPLE_FACTOR_IN) - ADDED: PDM Mic decimator output rate can now be controlled independently (via MICS_TO_AUD_RATIO)
- CHANGE: Rename I2S input down-sampling (enabled when USB_TO_AUD_RATIO is > 1, rather than via I2S_DOWNSAMPLE_FACTOR)
- RESOLVED: Crosstalk between input channels when I2S input down-sampling is enabled - RESOLVED: Crosstalk between input channels when I2S input down-sampling is enabled
7.0.1 7.0.1

View File

@@ -122,28 +122,31 @@
#endif #endif
/** /**
* @brief Incoming I2S (device to host) channels can be downsampled by a factor of 3. * @brief Ratio of the USB Audio sample rate to the I2S sample rate. Up and
* down-sampling will be enabled as necessary when the rates differ.
* *
* Default: 1 i.e. downsampling is disabled. * Default: 1 i.e. USB Audio and I2S are running at the same sample rate.
*/ */
#ifndef I2S_DOWNSAMPLE_FACTOR_IN #ifndef USB_TO_AUD_RATIO
#define I2S_DOWNSAMPLE_FACTOR_IN (1) #define USB_TO_AUD_RATIO (1)
#else #else
#if (I2S_DOWNSAMPLE_FACTOR_IN != 3) && (I2S_DOWNSAMPLE_FACTOR_IN != 1) #if (USB_TO_AUD_RATIO != 3) && (USB_TO_AUD_RATIO != 1)
#error Unsupported I2S input downsampling configuration #error Unsupported USB Audio to I2S sample rate ratio
#endif #endif
#endif #endif
/** /**
* @brief Outgoing I2S (host to device) channels can be upsampled by a factor of 3. * @brief Ratio of the PDM microphone decimator sample rate to the I2S sample
* rate. Up and down-sampling will be enabled as necessary when the rates
* differ.
* *
* Default: 1 i.e. upsampling is disabled. * Default: 1 i.e. PDM microphone decimator and I2S are running at the sample rate.
*/ */
#ifndef I2S_UPSAMPLE_FACTOR_OUT #ifndef MICS_TO_AUD_RATIO
#define I2S_UPSAMPLE_FACTOR_OUT (1) #define MICS_TO_AUD_RATIO (1)
#else #else
#if (I2S_UPSAMPLE_FACTOR_OUT != 3) && (I2S_UPSAMPLE_FACTOR_OUT != 1) #if (MICS_TO_AUD_RATIO != 3) && (MICS_TO_AUD_RATIO != 1)
#error Unsupported I2S output upsampling configuration #error Unsupported PDM microphone decimator to I2S sample rate ratio
#endif #endif
#endif #endif
@@ -151,6 +154,7 @@
* @brief Only downsample one channel per input I2S frame. * @brief Only downsample one channel per input I2S frame.
* *
* Default: 0 i.e. mono mode is disabled, all input channels will be downsampled. * Default: 0 i.e. mono mode is disabled, all input channels will be downsampled.
* TODO: Remove this define or reintroduce support in audio_io.xc
*/ */
#ifndef I2S_DOWNSAMPLE_MONO_IN #ifndef I2S_DOWNSAMPLE_MONO_IN
#define I2S_DOWNSAMPLE_MONO_IN (0) #define I2S_DOWNSAMPLE_MONO_IN (0)
@@ -160,6 +164,7 @@
* @brief Number of incoming (device to host) I2S channels to downsample. * @brief Number of incoming (device to host) I2S channels to downsample.
* *
* Default: The number of I2S incoming channels, or half this if mono downsampling is enabled. * Default: The number of I2S incoming channels, or half this if mono downsampling is enabled.
* TODO: Remove this define or reintroduce support in audio_io.xc
*/ */
#if (I2S_DOWNSAMPLE_MONO_IN == 1) #if (I2S_DOWNSAMPLE_MONO_IN == 1)
#define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2) #define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2)