From 156bf61b62006fa5a1fa14c675cc6f4cdd7f767e Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Mon, 19 Aug 2019 18:00:26 +0100 Subject: [PATCH 01/19] Empty Jenkins file --- Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..e69de29b From 2aab72a81742f3b82fd07203a040a2d24bb16b89 Mon Sep 17 00:00:00 2001 From: Luciano Martin Date: Wed, 29 May 2019 16:33:46 +0100 Subject: [PATCH 02/19] Remove global variable for p_mclk_in --- lib_xua/api/xua_audiohub.h | 2 + lib_xua/src/core/audiohub/xua_audiohub.xc | 2 +- lib_xua/src/core/main.xc | 58 ++++++++++++----------- lib_xua/src/core/pdm_mics/pdm_mic.xc | 44 +++++------------ lib_xua/src/core/pdm_mics/xua_pdm_mic.h | 7 ++- lib_xua/src/core/ports/audioports.xc | 2 +- 6 files changed, 53 insertions(+), 62 deletions(-) diff --git a/lib_xua/api/xua_audiohub.h b/lib_xua/api/xua_audiohub.h index d4eee767..b09b6997 100644 --- a/lib_xua/api/xua_audiohub.h +++ b/lib_xua/api/xua_audiohub.h @@ -17,12 +17,14 @@ * * \param c_aud Audio sample channel connected to the mixer() thread or the * decouple() thread + * \param p_mclk_in Master clock port * \param c_dig channel connected to the clockGen() thread for * receiving/transmitting samples * \param c_config An optional channel that will be passed on to the * CODEC configuration functions. */ void XUA_AudioHub(chanend ?c_aud + , in port p_mclk_in #if (XUA_SPDIF_TX_EN) && (SPDIF_TX_TILE != AUDIO_IO_TILE) , chanend c_spdif_tx #endif diff --git a/lib_xua/src/core/audiohub/xua_audiohub.xc b/lib_xua/src/core/audiohub/xua_audiohub.xc index 296c8bad..e53aaf70 100755 --- a/lib_xua/src/core/audiohub/xua_audiohub.xc +++ b/lib_xua/src/core/audiohub/xua_audiohub.xc @@ -100,7 +100,6 @@ extern buffered out port:32 p_bclk; unsigned dsdMode = DSD_MODE_OFF; /* Master clock input */ -extern unsafe port p_mclk_in; extern in port p_mclk_in2; #if (XUA_SPDIF_TX_EN) @@ -1274,6 +1273,7 @@ static void dummy_deliver(chanend ?c_out, unsigned &command) #endif void XUA_AudioHub(chanend ?c_mix_out + , in port p_mclk_in #if (XUA_SPDIF_TX_EN) && (SPDIF_TX_TILE != AUDIO_IO_TILE) , chanend c_spdif_out #endif diff --git a/lib_xua/src/core/main.xc b/lib_xua/src/core/main.xc index 43e6b35e..d7b193f5 100755 --- a/lib_xua/src/core/main.xc +++ b/lib_xua/src/core/main.xc @@ -123,15 +123,7 @@ on tile[AUDIO_IO_TILE] : buffered out port:32 p_lrclk = PORT_I2S_LRCLK; on tile[AUDIO_IO_TILE] : buffered out port:32 p_bclk = PORT_I2S_BCLK; #endif -/* Note, declared unsafe as sometimes we want to share this port -e.g. PDM mics and I2S use same master clock IO */ -on tile[AUDIO_IO_TILE] : port p_mclk_in_ = PORT_MCLK_IN; - -/* TODO p_mclk_in should be delared as an unsafe resource */ -unsafe -{ - unsafe port p_mclk_in; -} +on tile[AUDIO_IO_TILE] : in port p_mclk_in = PORT_MCLK_IN; #ifndef NO_USB on tile[XUD_TILE] : in port p_for_mclk_count = PORT_MCLK_COUNT; @@ -185,6 +177,16 @@ on tile[SPDIF_TX_TILE] : clock clk_mst_spd = CLKBLK_SPDIF_TX; on tile[XUD_TILE] : clock clk_spd_rx = CLKBLK_SPDIF_RX; #endif +#if (NUM_PDM_MICS > 0) +in port p_pdm_clk = PORT_PDM_CLK; + + in buffered port:32 p_pdm_mics = PORT_PDM_DATA; +#if (PDM_TILE != AUDIO_IO_TILE) +/* If Mics and I2S are not the same tile we need a separate MCLK port */ +in port p_pdm_mclk = PORT_PDM_MCLK; +#endif +#endif + #if(XUD_SERIES_SUPPORT == XUD_L_SERIES) && defined(ADAT_RX) /* Cannot use default clock (CLKBLK_REF) for ADAT RX since it is tied to the 60MHz USB clock on G/L series parts. */ @@ -351,12 +353,6 @@ VENDOR_REQUESTS_PARAMS_DEC_ unsigned x; thread_speed(); - /* TODO p_mclk_in should be delared as an unsafe resource */ - unsafe - { - p_mclk_in = p_mclk_in_; - } - /* Attach mclk count port to mclk clock-block (for feedback) */ //set_port_clock(p_for_mclk_count, clk_audio_mclk); #if(AUDIO_IO_TILE != XUD_TILE) @@ -440,6 +436,9 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, , server interface i_dfu ?dfuInterface #endif #if (NUM_PDM_MICS > 0) +#if (PDM_TILE == AUDIO_IO_TILE) + , streaming chanend c_ds_output[2] +#endif , chanend c_pdm_pcm #endif ) @@ -454,6 +453,11 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, #define c_dig_rx null #endif +#if (NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE) + /* Configure clocks ports - sharing mclk port with I2S */ + xua_pdm_mic_config(p_mclk_in, p_pdm_clk, p_pdm_mics, clk_pdm); +#endif + par { #ifdef MIXER @@ -472,6 +476,7 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, #define AUDIO_CHANNEL c_aud_in #endif XUA_AudioHub(AUDIO_CHANNEL + , p_mclk_in #if (XUA_SPDIF_TX_EN) && (SPDIF_TX_TILE != AUDIO_IO_TILE) , c_spdif_tx #endif @@ -486,6 +491,9 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, #endif ); } +#if (NUM_PDM_MICS > 0) && (PDM_TILE == AUDIO_IO_TILE) + xua_pdm_mic(c_ds_output, p_pdm_mics); +#endif #if defined(SPDIF_RX) || defined(ADAT_RX) { @@ -614,11 +622,6 @@ int main() on tile[AUDIO_IO_TILE]: { - /* TODO p_mclk_in should be delared as an unsafe resource */ - unsafe - { - p_mclk_in = p_mclk_in_; - } usb_audio_io(c_mix_out, c_adc #if (XUA_SPDIF_TX_EN) && (SPDIF_TX_TILE != AUDIO_IO_TILE) , c_spdif_tx @@ -631,6 +634,9 @@ int main() , dfuInterface #endif #if (NUM_PDM_MICS > 0) +#if (PDM_TILE == AUDIO_IO_TILE) + , c_ds_output +#endif , c_pdm_pcm #endif ); @@ -706,16 +712,14 @@ int main() #ifndef PDM_RECORD #if (NUM_PDM_MICS > 0) - +#if (PDM_TILE != AUDIO_IO_TILE) + /* PDM Mics running on a separate to AudioHub */ on stdcore[PDM_TILE]: { - /* TODO p_mclk_in should be delared as an unsafe resource */ - unsafe - { - p_mclk_in = p_mclk_in_; - } - pdm_mic(c_ds_output); + xua_pdm_mic_config(p_pdm_mclk, p_pdm_clk, p_pdm_mics, clk_pdm); + xua_pdm_mic(c_ds_output, p_pdm_mics); } +#endif #ifdef MIC_PROCESSING_USE_INTERFACE on stdcore[PDM_TILE].core[0]: pdm_buffer(c_ds_output, c_pdm_pcm, i_mic_process); #else diff --git a/lib_xua/src/core/pdm_mics/pdm_mic.xc b/lib_xua/src/core/pdm_mics/pdm_mic.xc index 481187c8..e22658aa 100644 --- a/lib_xua/src/core/pdm_mics/pdm_mic.xc +++ b/lib_xua/src/core/pdm_mics/pdm_mic.xc @@ -20,21 +20,6 @@ #define MAX_DECIMATION_FACTOR (96000/(MIN_FREQ/AUD_TO_MICS_RATIO)) -/* Hardware resources */ -/* TODO these should be in main.xc with the rest of the resources */ -in port p_pdm_clk = PORT_PDM_CLK; - -in buffered port:32 p_pdm_mics = PORT_PDM_DATA; -#if (PDM_TILE != AUDIO_IO_TILE) -/* If Mics and I2S are on the same tile we'll share an MCLK port */ -in port p_pdm_mclk = PORT_PDM_MCLK; -#else -extern unsafe port p_mclk_in; -#endif - -/* Delcared in main.xc */ -extern clock clk_pdm; - #ifndef MIC_BUFFER_DEPTH #define MIC_BUFFER_DEPTH 1 #endif @@ -228,15 +213,8 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio) #error MAX_FREQ > 48000 NOT CURRENTLY SUPPORTED #endif -void pdm_mic(streaming chanend c_ds_output[2]) +void xua_pdm_mic_config(in port p_pdm_mclk, in port p_pdm_clk, buffered in port:32 p_pdm_mics, clock clk_pdm) { - streaming chan c_4x_pdm_mic_0; -#if (NUM_PDM_MICS > 4) - streaming chan c_4x_pdm_mic_1; -#else - #define c_4x_pdm_mic_1 null -#endif - /* Mics expect a clock in the 3Mhz range, calculate the divide based on mclk */ /* e.g. For a 48kHz range mclk we expect a 3072000Hz mic clock */ /* e.g. For a 44.1kHz range mclk we expect a 2822400Hz mic clock */ @@ -246,19 +224,22 @@ void pdm_mic(streaming chanend c_ds_output[2]) unsigned micDiv = MCLK_48/3072000; -#if (PDM_TILE != AUDIO_IO_TILE) configure_clock_src_divide(clk_pdm, p_pdm_mclk, micDiv/2); -#else - /* Sharing mclk port with I2S */ - unsafe - { - configure_clock_src_divide(clk_pdm, (port) p_mclk_in, micDiv/2); - } -#endif + configure_port_clock_output(p_pdm_clk, clk_pdm); configure_in_port(p_pdm_mics, clk_pdm); start_clock(clk_pdm); +} +void xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics) +{ + streaming chan c_4x_pdm_mic_0; +#if (NUM_PDM_MICS > 4) + streaming chan c_4x_pdm_mic_1; +#else + #define c_4x_pdm_mic_1 null +#endif + par { mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1); @@ -268,4 +249,5 @@ void pdm_mic(streaming chanend c_ds_output[2]) #endif } } + #endif diff --git a/lib_xua/src/core/pdm_mics/xua_pdm_mic.h b/lib_xua/src/core/pdm_mics/xua_pdm_mic.h index 1dcb983b..d56bff3a 100644 --- a/lib_xua/src/core/pdm_mics/xua_pdm_mic.h +++ b/lib_xua/src/core/pdm_mics/xua_pdm_mic.h @@ -2,6 +2,9 @@ #include "mic_array.h" +/* Configures PDM ports/clocks */ +void xua_pdm_mic_config(in port p_pdm_mclk, in port p_pdm_clk, buffered in port:32 p_pdm_mics, clock clk_pdm); + #ifdef MIC_PROCESSING_USE_INTERFACE /* Interface based user processing */ typedef interface mic_process_if @@ -22,7 +25,7 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio 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]); +void xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics); #else @@ -36,7 +39,7 @@ void user_pdm_init(); void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio); /* PDM interface and decimation cores */ -void pdm_mic(streaming chanend c_ds_output[2]); +void xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics); #endif diff --git a/lib_xua/src/core/ports/audioports.xc b/lib_xua/src/core/ports/audioports.xc index 2f26b9af..80d2500a 100644 --- a/lib_xua/src/core/ports/audioports.xc +++ b/lib_xua/src/core/ports/audioports.xc @@ -7,7 +7,7 @@ -extern unsafe port p_mclk_in; +extern in port p_mclk_in; extern clock clk_audio_mclk; extern clock clk_audio_bclk; From 232ab79f7808b2e43465961236b3329c8b5dcd0f Mon Sep 17 00:00:00 2001 From: Luciano Martin Date: Wed, 29 May 2019 16:44:36 +0100 Subject: [PATCH 03/19] Remove obsolete flag subword-selectt --- lib_xua/module_build_info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index fca1e1f9..44c20442 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -9,7 +9,7 @@ # # You can also set MODULE_XCC_C_FLAGS, MODULE_XCC_XC_FLAGS etc.. -MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm -fsubword-select +MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm OPTIONAL_HEADERS += xua_conf.h From c59a54519719950d5248d03f646b0993f8e60715 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 13:15:52 +0100 Subject: [PATCH 04/19] Copyright notice update --- lib_xua/api/xua_audiohub.h | 2 +- lib_xua/src/core/audiohub/xua_audiohub.xc | 2 +- lib_xua/src/core/main.xc | 2 +- lib_xua/src/core/pdm_mics/pdm_mic.xc | 2 +- lib_xua/src/core/pdm_mics/xua_pdm_mic.h | 2 +- lib_xua/src/core/ports/audioports.xc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_xua/api/xua_audiohub.h b/lib_xua/api/xua_audiohub.h index b09b6997..f109fbaf 100644 --- a/lib_xua/api/xua_audiohub.h +++ b/lib_xua/api/xua_audiohub.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved #ifndef __XUA_AUDIOHUB_H__ #define __XUA_AUDIOHUB_H__ diff --git a/lib_xua/src/core/audiohub/xua_audiohub.xc b/lib_xua/src/core/audiohub/xua_audiohub.xc index e53aaf70..23d4780e 100755 --- a/lib_xua/src/core/audiohub/xua_audiohub.xc +++ b/lib_xua/src/core/audiohub/xua_audiohub.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved /** * @file xua_audiohub.xc * @brief XMOS USB 2.0 Audio Reference Design. Audio Functions. diff --git a/lib_xua/src/core/main.xc b/lib_xua/src/core/main.xc index d7b193f5..87f0e6fd 100755 --- a/lib_xua/src/core/main.xc +++ b/lib_xua/src/core/main.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2012-2019, XMOS Ltd, All rights reserved #include "xua.h" /* Device specific defines */ #ifndef EXCLUDE_USB_AUDIO_MAIN diff --git a/lib_xua/src/core/pdm_mics/pdm_mic.xc b/lib_xua/src/core/pdm_mics/pdm_mic.xc index e22658aa..78a388ac 100644 --- a/lib_xua/src/core/pdm_mics/pdm_mic.xc +++ b/lib_xua/src/core/pdm_mics/pdm_mic.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved #include "xua.h" diff --git a/lib_xua/src/core/pdm_mics/xua_pdm_mic.h b/lib_xua/src/core/pdm_mics/xua_pdm_mic.h index d56bff3a..ed88eb43 100644 --- a/lib_xua/src/core/pdm_mics/xua_pdm_mic.h +++ b/lib_xua/src/core/pdm_mics/xua_pdm_mic.h @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved #include "mic_array.h" diff --git a/lib_xua/src/core/ports/audioports.xc b/lib_xua/src/core/ports/audioports.xc index 80d2500a..f95bca17 100644 --- a/lib_xua/src/core/ports/audioports.xc +++ b/lib_xua/src/core/ports/audioports.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved #include #include #include From 5a1865d9d5c91c24e257fef8d4e74af9efbe2ac1 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 15:25:53 +0100 Subject: [PATCH 05/19] Changelog and version number for 0.1.3 release --- CHANGELOG.rst | 7 +++++++ lib_xua/module_build_info | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 211bf644..21d1484f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ lib_xua Change Log ================== +0.1.3 +----- + + * CHANGED: Remove sharing of global master clock port variable for + compatibility with tools 14.4 + * CHANGED: Remove obsolete -fsubword-select to clear warning in tools 14.4 + 0.1.2 ----- diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index 44c20442..7a2a5148 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -13,7 +13,7 @@ MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-a OPTIONAL_HEADERS += xua_conf.h -VERSION = 0.1.2 +VERSION = 0.1.3 DEPENDENT_MODULES = lib_logging(>=2.1.0) lib_xud(>=0.1.0) From f4ab2d9b8204d91d57e3400dc2c483eef87ac6a4 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 15:29:26 +0100 Subject: [PATCH 06/19] Infrastructure files from pull request #84 --- .gitignore | 2 ++ Brewfile | 7 +++++++ Pipfile | 7 +++++++ cpanfile | 2 ++ 4 files changed, 18 insertions(+) create mode 100644 Brewfile create mode 100644 Pipfile create mode 100644 cpanfile diff --git a/.gitignore b/.gitignore index ff869912..791c4689 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ module_dfu/host/xmosdfu/xmosdfu .waf-*/ build/ host/xmosdfu/xmosdfu + +.venv diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..2fd6d0b8 --- /dev/null +++ b/Brewfile @@ -0,0 +1,7 @@ +tap 'homebrew/core' + +brew 'perl' +brew 'cpanm' + +brew 'python@2' +brew 'pipenv' diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..6d52bfd2 --- /dev/null +++ b/Pipfile @@ -0,0 +1,7 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flake8 = "*" diff --git a/cpanfile b/cpanfile new file mode 100644 index 00000000..071f5e6a --- /dev/null +++ b/cpanfile @@ -0,0 +1,2 @@ +requires 'File::Copy::Recursive'; +requires 'LWP::Simple' From 58eb2fe6126685107f906ddcf501df25cc368898 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 16:41:49 +0100 Subject: [PATCH 07/19] Update AN00246 to API with master clock passed in --- CHANGELOG.rst | 3 ++- examples/AN00246_xua_example/Makefile | 8 ++++---- examples/AN00246_xua_example/src/app_xua_simple.xc | 14 ++------------ lib_xua/src/core/warnings.xc | 4 ---- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 21d1484f..5af089b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,8 @@ lib_xua Change Log ----- * CHANGED: Remove sharing of global master clock port variable for - compatibility with tools 14.4 + compatibility with tools 14.4 (API change but preserve 0.1 + version as this is maintenance branch) * CHANGED: Remove obsolete -fsubword-select to clear warning in tools 14.4 0.1.2 diff --git a/examples/AN00246_xua_example/Makefile b/examples/AN00246_xua_example/Makefile index 7abafaa0..3852a325 100644 --- a/examples/AN00246_xua_example/Makefile +++ b/examples/AN00246_xua_example/Makefile @@ -3,14 +3,14 @@ APP_NAME = app_xua_simple TARGET = xk-audio-216-mc.xn # The flags passed to xcc when building the application -XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -fsubword-select -save-temps \ - -g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSB_TILE=tile[1] \ - -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope +XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \ + -g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSB_TILE=tile[1] \ + -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope # The USED_MODULES variable lists other module used by the application. These # modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables. # Modules are expected to be in the directory above the BASE_DIR directory. -USED_MODULES = lib_xua lib_device_control lib_xud module_i2c_shared module_i2c_single_port module_locks +USED_MODULES = lib_xua lib_xud module_i2c_shared module_i2c_single_port #============================================================================= # The following part of the Makefile includes the common build infrastructure diff --git a/examples/AN00246_xua_example/src/app_xua_simple.xc b/examples/AN00246_xua_example/src/app_xua_simple.xc index bc5a19ee..7db7639a 100644 --- a/examples/AN00246_xua_example/src/app_xua_simple.xc +++ b/examples/AN00246_xua_example/src/app_xua_simple.xc @@ -24,13 +24,7 @@ buffered out port:32 p_bclk = PORT_I2S_BCLK; /* I2S L/R-clock */ /* Note, declared unsafe as sometimes we want to share this port e.g. PDM mics and I2S use same master clock IO */ -port p_mclk_in_ = PORT_MCLK_IN; - -unsafe -{ - /* TODO simplify this */ - unsafe port p_mclk_in; /* Audio master clock input */ -} +in port p_mclk_in = PORT_MCLK_IN; in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for counting master clock ticks */ in port p_mclk_in2 = PORT_MCLK_IN2; @@ -85,11 +79,7 @@ int main() /* IOHub core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */ on tile[0]: { - unsafe - { - p_mclk_in = p_mclk_in_; - } - XUA_AudioHub(c_aud); + XUA_AudioHub(c_aud, p_mclk_in); } } diff --git a/lib_xua/src/core/warnings.xc b/lib_xua/src/core/warnings.xc index 452a2165..8530758f 100644 --- a/lib_xua/src/core/warnings.xc +++ b/lib_xua/src/core/warnings.xc @@ -60,10 +60,6 @@ Warnings relating to configuration defines located in this XC source file rather #warning AUDIO_CLASS not defined, using 2 #endif -#ifndef AUDIO_CLASS_FALLBACK -#warning AUDIO_CLASS_FALLBACK not defined, using 0 (i.e. disabled) -#endif - /* Sanity check on FS channel counts */ #if (NUM_USB_CHAN_OUT_FS > NUM_USB_CHAN_OUT) #error NUM_USB_CHAN_OUT_FS expected to be less than or equal to NUM_USB_CHAN_OUT From 9ea6a3de3caf2f4a01cdf806d61e930d0d1a1251 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 16:49:00 +0100 Subject: [PATCH 08/19] Remove wscript to ensure always xcommon build --- lib_xua/wscript | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 lib_xua/wscript diff --git a/lib_xua/wscript b/lib_xua/wscript deleted file mode 100644 index d7d30c1b..00000000 --- a/lib_xua/wscript +++ /dev/null @@ -1,35 +0,0 @@ -def use_module(bld): - bld.env.XCC_FLAGS = bld.env.XCC_FLAGS + [ - '-O3', '-DREF_CLK_FREQ=100', '-fasm-linenum', '-fcomment-asm', - '-fsubword-select', '-DXUD_FULL_PIDTABLE=1' - ] - - source = bld.path.ant_glob( - [ - 'src/**/*.xc', 'src/**/*.c', 'src/**/*.S' - ], - excl=[ - '**/descriptors_2.rst' - ]) - - depends_on = [ - 'lib_logging(>=2.0.0)', 'lib_xassert(>=2.0.0)', 'lib_xud(>=1.0.0)' - ] - - - bld.env['XCC_FLAGS_endpoint0.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_dbcalc.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audiorequests.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audioports.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audioports.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_dfu.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_flash_interface.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - - - bld.module( - source=source, - depends_on=depends_on, - includes=['api'], - optional_headers='xua_conf.h', - version='1.0.0') From fa3ccb555bffc88b60eddb009aabf48c2737203f Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 17:58:51 +0100 Subject: [PATCH 09/19] Also update i2s_loopback test to work with 14.4 tools --- .../AN00246_xua_example/src/app_xua_simple.xc | 2 +- tests/i2s_loopback/main.xc | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/examples/AN00246_xua_example/src/app_xua_simple.xc b/examples/AN00246_xua_example/src/app_xua_simple.xc index 7db7639a..58a54c92 100644 --- a/examples/AN00246_xua_example/src/app_xua_simple.xc +++ b/examples/AN00246_xua_example/src/app_xua_simple.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved /* A very simple *example* of a USB audio application (and as such is un-verified for production) * diff --git a/tests/i2s_loopback/main.xc b/tests/i2s_loopback/main.xc index b3724be8..d9a4d3e8 100644 --- a/tests/i2s_loopback/main.xc +++ b/tests/i2s_loopback/main.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2016-2019, XMOS Ltd, All rights reserved #include #include #include @@ -79,18 +79,12 @@ buffered out port:32 p_bclk = PORT_I2S_BCLK; /* I2S L/R-clock */ /* Note, declared unsafe as sometimes we want to share this port e.g. PDM mics and I2S use same master clock IO */ -port p_mclk_in_ = PORT_MCLK_IN; +in port p_mclk_in = PORT_MCLK_IN; /* Clock-block declarations */ clock clk_audio_bclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_1; /* Bit clock */ clock clk_audio_mclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_2; /* Master clock */ -unsafe -{ - /* TODO simplify this */ - unsafe port p_mclk_in; /* Audio master clock input */ -} - #ifdef SIMULATION #define INITIAL_SKIP_FRAMES 10 #define TOTAL_TEST_FRAMES 100 @@ -224,13 +218,9 @@ int main(void) par { on tile[AUDIO_IO_TILE]: { - unsafe - { - p_mclk_in = p_mclk_in_; - } par { - XUA_AudioHub(c_out); + XUA_AudioHub(c_out, p_mclk_in); generator(c_checker, c_out); checker(c_checker, 0); #ifdef SIMULATION From 7d1d2af8d2564bc8ec176a5760ddd1ac3491b9e2 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 17:59:06 +0100 Subject: [PATCH 10/19] Draft Jenkins file --- Jenkinsfile | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e69de29b..b8ffe920 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -0,0 +1,103 @@ +@Library('xmos_jenkins_shared_library@develop') _ + +getApproval() + +pipeline { + agent none + environment { + REPO = 'lib_xua' + VIEW = 'lib_xua_mainten_01' + } + options { + skipDefaultCheckout() + } + stages { + stage('Basic tests') { + agent { + label 'x86_64&&brew' + } + stages { + stage('Get view') { + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + } + } + stage('Library checks') { + steps { + xcoreLibraryChecks("${REPO}") + } + } + stage('Tests') { + steps { + runXmostest("${REPO}", 'tests') + } + } + stage('xCORE builds') { + steps { + dir("${REPO}") { + xcoreAllAppNotesBuild('examples') + dir("${REPO}") { + runXdoc('doc') + } + } + } + } + } + post { + cleanup { + xcoreCleanSandbox() + } + } + } + stage('Build host apps') { + failFast true + parallel { + stage('Build Linux host app') { + agent { + label 'x86_64&&brew&&linux' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.Linux64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } + } + } + stage('Build Mac host app') { + agent { + label 'x86_64&&brew&&macOS' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.OSX64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } + } + } + } + } + stage('Update') { + agent { + label 'x86_64&&brew' + } + steps { + updateViewfiles() + } + post { + cleanup { + cleanWs() + } + } + } + } +} From 9cd76b2a4b4977896ab092f58de9cea8e17c04b7 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 22 Aug 2019 11:48:38 +0100 Subject: [PATCH 11/19] Satisfy release checks --- CHANGELOG.rst | 4 ++-- LICENSE.txt | 2 +- lib_xua/src/core/warnings.xc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5af089b7..57f1308d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,8 +5,8 @@ lib_xua Change Log ----- * CHANGED: Remove sharing of global master clock port variable for - compatibility with tools 14.4 (API change but preserve 0.1 - version as this is maintenance branch) + compatibility with tools 14.4 (API change but preserve 0.1 version as this + is maintenance branch) * CHANGED: Remove obsolete -fsubword-select to clear warning in tools 14.4 0.1.2 diff --git a/LICENSE.txt b/LICENSE.txt index d26bf69d..19f8e7cc 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2011-2018, XMOS, All rights reserved. +Copyright (c) 2011-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/src/core/warnings.xc b/lib_xua/src/core/warnings.xc index 8530758f..f9d2335b 100644 --- a/lib_xua/src/core/warnings.xc +++ b/lib_xua/src/core/warnings.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2013-2019, XMOS Ltd, All rights reserved /* Warnings relating to configuration defines located in this XC source file rather than the devicedefines.h header file in order to avoid multiple warnings being issued when the devicedefines.h header file is included in multiple files. From 3cbb8282c722b983fdd6cea24d246262a296f248 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 22 Aug 2019 11:57:15 +0100 Subject: [PATCH 12/19] GitFlow-like view name in Jenkins file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b8ffe920..c6a3a789 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { agent none environment { REPO = 'lib_xua' - VIEW = 'lib_xua_mainten_01' + VIEW = 'lib_xua_release_0_1_3' } options { skipDefaultCheckout() From 83b8c727f6ceeda1368a2f068e2207d384a49858 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 22 Aug 2019 14:14:26 +0100 Subject: [PATCH 13/19] Buggy Git ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 791c4689..0b70b9df 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ module_dfu/host/xmosdfu/xmosdfu *.xi *.i *.bin -.* +.build* *~ *.a *.swp From df8cdd869206a11f5de4372473f79480fb7f410b Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 22 Aug 2019 14:14:14 +0100 Subject: [PATCH 14/19] More release checks --- examples/AN00246_xua_example/LICENSE.txt | 4 ++-- lib_xua/LICENSE.txt | 2 +- lib_xua/src/core/endpoint0/chanstringgen.py | 1 + tests/i2s_loopback/LICENSE.txt | 2 +- tests/runtests.py | 1 + tests/test_i2s_loopback.py | 1 + 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/AN00246_xua_example/LICENSE.txt b/examples/AN00246_xua_example/LICENSE.txt index 844e2bcc..8b37ec93 100644 --- a/examples/AN00246_xua_example/LICENSE.txt +++ b/examples/AN00246_xua_example/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2018, XMOS, All rights reserved. +Copyright (c) 2018-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. @@ -132,4 +132,4 @@ This License shall be governed by and construed in accordance with English law a This License has been entered into on the date stated at the beginning of it. Schedule -XMOS lib_xua software +XMOS application note AN00246 software diff --git a/lib_xua/LICENSE.txt b/lib_xua/LICENSE.txt index 9f9fc466..3932a9ae 100644 --- a/lib_xua/LICENSE.txt +++ b/lib_xua/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2017-2018, XMOS, All rights reserved. +Copyright (c) 2017-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/src/core/endpoint0/chanstringgen.py b/lib_xua/src/core/endpoint0/chanstringgen.py index f6716bfc..ab95490d 100644 --- a/lib_xua/src/core/endpoint0/chanstringgen.py +++ b/lib_xua/src/core/endpoint0/chanstringgen.py @@ -1,3 +1,4 @@ +# Copyright (c) 2015-2019, XMOS Ltd, All rights reserved def genstrings(outputChanCount, chanString, portString, structureString, adc_dac): diff --git a/tests/i2s_loopback/LICENSE.txt b/tests/i2s_loopback/LICENSE.txt index c7b8c711..5fee4f02 100644 --- a/tests/i2s_loopback/LICENSE.txt +++ b/tests/i2s_loopback/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2016-2018, XMOS, All rights reserved. +Copyright (c) 2016-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/tests/runtests.py b/tests/runtests.py index 36198102..e9ab12dd 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -1,4 +1,5 @@ #!/usr/bin/env python2.7 +# Copyright (c) 2018-2019, XMOS Ltd, All rights reserved import xmostest import os.path diff --git a/tests/test_i2s_loopback.py b/tests/test_i2s_loopback.py index 1aee29c8..9e50793b 100644 --- a/tests/test_i2s_loopback.py +++ b/tests/test_i2s_loopback.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# Copyright (c) 2018-2019, XMOS Ltd, All rights reserved import xmostest def runtest_one_config(env, format, i2s_role, num_chans_in, num_chans_out, sample_rate): From 502db6ee482cb292a07e81b638800bf073e10223 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 22 Aug 2019 14:33:20 +0100 Subject: [PATCH 15/19] Git ignore of Python virtual environment --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0b70b9df..f8d9dddf 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ module_dfu/host/xmosdfu/xmosdfu *.i *.bin .build* +*/.venv/* *~ *.a *.swp @@ -22,5 +23,3 @@ module_dfu/host/xmosdfu/xmosdfu .waf-*/ build/ host/xmosdfu/xmosdfu - -.venv From ebe263605c593e3f5390a855a34013f41ee66d42 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 23 Aug 2019 12:16:52 +0100 Subject: [PATCH 16/19] AN00246: Fix xdoc build --- examples/AN00246_xua_example/doc/.gitignore | 2 + examples/AN00246_xua_example/doc/AN00246.rst | 240 ------------------ .../AN00246_xua_example/doc/rst/AN00246.rst | 12 + 3 files changed, 14 insertions(+), 240 deletions(-) create mode 100644 examples/AN00246_xua_example/doc/.gitignore delete mode 100644 examples/AN00246_xua_example/doc/AN00246.rst diff --git a/examples/AN00246_xua_example/doc/.gitignore b/examples/AN00246_xua_example/doc/.gitignore new file mode 100644 index 00000000..9ac96638 --- /dev/null +++ b/examples/AN00246_xua_example/doc/.gitignore @@ -0,0 +1,2 @@ +rst/_build +pdf diff --git a/examples/AN00246_xua_example/doc/AN00246.rst b/examples/AN00246_xua_example/doc/AN00246.rst deleted file mode 100644 index 89267983..00000000 --- a/examples/AN00246_xua_example/doc/AN00246.rst +++ /dev/null @@ -1,240 +0,0 @@ -.. include:: ../../README.rst - -|newpage| - -Overview --------- - -Introduction -............ - -The XMOS USB Audio (XUA) library provides an implemention of USB Audio Class 2.0 - -This application note demonstrates the implementation of a basic USB Audio Device on -the xCORE-200 MC Audio board. - -Block diagram -............. - -.. figure:: images/block_diagram.* - :width: 80% - - Application block diagram - -The application uses a single logical core which runs the application and makes -calls to the |I2C| master library functions as required. - -How to use lib_xua ------------------- - -The Makefile -............ - -To start using the lib_xua, you need to add ``lib_xua`` to your Makefile:: - - USED_MODULES = .. lib_xua ... - -This demo also uses the XMOS USB Device library (``lib_xud``) for low-level USB connectivity. -The Makefile also includes:: - - USED_MODULES = .. lib_xud .. - -``lib_xud`` library requires some flags for correct operation. Firstly the -tile on which ``lib_xud`` will be execute, for example:: - - XCC_FLAGS = .. -DUSB_TILE=tile[1] .. - -Secondly, the architecture of the target device, for example:: - - XCC_FLAGS = .. -DXUD_SERIES_SUPPORT=XUD_X200_SERIES .. - -Includes -........ - -This application requires the system header that defines XMOS xCORE specific -defines for declaring and initialising hardware: - -.. literalinclude:: app_xua_simple.xc - :start-on: include - :end-before: include "xua.h" - -The XUA library functions are defined in ``xua.h``. This header must -be included in your code to use the library. - -.. literalinclude:: app_xua_simple.xc - :start-on: include "xua.h" - :end-on: include "xud_device.h" - -Allocating hardware resources -............................. - -A most basic implementation of a USB Audio device (i.e. simple stereo input and output via I2S) -using ``lib_xua`` requires the follow pins: - - - I2S Bit Clock (from xCORE to DAC) - - I2S L/R clock (from xCORE to DAC) - - I2S Data line (from xCORE to DAC) - - I2S Data line (from ADC to xCORE) - - Audio Master clock (from clock source to xCORE) - -.. note:: - - ANOO246 assumes xCORE is I2S bus master - -On an xCORE the pins are controlled by ``ports``. The application therefore declares various ``ports`` -for this purpose: - -.. literalinclude:: app_xua_simple.xc - :start-on: /* Port declaration - :end-on: /* Clock-block - -In addition to ``port`` resources two clock-block resources are also required: - -.. literalinclude:: app_xua_simple.xc - :start-on: /* Clock-block - :end-on: /* clock clk_audio_mclk - -Other declarations -.................. - -``lib_xua`` currently requires the manual declaration of tables for the endpoint types for -``lib_xud`` and the calling the main XUD funtion in a par (``XUD_Main()``). - -For a simple application the following endpoints are required: - - - ``Control`` enpoint zero - - ``Isochonous`` endpoint for each direction for audio data to/from the USB host - -These are declared as follows: - -.. literalinclude:: app_xua_simple.xc - :start-on: /* Endpoint type tables - :end-on: /* XUD_EpType epTypeTableIn - -The application main() function -............................... - -The ``main()`` function sets up the tasks in the application. - -Various channels are required in order to allow the required tasks to communcate. -These must be declared": - -.. literalinclude:: app_xua_simple.xc - :start-on: /* Channels for lib_xud - :end-on: /* chan c_aud_ctl - -The rest of the ``main()`` function starts all the tasks in parallel -using the xC ``par`` construct: - -.. literalinclude:: app_xua_simple.xc - :start-on: par - :end-before: return 0 - -This code starts the low-level USB task, an Endpoint 0 task, an Audio buffering task and a task to handle -the audio I/O (i.e. I2S signalling). - -Configuration -............. - -``lib_xua`` has many parameters than can be configured at build time, some examples include: - - - Sample-rates - - Channel counts - - Audio Class version - - Product/Vendor ID's - - Various product strings - - Master clock frequency - -These parameters are set via defines in an optional ``xua_conf.h`` header file. - -|appendix| -|newpage| - -Demo Hardware Setup -------------------- - -To run the demo, connect a USB cable to power the xCORE-200 MC Audio board -and plug the xTAG to the board and connect the xTAG USB cable to your -development machine. - -.. figure:: images/hw_setup.* - :width: 80% - - Hardware setup - -|newpage| - -Launching the demo application ------------------------------- - -Once the demo example has been built either from the command line using xmake or -via the build mechanism of xTIMEcomposer studio it can be executed on the xCORE-200 -MC Audio board. - -Once built there will be a ``bin/`` directory within the project which contains -the binary for the xCORE device. The xCORE binary has a XMOS standard .xe extension. - -Launching from the command line -............................... - -From the command line you use the ``xrun`` tool to download and run the code -on the xCORE device:: - - xrun --xscope bin/app_xua_simple.xe - -Once this command has executed the application will be running on the -xCORE-200 MC Audio Board - -Launching from xTIMEcomposer Studio -................................... - -From xTIMEcomposer Studio use the run mechanism to download code to xCORE device. -Select the xCORE binary from the ``bin/`` directory, right click and go to Run -Configurations. Double click on xCORE application to create a new run configuration, -enable the xSCOPE I/O mode in the dialog box and then -select Run. - -Once this command has executed the application will be running on the -xCORE-200 MC Audio board. - -Running the application -....................... - -Once running the device will be detected as a USB Audio device - note, Windows operating -systems may require a third party driver for correct operation - -|newpage| - -References ----------- - -.. nopoints:: - - * XMOS Tools User Guide - - http://www.xmos.com/published/xtimecomposer-user-guide - - * XMOS xCORE Programming Guide - - http://www.xmos.com/published/xmos-programming-guide - - * XMOS lib_xua Library - - http://www.xmos.com/support/libraries/lib_xua - - * XMOS lib_xud Library - - http://www.xmos.com/support/libraries/lib_xud - -|newpage| - -Full source code listing ------------------------- - -Source code for main.xc -....................... - -.. literalinclude:: app_xua_simple.xc - :largelisting: - -|newpage| diff --git a/examples/AN00246_xua_example/doc/rst/AN00246.rst b/examples/AN00246_xua_example/doc/rst/AN00246.rst index 1c5b9ab9..79f46436 100644 --- a/examples/AN00246_xua_example/doc/rst/AN00246.rst +++ b/examples/AN00246_xua_example/doc/rst/AN00246.rst @@ -1,4 +1,5 @@ .. include:: ../../README.rst +.. |I2C| replace:: I\ :sup:`2`\ C |newpage| @@ -136,6 +137,17 @@ the audio I/O (i.e. I2S signalling). Configuration ............. +``lib_xua`` has many parameters than can be configured at build time, some examples include: + + - Sample-rates + - Channel counts + - Audio Class version + - Product/Vendor ID's + - Various product strings + - Master clock frequency + +These parameters are set via defines in an optional ``xua_conf.h`` header file. + |appendix| |newpage| From a48ae96f391bd234df58eae8a6cd6799642ee939 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 23 Aug 2019 12:39:35 +0100 Subject: [PATCH 17/19] AN00246: Remove missing block diagram --- examples/AN00246_xua_example/doc/rst/AN00246.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/AN00246_xua_example/doc/rst/AN00246.rst b/examples/AN00246_xua_example/doc/rst/AN00246.rst index 79f46436..80b580bc 100644 --- a/examples/AN00246_xua_example/doc/rst/AN00246.rst +++ b/examples/AN00246_xua_example/doc/rst/AN00246.rst @@ -17,10 +17,10 @@ the xCORE-200 MC Audio board. Block diagram ............. -.. figure:: images/block_diagram.* - :width: 80% - - Application block diagram +.. .. figure:: images/block_diagram.* +.. :width: 80% +.. +.. Application block diagram The application uses a single logical core which runs the application and makes calls to the |I2C| master library functions as required. From 2e6ce1e4e16c690a14d9ff19f0aa4583f25fe67d Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 23 Aug 2019 13:10:59 +0100 Subject: [PATCH 18/19] More documentation build fixes --- CHANGELOG.rst | 5 ++--- README.rst | 4 ++-- examples/AN00246_xua_example/README.rst | 2 +- lib_xua/doc/.gitignore | 2 ++ lib_xua/doc/rst/index.rst | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 lib_xua/doc/.gitignore diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 57f1308d..3af62fe4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -61,9 +61,8 @@ lib_xua Change Log sc_usb_audio 6.14) * RESOLVED: Improvements made to clock sync code in TDM slave mode - Legacy release history ----------------------- +====================== (Note: Forked from sc_usb_audio at this point) @@ -340,7 +339,7 @@ Legacy release history Legacy release history ----------------------- +====================== Please see changelog in sw_usb_audio for changes prior to 6.8.0 release. diff --git a/README.rst b/README.rst index 9c0d4a97..b6dcab47 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs. Required software (dependencies) -................................ +-------------------------------- * lib_logging * lib_xud @@ -13,6 +13,6 @@ Required software (dependencies) Checking dependent libs Software version and dependencies -................................. +--------------------------------- .. libdeps:: diff --git a/examples/AN00246_xua_example/README.rst b/examples/AN00246_xua_example/README.rst index 125adb13..96dd864a 100644 --- a/examples/AN00246_xua_example/README.rst +++ b/examples/AN00246_xua_example/README.rst @@ -2,7 +2,7 @@ How to use the lib_xua_library =============================== -.. version:: 0.1.0 +.. version:: 0.1.3 Summary ------- diff --git a/lib_xua/doc/.gitignore b/lib_xua/doc/.gitignore new file mode 100644 index 00000000..9ac96638 --- /dev/null +++ b/lib_xua/doc/.gitignore @@ -0,0 +1,2 @@ +rst/_build +pdf diff --git a/lib_xua/doc/rst/index.rst b/lib_xua/doc/rst/index.rst index 3e66a00e..7d8bd587 100644 --- a/lib_xua/doc/rst/index.rst +++ b/lib_xua/doc/rst/index.rst @@ -2,6 +2,7 @@ .. include:: ../../../README.rst +============== XMOS USB Audio ============== From 5b1132a603c7cbf0e7a04b70af46faf07b5f3542 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 23 Aug 2019 13:15:23 +0100 Subject: [PATCH 19/19] Changelog update --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3af62fe4..089353f6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -61,6 +61,7 @@ lib_xua Change Log sc_usb_audio 6.14) * RESOLVED: Improvements made to clock sync code in TDM slave mode + Legacy release history ======================