forked from PAWPAW-Mirror/lib_xua
NUM_PDM_MICS -> XUA_NUM_PDM_MICS
This commit is contained in:
@@ -8,9 +8,10 @@ lib_xua Change Log
|
|||||||
* ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit)
|
* ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit)
|
||||||
* CHANGE: I2S hardware resources no longer used globally and must be passed
|
* CHANGE: I2S hardware resources no longer used globally and must be passed
|
||||||
to XUA_AudioHub()
|
to XUA_AudioHub()
|
||||||
* CHANGE: NO_USB define renamed to XUA_USB_EN
|
|
||||||
* CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task
|
* CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task
|
||||||
* CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
|
* CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
|
||||||
|
* CHANGE: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS
|
||||||
|
* CHANGE: Define NO_USB renamed to XUA_USB_EN
|
||||||
|
|
||||||
0.1.2
|
0.1.2
|
||||||
-----
|
-----
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#define EXCLUDE_USB_AUDIO_MAIN
|
#define EXCLUDE_USB_AUDIO_MAIN
|
||||||
|
|
||||||
#define NUM_PDM_MICS 8
|
#define XUA_NUM_PDM_MICS 8
|
||||||
#define VENDOR_STR "XMOS"
|
#define VENDOR_STR "XMOS"
|
||||||
#define VENDOR_ID 0x20B1
|
#define VENDOR_ID 0x20B1
|
||||||
#define PRODUCT_STR_A2 "XUA PDM Example"
|
#define PRODUCT_STR_A2 "XUA PDM Example"
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void XUA_AudioHub(chanend ?c_aud,
|
|||||||
#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
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
, chanend c_pdm_in
|
, chanend c_pdm_in
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -278,15 +278,15 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Number of PDM microphones in the design. Default: None
|
* @brief Number of PDM microphones in the design. Default: None
|
||||||
*/
|
*/
|
||||||
#ifndef NUM_PDM_MICS
|
#ifndef XUA_NUM_PDM_MICS
|
||||||
#define NUM_PDM_MICS (0)
|
#define XUA_NUM_PDM_MICS (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief PDM Microphone first channel index, defines which channels microphones will be input on.
|
* @brief PDM Microphone first channel index, defines which channels microphones will be input on.
|
||||||
* Note, indexed from 0.
|
* Note, indexed from 0.
|
||||||
*
|
*
|
||||||
* Default: 0 (i.e. channels [0:NUM_PDM_MICS-1])
|
* Default: 0 (i.e. channels [0:XUA_NUM_PDM_MICS-1])
|
||||||
* */
|
* */
|
||||||
#ifndef PDM_MIC_INDEX
|
#ifndef PDM_MIC_INDEX
|
||||||
#define PDM_MIC_INDEX (0)
|
#define PDM_MIC_INDEX (0)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
#include "xua_pdm_mic.h"
|
#include "xua_pdm_mic.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
static unsigned samplesOut[MAX(NUM_USB_CHAN_OUT, I2S_CHANS_DAC)];
|
static unsigned samplesOut[MAX(NUM_USB_CHAN_OUT, I2S_CHANS_DAC)];
|
||||||
|
|
||||||
/* Two buffers for ADC data to allow for DAC and ADC I2S ports being offset */
|
/* Two buffers for ADC data to allow for DAC and ADC I2S ports being offset */
|
||||||
#define IN_CHAN_COUNT (I2S_CHANS_ADC + NUM_PDM_MICS + (8*ADAT_RX) + (2*SPDIF_RX))
|
#define IN_CHAN_COUNT (I2S_CHANS_ADC + XUA_NUM_PDM_MICS + (8*ADAT_RX) + (2*SPDIF_RX))
|
||||||
|
|
||||||
static unsigned samplesIn[2][MAX(NUM_USB_CHAN_IN, IN_CHAN_COUNT)];
|
static unsigned samplesIn[2][MAX(NUM_USB_CHAN_IN, IN_CHAN_COUNT)];
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
#if( (SPDIF_RX==1) || (ADAT_RX == 1))
|
#if( (SPDIF_RX==1) || (ADAT_RX == 1))
|
||||||
, chanend c_dig_rx
|
, chanend c_dig_rx
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
, chanend c_pdm_pcm
|
, chanend c_pdm_pcm
|
||||||
#endif
|
#endif
|
||||||
, buffered _XUA_CLK_DIR port:32 ?p_lrclk,
|
, buffered _XUA_CLK_DIR port:32 ?p_lrclk,
|
||||||
@@ -254,7 +254,7 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned audioToUsbRatioCounter = 0;
|
unsigned audioToUsbRatioCounter = 0;
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
unsigned audioToMicsRatioCounter = 0;
|
unsigned audioToMicsRatioCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -276,18 +276,18 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
#endif /* (AUD_TO_USB_RATIO > 1) */
|
#endif /* (AUD_TO_USB_RATIO > 1) */
|
||||||
|
|
||||||
|
|
||||||
#if ((DEBUG_MIC_ARRAY == 1) && (NUM_PDM_MICS > 0))
|
#if ((DEBUG_MIC_ARRAY == 1) && (XUA_NUM_PDM_MICS > 0))
|
||||||
/* Get initial samples from PDM->PCM converter to avoid stalling the decimators */
|
/* Get initial samples from PDM->PCM converter to avoid stalling the decimators */
|
||||||
c_pdm_pcm <: 1;
|
c_pdm_pcm <: 1;
|
||||||
master
|
master
|
||||||
{
|
{
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
for(int i = PDM_MIC_INDEX; i < (NUM_PDM_MICS + PDM_MIC_INDEX); i++)
|
for(int i = PDM_MIC_INDEX; i < (XUA_NUM_PDM_MICS + PDM_MIC_INDEX); i++)
|
||||||
{
|
{
|
||||||
c_pdm_pcm :> samplesIn[readBuffNo][i];
|
c_pdm_pcm :> samplesIn[readBuffNo][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ((DEBUG_MIC_ARRAY == 1) && (NUM_PDM_MICS > 0))
|
#endif // ((DEBUG_MIC_ARRAY == 1) && (XUA_NUM_PDM_MICS > 0))
|
||||||
|
|
||||||
UserBufferManagementInit();
|
UserBufferManagementInit();
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
outuint(c_spd_out, sample); /* Forward sample to S/PDIF Tx thread */
|
outuint(c_spd_out, sample); /* Forward sample to S/PDIF Tx thread */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
if ((AUD_TO_MICS_RATIO - 1) == audioToMicsRatioCounter)
|
if ((AUD_TO_MICS_RATIO - 1) == audioToMicsRatioCounter)
|
||||||
{
|
{
|
||||||
/* Get samples from PDM->PCM converter */
|
/* Get samples from PDM->PCM converter */
|
||||||
@@ -456,7 +456,7 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
master
|
master
|
||||||
{
|
{
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
for(int i = PDM_MIC_INDEX; i < (NUM_PDM_MICS + PDM_MIC_INDEX); i++)
|
for(int i = PDM_MIC_INDEX; i < (XUA_NUM_PDM_MICS + PDM_MIC_INDEX); i++)
|
||||||
{
|
{
|
||||||
c_pdm_pcm :> samplesIn[readBuffNo][i];
|
c_pdm_pcm :> samplesIn[readBuffNo][i];
|
||||||
}
|
}
|
||||||
@@ -672,7 +672,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
|
|||||||
#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
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
, chanend c_pdm_in
|
, chanend c_pdm_in
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@@ -873,7 +873,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
|
|||||||
outuint(c_spdif_out, mClk);
|
outuint(c_spdif_out, mClk);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
/* Send decimation factor to PDM task(s) */
|
/* Send decimation factor to PDM task(s) */
|
||||||
c_pdm_in <: curSamFreq / AUD_TO_MICS_RATIO;
|
c_pdm_in <: curSamFreq / AUD_TO_MICS_RATIO;
|
||||||
#endif
|
#endif
|
||||||
@@ -906,7 +906,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
|
|||||||
#if (ADAT_RX == 1) || (SPDIF_RX == 1)
|
#if (ADAT_RX == 1) || (SPDIF_RX == 1)
|
||||||
, c_dig_rx
|
, c_dig_rx
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
, c_pdm_in
|
, c_pdm_in
|
||||||
#endif
|
#endif
|
||||||
, p_lrclk, p_bclk, p_i2s_dac, p_i2s_adc);
|
, p_lrclk, p_bclk, p_i2s_dac, p_i2s_adc);
|
||||||
@@ -959,7 +959,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
|
|||||||
|
|
||||||
#endif /* XUA_USB_EN */
|
#endif /* XUA_USB_EN */
|
||||||
|
|
||||||
#if NUM_PDM_MICS > 0
|
#if XUA_NUM_PDM_MICS > 0
|
||||||
c_pdm_in <: 0;
|
c_pdm_in <: 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
#include "clocking.h"
|
#include "clocking.h"
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
#include "xua_pdm_mic.h"
|
#include "xua_pdm_mic.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ on tile[MIDI_TILE] : buffered in port:1 p_midi_rx = PORT_MIDI_IN;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*** Clock blocks ***/
|
/*** Clock blocks ***/
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
clock clk_pdm = on tile[PDM_TILE]: XS1_CLKBLK_1;
|
clock clk_pdm = on tile[PDM_TILE]: XS1_CLKBLK_1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ on tile[SPDIF_TX_TILE] : clock clk_mst_spd = CLKBLK_SPDIF_TX;
|
|||||||
on tile[XUD_TILE] : clock clk_spd_rx = CLKBLK_SPDIF_RX;
|
on tile[XUD_TILE] : clock clk_spd_rx = CLKBLK_SPDIF_RX;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
in port p_pdm_clk = PORT_PDM_CLK;
|
in port p_pdm_clk = PORT_PDM_CLK;
|
||||||
|
|
||||||
in buffered port:32 p_pdm_mics = PORT_PDM_DATA;
|
in buffered port:32 p_pdm_mics = PORT_PDM_DATA;
|
||||||
@@ -458,7 +458,7 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc,
|
|||||||
#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
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
#if (PDM_TILE == AUDIO_IO_TILE)
|
#if (PDM_TILE == AUDIO_IO_TILE)
|
||||||
, streaming chanend c_ds_output[2]
|
, streaming chanend c_ds_output[2]
|
||||||
#endif
|
#endif
|
||||||
@@ -476,7 +476,7 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc,
|
|||||||
#define c_dig_rx null
|
#define c_dig_rx null
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE)
|
#if (XUA_NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE)
|
||||||
/* Configure clocks ports - sharing mclk port with I2S */
|
/* Configure clocks ports - sharing mclk port with I2S */
|
||||||
xua_pdm_mic_config(p_mclk_in);
|
xua_pdm_mic_config(p_mclk_in);
|
||||||
#endif
|
#endif
|
||||||
@@ -523,13 +523,13 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc,
|
|||||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
||||||
, dfuInterface
|
, dfuInterface
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
, c_pdm_pcm
|
, c_pdm_pcm
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE)
|
#if (XUA_NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE)
|
||||||
xua_pdm_mic(c_ds_output);
|
xua_pdm_mic(c_ds_output);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -613,7 +613,7 @@ int main()
|
|||||||
#define dfuInterface null
|
#define dfuInterface null
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
chan c_pdm_pcm;
|
chan c_pdm_pcm;
|
||||||
streaming chan c_ds_output[2];
|
streaming chan c_ds_output[2];
|
||||||
#ifdef MIC_PROCESSING_USE_INTERFACE
|
#ifdef MIC_PROCESSING_USE_INTERFACE
|
||||||
@@ -671,7 +671,7 @@ int main()
|
|||||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
|
||||||
, dfuInterface
|
, dfuInterface
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
#if (PDM_TILE == AUDIO_IO_TILE)
|
#if (PDM_TILE == AUDIO_IO_TILE)
|
||||||
, c_ds_output[2]
|
, c_ds_output[2]
|
||||||
#endif
|
#endif
|
||||||
@@ -749,7 +749,7 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PDM_RECORD
|
#ifndef PDM_RECORD
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
#if (PDM_TILE != AUDIO_IO_TILE)
|
#if (PDM_TILE != AUDIO_IO_TILE)
|
||||||
/* PDM Mics running on a separate to AudioHub */
|
/* PDM Mics running on a separate to AudioHub */
|
||||||
on stdcore[PDM_TILE]:
|
on stdcore[PDM_TILE]:
|
||||||
@@ -764,7 +764,7 @@ int main()
|
|||||||
#else
|
#else
|
||||||
on stdcore[PDM_TILE].core[0]: xua_pdm_buffer(c_ds_output, c_pdm_pcm);
|
on stdcore[PDM_TILE].core[0]: xua_pdm_buffer(c_ds_output, c_pdm_pcm);
|
||||||
#endif /*MIC_PROCESSING_USE_INTERFACE*/
|
#endif /*MIC_PROCESSING_USE_INTERFACE*/
|
||||||
#endif /*NUM_PDM_MICS > 0*/
|
#endif /*XUA_NUM_PDM_MICS > 0*/
|
||||||
#endif /*PDM_RECORD*/
|
#endif /*PDM_RECORD*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MIC_ARRAY_NUM_MICS
|
#ifndef MIC_ARRAY_NUM_MICS
|
||||||
#define MIC_ARRAY_NUM_MICS (NUM_PDM_MICS)
|
#define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MIC_ARRAY_CONF_H_ */
|
#endif /* MIC_ARRAY_CONF_H_ */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "xua.h"
|
#include "xua.h"
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (XUA_NUM_PDM_MICS > 0)
|
||||||
|
|
||||||
/* This file includes an example integration of lib_array_mic into USB Audio */
|
/* This file includes an example integration of lib_array_mic into USB Audio */
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
|
|||||||
{
|
{
|
||||||
unsigned buffer;
|
unsigned buffer;
|
||||||
unsigned samplerate;
|
unsigned samplerate;
|
||||||
int output[MIC_BUFFER_DEPTH][NUM_PDM_MICS];
|
int output[MIC_BUFFER_DEPTH][XUA_NUM_PDM_MICS];
|
||||||
|
|
||||||
#ifdef MIC_PROCESSING_USE_INTERFACE
|
#ifdef MIC_PROCESSING_USE_INTERFACE
|
||||||
i_mic_process.init();
|
i_mic_process.init();
|
||||||
@@ -55,7 +55,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
|
|||||||
user_pdm_init();
|
user_pdm_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NUM_PDM_MICS > 4
|
#if XUA_NUM_PDM_MICS > 4
|
||||||
unsigned decimatorCount = 2;
|
unsigned decimatorCount = 2;
|
||||||
#else
|
#else
|
||||||
unsigned decimatorCount = 1;
|
unsigned decimatorCount = 1;
|
||||||
@@ -152,7 +152,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
|
|||||||
{
|
{
|
||||||
/* We store an additional buffer so we can reply immediately */
|
/* We store an additional buffer so we can reply immediately */
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
for(int i = 0; i < NUM_PDM_MICS; i++)
|
for(int i = 0; i < XUA_NUM_PDM_MICS; i++)
|
||||||
{
|
{
|
||||||
c_audio <: output[micBufferRead][i];
|
c_audio <: output[micBufferRead][i];
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
|
|||||||
#endif
|
#endif
|
||||||
/* Buffer up next mic data */
|
/* Buffer up next mic data */
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
for(int i = 0; i < NUM_PDM_MICS; i++)
|
for(int i = 0; i < XUA_NUM_PDM_MICS; i++)
|
||||||
{
|
{
|
||||||
output[micBufferWrite][i] = current->data[i][0];
|
output[micBufferWrite][i] = current->data[i][0];
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
|
|||||||
user_pdm_process(current);
|
user_pdm_process(current);
|
||||||
#endif
|
#endif
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
for(int i = 0; i < NUM_PDM_MICS; i++)
|
for(int i = 0; i < XUA_NUM_PDM_MICS; i++)
|
||||||
{
|
{
|
||||||
output[micBufferWrite][i] = current->data[i][0];
|
output[micBufferWrite][i] = current->data[i][0];
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,7 @@ void xua_pdm_mic_config(in port p_pdm_mclk)
|
|||||||
void xua_pdm_mic(streaming chanend c_ds_output[2])
|
void xua_pdm_mic(streaming chanend c_ds_output[2])
|
||||||
{
|
{
|
||||||
streaming chan c_4x_pdm_mic_0;
|
streaming chan c_4x_pdm_mic_0;
|
||||||
#if (NUM_PDM_MICS > 4)
|
#if (XUA_NUM_PDM_MICS > 4)
|
||||||
streaming chan c_4x_pdm_mic_1;
|
streaming chan c_4x_pdm_mic_1;
|
||||||
#else
|
#else
|
||||||
#define c_4x_pdm_mic_1 null
|
#define c_4x_pdm_mic_1 null
|
||||||
@@ -251,7 +251,7 @@ void xua_pdm_mic(streaming chanend c_ds_output[2])
|
|||||||
{
|
{
|
||||||
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
|
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
|
||||||
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
|
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
|
||||||
#if (NUM_PDM_MICS > 4)
|
#if (XUA_NUM_PDM_MICS > 4)
|
||||||
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
|
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "xua.h"
|
#include "xua.h"
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0) && !defined(MIC_PROCESSING_USE_INTERFACE)
|
#if (XUA_NUM_PDM_MICS > 0) && !defined(MIC_PROCESSING_USE_INTERFACE)
|
||||||
|
|
||||||
#include "mic_array_frame.h"
|
#include "mic_array_frame.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user