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
|
#ifdef MIDI
|
||||||
#include "usb_midi.h"
|
#include "usb_midi.h"
|
||||||
#endif
|
#endif
|
||||||
#include "audio.h"
|
|
||||||
|
#include "xua_audio.h"
|
||||||
|
|
||||||
#ifdef IAP
|
#ifdef IAP
|
||||||
#include "i2c_shared.h"
|
#include "i2c_shared.h"
|
||||||
@@ -44,11 +45,11 @@
|
|||||||
#include "clocking.h"
|
#include "clocking.h"
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#if (NUM_PDM_MICS > 0)
|
||||||
#include "pcm_pdm_mic.h"
|
#include "xua_pdm_mic.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
#include "dsp.h"
|
#include "xua_dsp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[[distributable]]
|
[[distributable]]
|
||||||
@@ -669,10 +670,9 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NUM_PDM_MICS > 0)
|
#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
|
#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 move this to USER_MAIN_CORES or guard with RUN_DSP_TASK
|
||||||
// TODO NUM_DSP_CTRL_INTS
|
// TODO NUM_DSP_CTRL_INTS
|
||||||
on stdcore[AUDIO_IO_TILE] : dsp_process(i_dsp, i_dsp_ctrl, 1);
|
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