forked from PAWPAW-Mirror/lib_xua
Initial changes to allow for xvsm demo
This commit is contained in:
9
module_usb_audio/audio_io/userbuffermanagement.c
Normal file
9
module_usb_audio/audio_io/userbuffermanagement.c
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#include "xccompat.h"
|
||||
|
||||
/* Default implentation for UserBufferManagement() */
|
||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[], unsigned i_dsp) __attribute__ ((weak));
|
||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[], unsigned i_dsp)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
@@ -22,7 +22,8 @@
|
||||
#ifdef MIDI
|
||||
#include "usb_midi.h"
|
||||
#endif
|
||||
#include "audio.h"
|
||||
|
||||
#include "xua_audio.h"
|
||||
|
||||
#ifdef IAP
|
||||
#include "i2c_shared.h"
|
||||
@@ -44,11 +45,11 @@
|
||||
#include "clocking.h"
|
||||
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
#include "pcm_pdm_mic.h"
|
||||
#include "xua_pdm_mic.h"
|
||||
#endif
|
||||
|
||||
#ifdef RUN_DSP_TASK
|
||||
#include "dsp.h"
|
||||
#include "xua_dsp.h"
|
||||
#endif
|
||||
|
||||
[[distributable]]
|
||||
@@ -148,18 +149,18 @@ on tile[AUDIO_IO_TILE] : out port p_pll_clk = PORT_PLL_REF;
|
||||
#endif
|
||||
|
||||
#ifdef MIDI
|
||||
on tile[MIDI_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
||||
on tile[MIDI_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
||||
|
||||
#if(MIDI_RX_PORT_WIDTH == 4)
|
||||
on tile[MIDI_TILE] : buffered in port:4 p_midi_rx = PORT_MIDI_IN;
|
||||
on tile[MIDI_TILE] : buffered in port:4 p_midi_rx = PORT_MIDI_IN;
|
||||
#elif(MIDI_RX_PORT_WIDTH == 1)
|
||||
on tile[MIDI_TILE] : buffered in port:1 p_midi_rx = PORT_MIDI_IN;
|
||||
on tile[MIDI_TILE] : buffered in port:1 p_midi_rx = PORT_MIDI_IN;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Clock blocks */
|
||||
#ifdef MIDI
|
||||
on tile[MIDI_TILE] : clock clk_midi = CLKBLK_MIDI;
|
||||
on tile[MIDI_TILE] : clock clk_midi = CLKBLK_MIDI;
|
||||
#endif
|
||||
|
||||
#if defined(SPDIF_TX) || defined(ADAT_TX)
|
||||
@@ -669,10 +670,9 @@ int main()
|
||||
#endif
|
||||
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
on stdcore[PDM_TILE]: pcm_pdm_mic(c_ds_output);
|
||||
on stdcore[PDM_TILE]: pdm_mic(c_ds_output);
|
||||
on stdcore[PDM_TILE].core[0]: pdm_buffer(c_ds_output, c_pdm_pcm, i_mic_process);
|
||||
#endif
|
||||
on stdcore[PDM_TILE].core[0]: pdm_process(c_ds_output, c_pdm_pcm, i_mic_process);
|
||||
|
||||
// TODO move this to USER_MAIN_CORES or guard with RUN_DSP_TASK
|
||||
// TODO NUM_DSP_CTRL_INTS
|
||||
on stdcore[AUDIO_IO_TILE] : dsp_process(i_dsp, i_dsp_ctrl, 1);
|
||||
|
||||
37
module_usb_audio/pdm_mics/pdm_mic.h
Normal file
37
module_usb_audio/pdm_mics/pdm_mic.h
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
#include "mic_array.h"
|
||||
|
||||
#ifdef MIC_PROCESSING_USE_INTERFACE
|
||||
/* Interface based user processing */
|
||||
typedef interface mic_process_if
|
||||
{
|
||||
void transfer_buffers(mic_array_frame_time_domain * unsafe audio, int output[]);
|
||||
void init();
|
||||
} mic_process_if;
|
||||
|
||||
|
||||
[[combinable]]
|
||||
void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
||||
#ifdef MIC_PROCESSING_USE_INTERFACE
|
||||
, client mic_process_if i_mic_process
|
||||
#endif
|
||||
);
|
||||
|
||||
[[combinable]]
|
||||
void user_pdm_process(server mic_process_if i_mic_data);
|
||||
|
||||
/* PDM interface and decimation cores */
|
||||
void pdm_mic(streaming chanend c_ds_output[2]);
|
||||
|
||||
#else
|
||||
|
||||
/* Simple user hooks/call-backs */
|
||||
unsafe void user_pdm_process(mic_array_frame_time_domain * unsafe audio, int output[]);
|
||||
|
||||
void user_pdm_init();
|
||||
|
||||
/* PDM interface and decimation cores */
|
||||
void pdm_mic(streaming chanend c_ds_output[2]);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user