forked from PAWPAW-Mirror/lib_xua
Output functional in simple app. Issue at high volume. Still uses sc_i2c.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#ifndef __XUA_H__
|
||||
#define __XUA_H__
|
||||
|
||||
#include "xua_audio.h"
|
||||
#include "xua_audiohub.h"
|
||||
|
||||
#include "xua_endpoint0.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __audio_h__
|
||||
#define __audio_h__
|
||||
#ifndef __XUA_AUDIOHUB_H__
|
||||
#define __XUA_AUDIOHUB_H__
|
||||
|
||||
#if __XC__
|
||||
|
||||
@@ -31,15 +31,14 @@ typedef interface audManage_if
|
||||
* \param c_config An optional channel that will be passed on to the
|
||||
* CODEC configuration functions.
|
||||
*/
|
||||
void XUA_AudioHub(chanend ?c_in,
|
||||
void XUA_AudioHub(chanend ?c_in
|
||||
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
|
||||
chanend c_spdif_tx,
|
||||
#endif
|
||||
#if(defined(SPDIF_RX) || defined(ADAT_RX))
|
||||
chanend c_dig,
|
||||
#endif
|
||||
chanend ?c_config, chanend ?c_adc
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
||||
, server interface i_dfu ?dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -50,6 +49,15 @@ void XUA_AudioHub(chanend ?c_in,
|
||||
|
||||
void SpdifTxWrapper(chanend c_spdif_tx);
|
||||
|
||||
/* These functions must be implemented for the CODEC/ADC/DAC arrangement of a specific design */
|
||||
|
||||
/* Any required clocking and CODEC initialisation - run once at start up */
|
||||
void AudioHwInit();
|
||||
|
||||
/* Configure audio hardware (clocking, CODECs etc) for a specific mClk/Sample frquency - run on every sample frequency change */
|
||||
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
|
||||
unsigned sampRes_DAC, unsigned sampRes_ADC);
|
||||
|
||||
#endif // __XC__
|
||||
|
||||
#endif // __audio_h__
|
||||
#endif // __XUA_AUDIOHUB_H__
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _USERBUFFERMANAGEMENT_H_
|
||||
#define _USERBUFFERMANAGEMENT_H_
|
||||
|
||||
#include "xua_audio.h"
|
||||
#include "xua_audiohub.h"
|
||||
#include <xccompat.h>
|
||||
|
||||
void UserBufferManagementInit(CLIENT_INTERFACE(audManage_if, i_audMan));
|
||||
@@ -15,9 +15,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "devicedefines.h"
|
||||
#include "xua_audiohub.h"
|
||||
|
||||
#include "userbuffermanagement.h"
|
||||
#include "xua_audio.h"
|
||||
#include "audioports.h"
|
||||
#include "audiohw.h"
|
||||
#include "mic_array_conf.h"
|
||||
@@ -1107,15 +1107,14 @@ static void dummy_deliver(chanend ?c_out, unsigned &command)
|
||||
}
|
||||
}
|
||||
|
||||
void XUA_AudioHub(chanend ?c_mix_out,
|
||||
void XUA_AudioHub(chanend ?c_mix_out
|
||||
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
|
||||
chanend c_spdif_out,
|
||||
#endif
|
||||
#if (defined(ADAT_RX) || defined(SPDIF_RX))
|
||||
chanend c_dig_rx,
|
||||
#endif
|
||||
chanend ?c_config, chanend ?c
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
||||
, server interface i_dfu ?dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -1169,7 +1168,7 @@ chanend ?c_config, chanend ?c
|
||||
#endif
|
||||
|
||||
/* Perform required CODEC/ADC/DAC initialisation */
|
||||
AudioHwInit(c_config);
|
||||
AudioHwInit();
|
||||
|
||||
while(1)
|
||||
{
|
||||
@@ -1281,7 +1280,7 @@ chanend ?c_config, chanend ?c
|
||||
}
|
||||
#endif
|
||||
/* Configure Clocking/CODEC/DAC/ADC for SampleFreq/MClk */
|
||||
AudioHwConfig(curFreq, mClk, c_config, dsdMode, curSamRes_DAC, curSamRes_ADC);
|
||||
AudioHwConfig(curFreq, mClk, dsdMode, curSamRes_DAC, curSamRes_ADC);
|
||||
}
|
||||
|
||||
if(!firstRun)
|
||||
@@ -1,13 +1,4 @@
|
||||
#ifndef _CODEC_H_
|
||||
#define _CODEC_H_
|
||||
|
||||
/* These functions must be implemented for the CODEC/ADC/DAC arrangement of a specific design */
|
||||
|
||||
/* Any required clocking and CODEC initialisation - run once at start up */
|
||||
void AudioHwInit(chanend ?c_codec);
|
||||
|
||||
/* Configure audio hardware (clocking, CODECs etc) for a specific mClk/Sample frquency - run on every sample frequency change */
|
||||
void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned dsdMode,
|
||||
unsigned sampRes_DAC, unsigned sampRes_ADC);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -419,7 +419,6 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc,
|
||||
#ifdef MIXER
|
||||
chanend c_mix_ctl,
|
||||
#endif
|
||||
chanend ?c_aud_cfg,
|
||||
streaming chanend ?c_spdif_rx,
|
||||
chanend ?c_adat_rx,
|
||||
chanend ?c_clk_ctl,
|
||||
@@ -467,7 +466,6 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc,
|
||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||
c_dig_rx,
|
||||
#endif
|
||||
c_aud_cfg, c_adc
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, dfuInterface
|
||||
#endif
|
||||
@@ -528,12 +526,6 @@ int main()
|
||||
chan c_mix_ctl;
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_CFG_CHAN
|
||||
chan c_aud_cfg;
|
||||
#else
|
||||
#define c_aud_cfg null
|
||||
#endif
|
||||
|
||||
#ifdef SPDIF_RX
|
||||
streaming chan c_spdif_rx;
|
||||
#else
|
||||
@@ -618,7 +610,7 @@ int main()
|
||||
#ifdef MIXER
|
||||
, c_mix_ctl
|
||||
#endif
|
||||
,c_aud_cfg, c_spdif_rx, c_adat_rx, c_clk_ctl, c_clk_int
|
||||
, c_spdif_rx, c_adat_rx, c_clk_ctl, c_clk_int
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, dfuInterface
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user