diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a1f23ede..11d15168 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,8 @@ lib_xua Change Log * ADDED: UAC1 HID support with simulated Voice Command detection reported every 10 seconds * ADDED: Support for USB HID Set Idle request + * ADDED: Pre-processor symbols to enable single-threaded, dual-PDM + microphone operation * FIXED: Descriptors for XUA_ADAPTIVE incorrectly defined for IN endpoint 0.2.1 diff --git a/examples/AN00246_xua_example/LICENSE.txt b/examples/AN00246_xua_example/LICENSE.txt index 82cfb860..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. diff --git a/examples/AN00246_xua_example/src/xua_conf.h b/examples/AN00246_xua_example/src/xua_conf.h index d879e272..c969f6cf 100644 --- a/examples/AN00246_xua_example/src/xua_conf.h +++ b/examples/AN00246_xua_example/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ @@ -21,5 +21,6 @@ #define PID_AUDIO_1 1 #define PID_AUDIO_2 2 #define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */ +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif diff --git a/examples/AN00247_xua_example_spdif_tx/LICENSE.txt b/examples/AN00247_xua_example_spdif_tx/LICENSE.txt index 236b6d1a..381126d4 100644 --- a/examples/AN00247_xua_example_spdif_tx/LICENSE.txt +++ b/examples/AN00247_xua_example_spdif_tx/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. diff --git a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h index d83f5a2e..b2867ee7 100644 --- a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h +++ b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ @@ -26,5 +26,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif diff --git a/examples/AN00248_xua_example_pdm_mics/LICENSE.txt b/examples/AN00248_xua_example_pdm_mics/LICENSE.txt index dd731b32..bdf72741 100644 --- a/examples/AN00248_xua_example_pdm_mics/LICENSE.txt +++ b/examples/AN00248_xua_example_pdm_mics/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. diff --git a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h index 8cdf256e..e2f0f84f 100644 --- a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h +++ b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ @@ -25,5 +25,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index b7bd71cf..9bfa7bbd 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -288,6 +288,13 @@ #define PDM_MIC_INDEX (0) #endif +/** + * @brief Size of a frame of microphone data samples. Default: 1 + */ +#ifndef XUA_MIC_FRAME_SIZE +#define XUA_MIC_FRAME_SIZE (1) +#endif + /** * @brief Enable MIDI functionality including buffering, descriptors etc. Default: DISABLED */ diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 3c92defa..91576287 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -617,6 +617,12 @@ void XUA_Endpoint0_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0 device_reboot(); } } +#endif +#if( 0 < HID_CONTROLS ) + if (interfaceNum == INTERFACE_NUMBER_HID) + { + result = HidInterfaceClassRequests(ep0_out, ep0_in, &sp); + } #endif /* Check for: - Audio CONTROL interface request - always 0, note we check for DFU first * - Audio STREAMING interface request (In or Out) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index 7f105514..10840331 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -1,15 +1,26 @@ -// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved #ifndef MIC_ARRAY_CONF_H_ #define MIC_ARRAY_CONF_H_ #include "xua_conf_full.h" +// The default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 must appear in this file +// because an assembler file #includes it. +// The assembler does not understand C language syntax, only C pre-processor syntax. #ifndef MIC_ARRAY_MAX_FRAME_SIZE_LOG2 -#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 0 +#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 (0) #endif #ifndef MIC_ARRAY_NUM_MICS #define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS) #endif +// MIC_DUAL_FRAME_SIZE has no meaning if MIC_DUAL_ENABLED is false. +// Only define MIC_DUAL_FRAME_SIZE if MIC_DUAL_ENABLED is true. +#if defined(MIC_DUAL_ENABLED) && (MIC_DUAL_ENABLED != 0) +#ifndef MIC_DUAL_FRAME_SIZE +#define MIC_DUAL_FRAME_SIZE (XUA_MIC_FRAME_SIZE) +#endif +#endif + #endif /* MIC_ARRAY_CONF_H_ */ diff --git a/tests/app_test_i2s_loopback/LICENSE.txt b/tests/app_test_i2s_loopback/LICENSE.txt index c7b8c711..5fee4f02 100644 --- a/tests/app_test_i2s_loopback/LICENSE.txt +++ b/tests/app_test_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/app_test_i2s_loopback/xua_conf.h b/tests/app_test_i2s_loopback/xua_conf.h index 6dc9c95d..70298c70 100644 --- a/tests/app_test_i2s_loopback/xua_conf.h +++ b/tests/app_test_i2s_loopback/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2016-2019, XMOS Ltd, All rights reserved #ifndef __custom_defines_h__ #define __custom_defines_h__ @@ -22,5 +22,7 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 1 //Use single thread, dual PDM mic +#define XUA_MIC_FRAME_SIZE 240 #endif // __custom_defines_h__