forked from PAWPAW-Mirror/lib_xua
i_audMan now nullable
This commit is contained in:
@@ -49,9 +49,6 @@ int main()
|
|||||||
/* Channel for communcating control messages from EP0 to the rest of the device (via the buffering cores */
|
/* Channel for communcating control messages from EP0 to the rest of the device (via the buffering cores */
|
||||||
chan c_aud_ctl;
|
chan c_aud_ctl;
|
||||||
|
|
||||||
/* TODO handle this */
|
|
||||||
interface audManage_if i_audMan;
|
|
||||||
|
|
||||||
par
|
par
|
||||||
{
|
{
|
||||||
/* Low level USB device layer core */
|
/* Low level USB device layer core */
|
||||||
@@ -70,7 +67,7 @@ int main()
|
|||||||
on tile[1]: XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
|
on tile[1]: XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
|
||||||
|
|
||||||
/* IOHub core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
|
/* IOHub core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
|
||||||
on tile[0]: XUA_AudioHub(c_aud, i_audMan);
|
on tile[0]: XUA_AudioHub(c_aud, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -24,19 +24,19 @@ typedef interface audManage_if
|
|||||||
* This function drives I2S ports and handles samples to/from other digital
|
* This function drives I2S ports and handles samples to/from other digital
|
||||||
* I/O threads.
|
* I/O threads.
|
||||||
*
|
*
|
||||||
* \param c_in Audio sample channel connected to the mixer() thread or the
|
* \param c_aud Audio sample channel connected to the mixer() thread or the
|
||||||
* decouple() thread
|
* decouple() thread
|
||||||
* \param c_dig channel connected to the clockGen() thread for
|
* \param c_dig channel connected to the clockGen() thread for
|
||||||
* receiving/transmitting samples
|
* receiving/transmitting samples
|
||||||
* \param c_config An optional channel that will be passed on to the
|
* \param c_config An optional channel that will be passed on to the
|
||||||
* CODEC configuration functions.
|
* CODEC configuration functions.
|
||||||
*/
|
*/
|
||||||
void XUA_AudioHub(chanend ?c_in
|
void XUA_AudioHub(chanend ?c_aud
|
||||||
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
|
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
|
||||||
chanend c_spdif_tx,
|
, chanend c_spdif_tx
|
||||||
#endif
|
#endif
|
||||||
#if(defined(SPDIF_RX) || defined(ADAT_RX))
|
#if(defined(SPDIF_RX) || defined(ADAT_RX))
|
||||||
chanend c_dig,
|
, chanend c_dig
|
||||||
#endif
|
#endif
|
||||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
||||||
, server interface i_dfu ?dfuInterface
|
, server interface i_dfu ?dfuInterface
|
||||||
@@ -44,7 +44,7 @@ void XUA_AudioHub(chanend ?c_in
|
|||||||
#if (NUM_PDM_MICS > 0)
|
#if (NUM_PDM_MICS > 0)
|
||||||
, chanend c_pdm_in
|
, chanend c_pdm_in
|
||||||
#endif
|
#endif
|
||||||
, client audManage_if i_audMan
|
, client audManage_if ?i_audMan
|
||||||
);
|
);
|
||||||
|
|
||||||
void SpdifTxWrapper(chanend c_spdif_tx);
|
void SpdifTxWrapper(chanend c_spdif_tx);
|
||||||
@@ -52,9 +52,11 @@ void SpdifTxWrapper(chanend c_spdif_tx);
|
|||||||
/* These functions must be implemented for the CODEC/ADC/DAC arrangement of a specific design */
|
/* 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 */
|
/* Any required clocking and CODEC initialisation - run once at start up */
|
||||||
|
/* TODO Provide default implementation of this */
|
||||||
void AudioHwInit();
|
void AudioHwInit();
|
||||||
|
|
||||||
/* Configure audio hardware (clocking, CODECs etc) for a specific mClk/Sample frquency - run on every sample frequency change */
|
/* Configure audio hardware (clocking, CODECs etc) for a specific mClk/Sample frquency - run on every sample frequency change */
|
||||||
|
/* TODO Provide default implementation of this */
|
||||||
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
|
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
|
||||||
unsigned sampRes_DAC, unsigned sampRes_ADC);
|
unsigned sampRes_DAC, unsigned sampRes_ADC);
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp
|
|||||||
|
|
||||||
#ifndef NO_USB
|
#ifndef NO_USB
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
|
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if ?i_audMan)
|
||||||
{
|
{
|
||||||
outuint(c_out, underflowWord);
|
outuint(c_out, underflowWord);
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, con
|
|||||||
|
|
||||||
#else /* NO_USB */
|
#else /* NO_USB */
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
static inline unsigned DoSampleTransfer(chanend ?c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
|
static inline unsigned DoSampleTransfer(chanend ?c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if ?i_audMan)
|
||||||
{
|
{
|
||||||
UserBufferManagement(samplesOut, samplesIn[readBuffNo], i_audMan);
|
UserBufferManagement(samplesOut, samplesIn[readBuffNo], i_audMan);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -502,7 +502,9 @@ unsigned static deliver(chanend ?c_out, chanend ?c_spd_out,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned audioToUsbRatioCounter = 0;
|
unsigned audioToUsbRatioCounter = 0;
|
||||||
|
#if (NUM_PDM_MICS > 0)
|
||||||
unsigned audioToMicsRatioCounter = 0;
|
unsigned audioToMicsRatioCounter = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (AUD_TO_USB_RATIO > 1)
|
#if (AUD_TO_USB_RATIO > 1)
|
||||||
union i2sInDs3
|
union i2sInDs3
|
||||||
@@ -1120,7 +1122,7 @@ chanend c_dig_rx,
|
|||||||
#if (NUM_PDM_MICS > 0)
|
#if (NUM_PDM_MICS > 0)
|
||||||
, chanend c_pdm_in
|
, chanend c_pdm_in
|
||||||
#endif
|
#endif
|
||||||
, client audManage_if i_audMan
|
, client audManage_if ?i_audMan
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if defined (SPDIF_TX) && (SPDIF_TX_TILE == AUDIO_IO_TILE)
|
#if defined (SPDIF_TX) && (SPDIF_TX_TILE == AUDIO_IO_TILE)
|
||||||
|
|||||||
Reference in New Issue
Block a user