forked from PAWPAW-Mirror/lib_xua
Move function prototypes to headers
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
#include "mic_array.h"
|
||||
#include "XUA_Buffer_lite.h"
|
||||
#include "xua_ep0_wrapper.h"
|
||||
#include "pdm_mic.h"
|
||||
#include "audio_config.h"
|
||||
#include "audio_hub.h"
|
||||
|
||||
#define DEBUG_UNIT XUA_APP
|
||||
#define DEBUG_PRINT_ENABLE_XUA_APP 1
|
||||
@@ -58,13 +61,6 @@ on tile[0]: clock pdmclk6 = XS1_CLKBLK_5;
|
||||
XUD_EpType epTypeTableOut[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO};
|
||||
XUD_EpType epTypeTableIn[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO, XUD_EPTYPE_ISO};
|
||||
|
||||
[[distributable]]
|
||||
void AudioHub(server i2s_frame_callback_if i2s, streaming chanend c_audio, streaming chanend (&?c_ds_output)[1]);
|
||||
void setup_audio_gpio(out port p_gpio);
|
||||
void AudioHwConfigure(unsigned samFreq, client i2c_master_if i_i2c);
|
||||
void pdm_mic(streaming chanend c_ds_output, in buffered port:32 p_pdm_mics);
|
||||
void mic_array_setup_ddr_xcore(clock pdmclk, clock pdmclk6, out port p_pdm_clk, buffered in port:32 p_pdm_data, int divide);
|
||||
|
||||
void burn_normal_priority(void){
|
||||
while(1);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
void AudioHwConfigure(unsigned samFreq, client i2c_master_if i_i2c);
|
||||
void pll_nudge(int nudge);
|
||||
|
||||
void setup_audio_gpio(out port p_gpio);
|
||||
|
||||
#endif
|
||||
@@ -50,8 +50,6 @@
|
||||
// TLV320DAC3101 easy register access defines
|
||||
#define DAC3101_REGWRITE(reg, val) {i_i2c.write_reg(DAC3101_I2C_DEVICE_ADDR, reg, val);}
|
||||
|
||||
|
||||
|
||||
static void set_node_pll_reg(tileref tile_ref, unsigned reg_val){
|
||||
write_sswitch_reg(get_tile_id(tile_ref), XS1_SSWITCH_PLL_CTL_NUM, reg_val);
|
||||
}
|
||||
@@ -89,6 +87,14 @@ void pll_nudge(int nudge) {
|
||||
//if(nudge != old_nudge && nudge){debug_printf("nudge: %d\n", nudge); }old_nudge = nudge;
|
||||
}
|
||||
|
||||
void setup_audio_gpio(out port p_gpio){
|
||||
// Reset DAC and disable MUTE
|
||||
p_gpio <: 0x0;
|
||||
delay_milliseconds(1);
|
||||
p_gpio <: 0x1;
|
||||
delay_milliseconds(1);
|
||||
}
|
||||
|
||||
void AudioHwConfigure(unsigned samFreq, client i2c_master_if i_i2c)
|
||||
{
|
||||
|
||||
4
examples/xua_lite_example/src/audio_hub.h
Normal file
4
examples/xua_lite_example/src/audio_hub.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "i2s.h"
|
||||
|
||||
[[distributable]]
|
||||
void AudioHub(server i2s_frame_callback_if i2s, streaming chanend c_audio, streaming chanend (&?c_ds_output)[1]);
|
||||
@@ -5,20 +5,8 @@
|
||||
#define DEBUG_PRINT_ENABLE_XUA_AUDIO_HUB 1
|
||||
#include "debug_print.h"
|
||||
#include "mic_array.h"
|
||||
#include "AudioConfig.h"
|
||||
|
||||
|
||||
void mic_array_decimator_set_samprate(const unsigned samplerate, int mic_decimator_fir_data_array[], mic_array_decimator_conf_common_t *dcc, mic_array_decimator_config_t dc[]);
|
||||
|
||||
|
||||
void setup_audio_gpio(out port p_gpio){
|
||||
// Reset DAC and disable MUTE
|
||||
p_gpio <: 0x0;
|
||||
delay_milliseconds(1);
|
||||
p_gpio <: 0x1;
|
||||
delay_milliseconds(1);
|
||||
}
|
||||
|
||||
#include "audio_config.h"
|
||||
#include "pdm_mic.h"
|
||||
|
||||
//Globally declared for 64b alignment
|
||||
int mic_decimator_fir_data_array[8][THIRD_STAGE_COEFS_PER_STAGE * PDM_MAX_DECIMATION] = {{0}};
|
||||
|
||||
10
examples/xua_lite_example/src/pdm_mic.h
Normal file
10
examples/xua_lite_example/src/pdm_mic.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _PDM_MIC_H_
|
||||
#define _PDM_MIC_H_
|
||||
|
||||
#include "mic_array.h"
|
||||
|
||||
void mic_array_decimator_set_samprate(const unsigned samplerate, int mic_decimator_fir_data_array[], mic_array_decimator_conf_common_t *dcc, mic_array_decimator_config_t dc[]);
|
||||
void pdm_mic(streaming chanend c_ds_output, in buffered port:32 p_pdm_mics);
|
||||
void mic_array_setup_ddr_xcore(clock pdmclk, clock pdmclk6, out port p_pdm_clk, buffered in port:32 p_pdm_data, int divide);
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,4 @@
|
||||
#include "xua.h"
|
||||
#if (XUA_NUM_PDM_MICS > 0)
|
||||
|
||||
#include <platform.h>
|
||||
#include <xs1.h>
|
||||
#include <stdlib.h>
|
||||
@@ -105,5 +103,3 @@ void mic_array_setup_ddr_xcore(clock pdmclk,
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user