Move defines and checks to expected places
This commit is contained in:
@@ -121,6 +121,41 @@
|
||||
#define I2S_WIRES_ADC (I2S_CHANS_ADC / I2S_CHANS_PER_FRAME)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Incoming I2S (device to host) channels can be downsampled by a factor of 3.
|
||||
*
|
||||
* Default: 1 i.e. downsampling is disabled.
|
||||
*/
|
||||
#ifndef I2S_DOWNSAMPLE_FACTOR
|
||||
#define I2S_DOWNSAMPLE_FACTOR (1)
|
||||
#else
|
||||
#if (I2S_DOWNSAMPLE_FACTOR != 3)
|
||||
#error Unsupported I2S downsampling configuration
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Only downsample one channel per I2S frame.
|
||||
*
|
||||
* Default: 0 i.e. mono mode is disabled, all channels will be downsampled.
|
||||
*/
|
||||
#ifndef I2S_DOWNSAMPLE_MONO
|
||||
#define I2S_DOWNSAMPLE_MONO (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
#if (I2S_DOWNSAMPLE_MONO == 1)
|
||||
#define I2S_DOWNSAMPLE_CHANS (I2S_CHANS_ADC / 2)
|
||||
#if ((I2S_DOWNSAMPLE_FACTOR > 1) && (I2S_MODE_TDM == 1))
|
||||
#error Mono I2S downsampling is not avaliable in TDM mode
|
||||
#endif
|
||||
#else
|
||||
#define I2S_DOWNSAMPLE_CHANS I2S_CHANS_ADC
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Max supported sample frequency for device (Hz). Default: 192000
|
||||
|
||||
Reference in New Issue
Block a user