forked from PAWPAW-Mirror/lib_xua
File re-shuffle. Moving from devicedefines to xua_conf.h
This commit is contained in:
@@ -5,33 +5,8 @@
|
||||
#ifndef __custom_defines_h__
|
||||
#define __custom_defines_h__
|
||||
|
||||
#define NUM_USB_CHAN_OUT 2
|
||||
#define NUM_USB_CHAN_IN 2
|
||||
#define I2S_CHANS_DAC 2
|
||||
#define I2S_CHANS_ADC 2
|
||||
#define EXCLUDE_USB_AUDIO_MAIN
|
||||
#define NUM_PDM_MICS 0
|
||||
#define XUD_TILE 1
|
||||
#define AUDIO_IO_TILE 0
|
||||
#define MIXER 0
|
||||
#define MCLK_441 (512 * 44100)
|
||||
#define MCLK_48 (512 * 48000)
|
||||
#define MIN_FREQ 48000
|
||||
#define MAX_FREQ 48000
|
||||
#define SPDIF_TX_INDEX 0
|
||||
#define VENDOR_STR "XMOS"
|
||||
#define VENDOR_ID 0x20B1
|
||||
#define PRODUCT_STR_A2 "XUA Example"
|
||||
#define PRODUCT_STR_A1 "XUA Example"
|
||||
#define PID_AUDIO_1 1
|
||||
#define PID_AUDIO_2 2
|
||||
#define AUDIO_CLASS 2
|
||||
#define AUDIO_CLASS_FALLBACK 0
|
||||
#define BCD_DEVICE 0x1234
|
||||
#define XUA_DFU_EN 0
|
||||
|
||||
/* TODO */
|
||||
#define XUA_DFU XUA_DFU_EN
|
||||
|
||||
|
||||
#endif // __custom_defines_h__
|
||||
|
||||
|
||||
30
examples/app_xua_simple/src/xua_conf.h
Normal file
30
examples/app_xua_simple/src/xua_conf.h
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
#define NUM_USB_CHAN_OUT 2
|
||||
#define NUM_USB_CHAN_IN 2
|
||||
#define I2S_CHANS_DAC 2
|
||||
#define I2S_CHANS_ADC 2
|
||||
#define MCLK_441 (512 * 44100)
|
||||
#define MCLK_48 (512 * 48000)
|
||||
#define MIN_FREQ 48000
|
||||
#define MAX_FREQ 48000
|
||||
|
||||
#define EXCLUDE_USB_AUDIO_MAIN
|
||||
#define NUM_PDM_MICS 0
|
||||
#define XUD_TILE 1
|
||||
#define AUDIO_IO_TILE 0
|
||||
#define MIXER 0
|
||||
|
||||
#define SPDIF_TX_INDEX 0
|
||||
#define VENDOR_STR "XMOS"
|
||||
#define VENDOR_ID 0x20B1
|
||||
#define PRODUCT_STR_A2 "XUA Example"
|
||||
#define PRODUCT_STR_A1 "XUA Example"
|
||||
#define PID_AUDIO_1 1
|
||||
#define PID_AUDIO_2 2
|
||||
#define AUDIO_CLASS 2
|
||||
#define AUDIO_CLASS_FALLBACK 0
|
||||
#define BCD_DEVICE 0x1234
|
||||
#define XUA_DFU_EN 0
|
||||
|
||||
/* TODO */
|
||||
#define XUA_DFU XUA_DFU_EN
|
||||
6
examples/app_xua_simple/src/xud_conf.h
Normal file
6
examples/app_xua_simple/src/xud_conf.h
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
#include "xua_conf.h"
|
||||
|
||||
/* TODO */
|
||||
#define XUD_UAC_NUM_USB_CHAN_OUT NUM_USB_CHAN_OUT
|
||||
#define XUD_UAC_NUM_USB_CHAN_IN NUM_USB_CHAN_IN
|
||||
@@ -2,6 +2,12 @@
|
||||
#ifndef __XUA_H__
|
||||
#define __XUA_H__
|
||||
|
||||
#ifdef __xua_conf_h_exists__
|
||||
#include "xua_conf.h"
|
||||
#endif
|
||||
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
#include "xua_audiohub.h"
|
||||
|
||||
#include "xua_endpoint0.h"
|
||||
|
||||
@@ -62,4 +62,11 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
|
||||
|
||||
#endif // __XC__
|
||||
|
||||
void UserBufferManagementInit(CLIENT_INTERFACE(audManage_if, i_audMan));
|
||||
|
||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[],
|
||||
unsigned sampsFromAudioToUsb[],
|
||||
CLIENT_INTERFACE(audManage_if, i_audMan));
|
||||
|
||||
|
||||
#endif // __XUA_AUDIOHUB_H__
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* @brief Defines relating to device configuration and customisation.
|
||||
* @brief Defines relating to device configuration and customisation of lib_xua
|
||||
* @author Ross Owen, XMOS Limited
|
||||
*/
|
||||
#ifndef __XUA_CONF_H__
|
||||
#define __XUA_CONF_H__
|
||||
|
||||
|
||||
#ifndef _DEVICEDEFINES_H_
|
||||
#define _DEVICEDEFINES_H_
|
||||
|
||||
#include "customdefines.h"
|
||||
|
||||
/* Default tile arrangement */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
#ifndef _ENDPOINT0_H_
|
||||
#define _ENDPOINT0_H_
|
||||
#ifndef _XUA_ENDPOINT0_H_
|
||||
#define _XUA_ENDPOINT0_H_
|
||||
|
||||
#include "xua_conf_default.h"
|
||||
#include "dfu_interface.h"
|
||||
#include "devicedefines.h"
|
||||
#include "vendorrequests.h"
|
||||
|
||||
/** Function implementing Endpoint 0 for enumeration, control and configuration
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
#include <xs1_su.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
#include "devicedefines.h" /* TODO rm me */
|
||||
#include "xua_audiohub.h"
|
||||
|
||||
#include "userbuffermanagement.h"
|
||||
#include "audioports.h"
|
||||
#include "audiohw.h"
|
||||
#include "mic_array_conf.h"
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "userbuffermanagement.h"
|
||||
|
||||
#include "xccompat.h"
|
||||
#include "devicedefines.h"
|
||||
#include "xua_audiohub.h"
|
||||
|
||||
/* Default implementation for UserBufferManagementInit() */
|
||||
void __attribute__ ((weak)) UserBufferManagementInit(CLIENT_INTERFACE(audManage_if, i_audMan))
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
#include "devicedefines.h"
|
||||
#ifndef __XUA_INTERNAL_CMDS_H__
|
||||
#define __XUA_INTERNAL_CMDS_H_
|
||||
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
/* Clocking commands - c_clk_ctl */
|
||||
#define GET_SEL 0 /* Get value of clock selector */
|
||||
@@ -28,5 +31,6 @@
|
||||
|
||||
#include "dsd_support.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _VENDORREQUESTS_H_
|
||||
|
||||
#include <xccompat.h>
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h"
|
||||
#include "xud_device.h"
|
||||
|
||||
/* Functions that handle vustomer vendor requests.
|
||||
@@ -7,16 +7,16 @@
|
||||
#include <safestring.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
#ifndef NO_USB
|
||||
#include "xud_device.h" /* Standard descriptor requests */
|
||||
#include "usbaudio20.h" /* Defines from USB Audio 2.0 spec */
|
||||
#include "devicedefines.h"
|
||||
#include "descriptors.h" /* This devices descriptors */
|
||||
#include "xua_ep0_descriptors.h" /* This devices descriptors */
|
||||
#include "commands.h"
|
||||
#include "audiostream.h"
|
||||
#include "hostactive.h"
|
||||
#include "vendorrequests.h"
|
||||
//#include "dfu_types.h"
|
||||
#include "xc_ptr.h"
|
||||
#include "audiorequests.h"
|
||||
#ifdef HID_CONTROLS
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "devicedefines.h"
|
||||
#include "xua.h"
|
||||
#if (XUD_DFU == 1)
|
||||
#include "uac_hwresources.h"
|
||||
#include <xs1.h>
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h""
|
||||
|
||||
#if (NUM_PDM_MICS > 0) && !defined(MIC_PROCESSING_USE_INTERFACE)
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
#define __ASSEMBLER__ // Work around for bug #14118
|
||||
#include <platform.h>
|
||||
#undef __ASSEMBLER__
|
||||
#include "devicedefines.h"
|
||||
#include "audioports.h"
|
||||
#include <xccompat.h>
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
/* Note since DSD ports could be reused for I2S ports we do all the setup manually in C */
|
||||
#if DSD_CHANS_DAC > 0
|
||||
@@ -58,3 +59,4 @@ unsigned int divide, unsigned curSamFreq, unsigned int dsdMode)
|
||||
p_bclk,
|
||||
divide, curSamFreq);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _AUDIOPORTS_H_
|
||||
|
||||
#include <xccompat.h>
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
#ifdef __XC__
|
||||
void ConfigAudioPorts(
|
||||
@@ -1,9 +1,11 @@
|
||||
#include <xs1.h>
|
||||
#include <platform.h>
|
||||
#include <print.h>
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h"
|
||||
#include "audioports.h"
|
||||
|
||||
|
||||
|
||||
extern port p_mclk_in;
|
||||
extern clock clk_audio_mclk;
|
||||
extern clock clk_audio_bclk;
|
||||
@@ -8,7 +8,7 @@
|
||||
#define _DEVICE_DESCRIPTORS_
|
||||
|
||||
#include <stddef.h>
|
||||
#include "devicedefines.h" /* Device specific define */
|
||||
#include "xua_conf_default.h" /* Device specific define */
|
||||
#include "descriptor_defs.h"
|
||||
#include "usbaudio20.h" /* Defines from the USB Audio 2.0 Specifications */
|
||||
#include "usbaudiocommon.h"
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef NO_USB
|
||||
#include "devicedefines.h"
|
||||
#include "xua_conf_default.h"
|
||||
#include "hostactive.h"
|
||||
#include "audiostream.h"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include "devicedefines.h"
|
||||
#if (XUA_DFU == 1)
|
||||
#include <xs1.h>
|
||||
#include <flash.h>
|
||||
#include <flashlib.h>
|
||||
@@ -247,5 +245,4 @@ int flash_cmd_erase_all(void)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef _USERBUFFERMANAGEMENT_H_
|
||||
#define _USERBUFFERMANAGEMENT_H_
|
||||
|
||||
#include "xua_audiohub.h"
|
||||
#include <xccompat.h>
|
||||
|
||||
void UserBufferManagementInit(CLIENT_INTERFACE(audManage_if, i_audMan));
|
||||
|
||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[],
|
||||
unsigned sampsFromAudioToUsb[],
|
||||
CLIENT_INTERFACE(audManage_if, i_audMan));
|
||||
|
||||
#endif // _USERBUFFERMANAGEMENT_H_
|
||||
Reference in New Issue
Block a user