From 4a2314ecb393167c6181a49c1fb09c325ccd163b Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 28 May 2013 18:26:55 +0100 Subject: [PATCH] Added audioports.c - This is a C wrapper for audioports.xc so we can me about with port IDs for DSD mode: --- module_usb_audio/ports/audioports.c | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 module_usb_audio/ports/audioports.c diff --git a/module_usb_audio/ports/audioports.c b/module_usb_audio/ports/audioports.c new file mode 100644 index 00000000..2b0667bb --- /dev/null +++ b/module_usb_audio/ports/audioports.c @@ -0,0 +1,76 @@ + +#include +#include "audioports.h" + +//#define p_dsd_left p_i2s_dac[0] +//#define p_dsd_right p_bclk +#define p_dsd_clk p_lrclk +//#d +#if 0 +#ifndef p_dsd_clk +buffered out port:32 p_dsd_clk = P_DSD_CLK; +#endif + +#ifndef p_dsd_left +extern buffered out port:32 p_dsd_left; +#endif + +#ifndef p_dsd_right +extern buffered out port:32 p_dsd_right; +#endif + +#if I2S_WIRES_DAC > 0 +#ifndef p_dsd_dac0 +on tile[0] : buffered out port:32 p_dsd_dac0 = PORT_DSD_DAC0; +#endif +dsdPorts[0] = PORT_DSD_DAC0; +#endif + +#endif + +void ConfigAudioPortsWrapper( +#if (I2S_CHANS_DAC != 0) + port p_i2s_dac[I2S_WIRES_DAC], +#endif + +#if (I2S_CHANS_ADC != 0) + port p_i2s_adc[I2S_WIRES_ADC], +#endif + +#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0) +#ifndef CODEC_MASTER + port p_lrclk, + port p_bclk, +#else + in port p_lrclk, + in port p_bclk, +#endif +#endif +unsigned int divide, unsigned int dsdMode) +{ + + if(dsdMode) + { + + } + else + { + ConfigAudioPorts( +#if (I2S_CHANS_DAC != 0) + p_i2s_dac, +#endif +#if (I2S_CHANS_ADC != 0) + p_i2s_adc, +#endif +#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0) +#ifndef CODEC_MASTER + p_lrclk, + p_bclk, +#else + p_lrclk, + p_bclk, +#endif +#endif + divide); + } +}