This commit is contained in:
Steven Dan
2025-12-11 09:43:42 +08:00
commit d8b2974133
1822 changed files with 280037 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
:orphan:
#########################################
AN00248: Using lib_xua with lib_mic_array
#########################################
:vendor: XMOS
:version: 1.0.0
:scope: Example
:description: Using lib_xua with lib_mic_array
:category: General Purpose
:keywords: USB Audio, PDM microphones
:hardware: XK-EVK-XU316
*******
Summary
*******
This application note describes how to use ``lib_mic_array`` in conjunction with ``lib_xua``
to implement a USB Audio device with the ability to record from multiple PDM microphones.
**************
Required tools
**************
* XMOS XTC Tools: 15.3.0
*****************
Required hardware
*****************
The example code provided with the application has been implemented
and tested on the XK-EVK-XU316 board.
*********************************
Required libraries (dependencies)
*********************************
* `lib_xua <https://www.xmos.com/file/lib_xua>`_
* `lib_adat <https://www.xmos.com/file/lib_adat>`_
* `lib_locks <https://www.xmos.com/file/lib_locks>`_
* `lib_logging <https://www.xmos.com/file/lib_logging>`_
* `lib_mic_array <https://www.xmos.com/file/lib_mic_array>`_
* `lib_xassert <https://www.xmos.com/file/lib_xassert>`_
* `lib_xcore_math <https://www.xmos.com/file/lib_xcore_math>`_
* `lib_spdif <https://www.xmos.com/file/lib_spdif>`_
* `lib_sw_pll <https://www.xmos.com/file/lib_sw_pll>`_
* `lib_xud <https://www.xmos.com/file/lib_xud>`_
* `lib_board_support <https://www.xmos.com/file/lib_board_support>`_
*************************
Related application notes
*************************
* None
*******
Support
*******
This package is supported by XMOS Ltd. Issues can be raised against the software at: http://www.xmos.com/support

View File

@@ -0,0 +1,36 @@
// Copyright 2017-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
#include <platform.h>
#define NUM_USB_CHAN_OUT 0 /* Number of channels from host to device */
#define NUM_USB_CHAN_IN 2 /* Number of channels from device to host */
#define I2S_CHANS_DAC 2 /* Number of I2S channels out of xCORE */
#define I2S_CHANS_ADC 0 /* Number of I2S channels in to xCORE */
#define MCLK_441 (512 * 44100) /* 44.1kHz family master clock frequency */
#define MCLK_48 (512 * 48000) /* 48kHz family master clock frequency */
#define XUA_PDM_MIC_FREQ 48000 /* Currently sample rate changes are not supported for PDM mics */
#define MIN_FREQ XUA_PDM_MIC_FREQ /* Minimum sample rate */
#define MAX_FREQ XUA_PDM_MIC_FREQ /* Maximum sample rate */
#define XUA_NUM_PDM_MICS 2
#define MIC_ARRAY_CONFIG_PORT_MCLK PORT_MCLK_IN
#define MIC_ARRAY_CONFIG_PORT_PDM_CLK PORT_PDM_CLK
#define MIC_ARRAY_CONFIG_PORT_PDM_DATA PORT_PDM_DATA
#define MIC_ARRAY_CONFIG_CLOCK_BLOCK_A XS1_CLKBLK_1
#define MIC_ARRAY_CONFIG_CLOCK_BLOCK_B XS1_CLKBLK_2 /* Second clock needed as we use DDR */
#define EXCLUDE_USB_AUDIO_MAIN
#define AUDIO_CLASS 1
#define VENDOR_STR "XMOS"
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA PDM Example"
#define PRODUCT_STR_A1 "XUA PDM Example"
#define PID_AUDIO_1 1
#define PID_AUDIO_2 2
#define XUA_DFU_EN 0 /* Disable DFU for simplicity of example */
#endif

View File

@@ -0,0 +1,8 @@
// Copyright 2017-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#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