forked from PAWPAW-Mirror/lib_xua
Added audioports.c - This is a C wrapper for audioports.xc so we can me about with port IDs for DSD mode:
This commit is contained in:
76
module_usb_audio/ports/audioports.c
Normal file
76
module_usb_audio/ports/audioports.c
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
#include <xccompat.h>
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user