File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 5252#define SAMPLE_RATE 16000 // Warning: Only 16kHz supported
5353#define INPUT_OPTION AUDIO_CODEC_MIC_LINE_IN
5454#define OUTPUT_OPTION AUDIO_CODEC_SPEAKER_HP
55+
56+ /*
57+ * The I2S driver is setup to sample both right and left channel from the codec
58+ * however the DMA is only configured to save the samples from the left channel.
59+ * On playback the samples from the left channel will be mirrored to the left
60+ * and right channels.
61+ *
62+ * In summary the sampling is stereo, but the processing and playback is mono.
63+ */
5564#define NUM_CHAN 2
5665
57- /* Configure for a 20ms frame (20ms/16kHz) */
58- #define FRAME_SIZE 320
66+ /*
67+ * Configure for a 10ms frame @ 16kHz sample rate.
68+ * Note that the frame size variable is limited to a max size of 255.
69+ * It is an 8bit field in hardware (AIFDMACFG).
70+ */
71+ #define FRAME_SIZE 160
5972
6073#define I2S_TOTAL_QUEUE_MEM_SZ (I2S_BLOCK_OVERHEAD_IN_BYTES * \
6174 I2SCC26XX_QUEUE_SIZE * \
@@ -228,7 +241,7 @@ void *mainThread(void *arg0)
228241
229242 /* Copy the frame directly to the output buffer */
230243 memcpy (bufferRequest .bufferOut , bufferRequest .bufferIn ,
231- FRAME_SIZE );
244+ FRAME_SIZE * sizeof ( uint16_t ) );
232245 }
233246
234247 /* Release the buffer back to the I2S driver */
You can’t perform that action at this time.
0 commit comments