455 Commits

Author SHA1 Message Date
Ross Owen
a485ffe41a 'Release: 3.5.1' 2023-06-21 12:21:02 +01:00
Ross Owen
f25a9eeade Merge branch 'develop' 2023-06-21 12:15:33 +01:00
Ross Owen
dff72573f8 Scripted changelog update 2023-06-21 12:14:34 +01:00
Ross Owen
f7331a1ed3 Merge branch 'develop' 2023-06-21 12:14:02 +01:00
Ross Owen
aaaf1e9652 Version bump 3.5.0 -> 3.5.1 2023-06-21 12:11:56 +01:00
Ross Owen
d6b23cf960 Merge pull request #337 from xross/develop
Respect I2S_CHANS_PER_FRAME when calculating bit-clock rates
2023-06-21 10:06:57 +01:00
Ross Owen
fa8329edaa Changelog update 2023-06-20 20:04:17 +01:00
Ross Owen
83d86e885f Respect I2S_CHANS_PER_FRAME when calculating bit-clock rates 2023-06-20 19:36:26 +01:00
Ross Owen
15036f2bcc 'Release: 3.5.0' 2023-06-15 12:45:03 +01:00
Ross Owen
fa5723947f xpd: Cleaned up whitespace 2023-06-15 12:44:02 +01:00
Ross Owen
b1b28f1005 Merge pull request #335 from xross/fix/258
bNumConfigurations changes from 2 to 1
2023-06-14 19:09:28 +01:00
Ross Owen
6d41cfcbea Merge pull request #336 from xross/fix/155
Removed application space HID related function prototype
2023-06-14 16:06:58 +01:00
Ross Owen
5404127dbf Removed application space HID related function prototype 2023-06-14 15:30:37 +01:00
Ross Owen
e5a270347a bNumConfigurations changes from 2 to 1 2023-06-14 14:36:39 +01:00
Ross Owen
f509a12e7d Merge pull request #334 from xross/release_prep
Release prep
2023-06-14 14:23:39 +01:00
Ross Owen
4528bed740 Readme, changelog and version update 2023-06-14 12:58:51 +01:00
Ross Owen
e812ca3e8b Merge remote-tracking branch 'upstream/develop' into release_prep 2023-06-14 12:39:17 +01:00
Ross Owen
2accc0429f Merge pull request #333 from danielpieczko/develop
Update copyright years
2023-06-14 10:30:29 +01:00
Daniel Pieczko
36d5201365 Update copyright years 2023-06-14 08:09:33 +01:00
Ross Owen
cea580ba48 Merge pull request #332 from henkmuller/feature/static-hid-descriptor
Enabling a static HID report descriptor
2023-06-13 16:46:14 +01:00
Ross Owen
6815f12a90 Update copyright comment 2023-06-12 17:16:56 +01:00
Ross Owen
799ad7ba86 Update copyright comment 2023-06-12 17:16:43 +01:00
Ross Owen
3d7e66bdc0 Update copyright comment 2023-06-12 17:16:26 +01:00
Ross Owen
a6387d5fef Update copyright comment 2023-06-12 17:16:11 +01:00
Ross Owen
5ca0738b02 Update copyright comment 2023-06-12 17:15:42 +01:00
Ross Owen
b0e732110d Update copyright comment 2023-06-12 17:15:21 +01:00
Ross Owen
1702078e7c Update copyright comment 2023-06-12 17:14:42 +01:00
Henk Muller
136ec2506c One of the intermediate XUA_HID_REQUIRED slipped through the refactoring 2023-06-12 09:20:43 +01:00
Henk Muller
45e5ef7702 Enabling a static HID report descriptor in addition to the built-in dynamically created one. This is required for AudioWeaver. This also enables the option of an OUT HID endpoint 2023-06-10 18:07:25 +01:00
Ross Owen
1ef5129fde Variable i2s bit width (#331)
- Add support for variable width I2S (via XUA_I2S_N_BITS)
- Add support for variable width TDM (again via XUD_I2S_N_BITS when XUA_PCM_FORMAT=XUA_PCM_FORMAT_TDM)
- Includes support for xcore as I2S/TDM master and slave
- Add testing of the the above to test_i2s_loopback
- Rationalised test config building in test_i2s_loopback
- Documentation updated
2023-06-08 15:31:12 +01:00
Ross Owen
b1fe49aff3 Conflicted merge 2023-06-02 14:06:13 +01:00
Brennan Magee
d3ad29e8a6 Merge pull request #330 from BrennanGit/fix/jenkins_windows_bat_sh
Use bat not sh for windows builds on Jenkins
2023-05-31 09:38:31 +01:00
Brennan Magee
17944ad908 Use bat not sh for windows builds on Jenkins
This was causing an issue where the windows workspaces could not be cleared.
2023-05-30 17:08:32 +01:00
danielpieczko
131dd252c0 Merge pull request #329 from danielpieczko/jenkins_windows_build_fix
Use withVS instead of runVS to use the latest Jenkins Windows agents
2023-05-19 09:20:11 +01:00
Daniel Pieczko
23d043630f Use withVS instead of runVS to use the latest Jenkins Windows agents 2023-05-19 09:03:33 +01:00
Ross Owen
761a33f5e4 Update CHANGELOG.rst 2023-05-18 10:07:25 +01:00
Ross Owen
12ec1d7536 module_build_info: lib_xud 2.2.2 -> 2.2.3 2023-05-18 10:05:30 +01:00
Ross Owen
2dba6dce36 Update CHANGELOG.rst 2023-05-18 10:04:36 +01:00
Ross Owen
9cf931898e Move check for XUA_USB_EN after include of xua.h (#325) 2023-05-17 14:55:37 +01:00
Ross Owen
9b104af8cf Merge branch 'develop' into develop 2023-05-17 14:00:38 +01:00
Ross Owen
c469dd6cde Changelog update 2023-05-17 13:58:56 +01:00
Ross Owen
b238196f74 Copyright comment only 2023-05-17 13:55:41 +01:00
Ross Owen
e9586b59d3 Move check for XUA_USB_EN after include of xua.h 2023-05-17 13:48:36 +01:00
Ross Owen
6d168b3209 Merge pull request #321 from TDW89/fix/SPDIF-api
SPDIF api fix
2023-05-17 11:05:57 +01:00
Ross Owen
d301fef6d7 Merge pull request #324 from xross/fix/sw_usb_audio_156
Fix for exception when entering DSD mode (also some tidies)
2023-05-15 10:24:47 +01:00
Ross Owen
1f4e9a99b8 Changelog update 2023-05-12 17:36:04 +01:00
Ross Owen
981ea78be7 Fix for exception when entering DSD mode (also some tidies) 2023-05-12 17:22:47 +01:00
Ross Owen
6cee90d876 Fix audio interrupt endpoint type
Note, this has no functional change
2023-04-17 12:23:27 +01:00
Tom Williams
79d14f8b59 changed to use spdif_rx from SpdifReceive 2023-04-05 17:34:33 +01:00
danielpieczko
05dcb8f3ab Merge pull request #323 from danielpieczko/fix/mixer_init
Fix memory corruption during initialisation of mixer weights
2023-04-04 14:54:57 +01:00
Daniel Pieczko
4e7ddb4036 Fix memory corruption during initialisation of mixer weights 2023-04-04 14:31:35 +01:00
Ross Owen
e8fcc80415 Merge pull request #322 from xross/fix/sw_usb_audio_152
Tidy up of volume control. Removal of xc_ptr.h in favour of built in xc pointers
2023-04-04 14:15:07 +01:00
Ross Owen
71a657dc9a Tidy up of volume control. Removal of xc_ptr.h in favour of built in xc pointers. 2023-04-04 12:37:59 +01:00
Tom Williams
ccfca90451 removed referance to outdated header file, changed for the api file 2023-03-22 15:56:28 +00:00
Ross Owen
cb379f5bfb 'Release: 3.4.0' 2023-03-15 13:02:04 +00:00
Ross Owen
e2c36a9a95 xpd: Cleaned up whitespace 2023-03-15 13:00:39 +00:00
Ross Owen
7e3ae59acc Changelog update and version bump 3.3.1 -> 3.4.0 2023-03-15 12:28:39 +00:00
Ross Owen
f1f453921b Merge pull request #320 from xross/fix/mixer_lock
Improve mixer control protocol to avoid deadlock
2023-03-14 12:52:44 +00:00
Ross Owen
7703fc1a7d Fixed build warning when mixer not enabled 2023-03-14 11:49:08 +00:00
Ross Owen
53a65344fc Improve mixer control protocol to avoid deadlock 2023-03-14 11:48:54 +00:00
Ross Owen
3b2814f8cb Merge pull request #319 from xross/fix/spdif_output_opts 2023-03-13 16:50:40 +00:00
Ross Owen
55a62cf589 - Fixed build issue with !FAST_MIXER
- Fixed issue with !OUT_VOLUME_AFTER_MIX not being respected
2023-03-13 15:50:45 +00:00
Ross Owen
4a84c3e1ec OUT_VOLUME_IN_MIXER enabled by default 2023-03-13 15:49:54 +00:00
Ross Owen
b17f585004 Decouple optimisation for when output slot size = 4 (note, trades off code size) 2023-03-13 14:33:22 +00:00
Ross Owen
57593bfea3 Fixed issue with STREAM_FORMAT_OUTPUT_RESOLUTION_32_BIT_USED be set incorrectly 2023-03-13 14:31:53 +00:00
Ross Owen
8dc77090bf Merge pull request #318 from xross/develop
Reinstate check for current samplerate before changing
2023-03-09 16:42:26 +00:00
Ross Owen
9c20fab216 Updated copyright comment 2023-03-09 15:32:15 +00:00
Ross Owen
cf1940245f Return value of XUD_DoSetRequestStatus in Samp freq change 2023-03-09 15:24:21 +00:00
Ross Owen
837b648bbc Reinstate check for current samplerate before changing 2023-03-09 15:22:58 +00:00
Ross Owen
c1159143ea Fastmix.S now uses defines from xua.h 2023-03-09 14:56:54 +00:00
Ross Owen
2964861b70 Fixed xua.h including in asm files 2023-03-09 14:51:32 +00:00
Ross Owen
208491fe51 Added mixer control unit tests (#316)
* Added test_mixer_routing_output_ctrl
* Added test_mixer_routing_input_ctrl 
* Some minor mixer test and code improvements
* Update lib_xud dep version requirement
2023-03-08 10:53:33 +00:00
TDW89
3fe4593b52 Mixer Host App: Multi device error handeling & device ID agnostic (#315)
Removed device product ID requirement from macOS and added error messages when multiple devices are connected
2023-03-02 16:01:17 +00:00
TDW89
49a116c705 Minor updates (#314)
* SDK location can now set in makefile
* Mixer requirements added to readme
* Uncommented previously broken mixer example from docs as this functionality is now working
* Fixed windows build & runtime info in README
2023-03-01 10:59:00 +00:00
Ross Owen
eee5b474a0 Merge pull request #312 from TDW89/unify_win_osx_code
Unify win osx code
2023-02-20 11:56:04 +00:00
Ross Owen
4655a07542 Merge pull request #313 from xross/develop 2023-02-17 14:04:14 +00:00
Ross Owen
c578bb92d5 Fix build issue with volume processing in mixer (missing xc_ptr func) 2023-02-17 12:10:51 +00:00
Tom Williams
d5a614df55 removed old usb_mixer files 2023-02-15 14:28:27 +00:00
Tom Williams
495140ab8d adding OSX\usb_mixer.cpp changes from mixer tests branch to the combined usb_mixer.cpp file 2023-02-15 13:12:28 +00:00
Tom Williams
f53c1bab09 fixed merge conflict in OSX makefile 2023-02-15 11:47:28 +00:00
Ross Owen
0c6d947e67 Merge pull request #307 from xross/feature/mixer_tests
Feature/mixer tests
2023-02-09 10:51:08 +00:00
Tom Williams
ee271e3769 fixed typos and build issues 2023-02-08 17:49:58 +00:00
Ross Owen
950beb55cb - Fixed ifndef check
- Fixed mix map update
2023-02-08 17:06:08 +00:00
Tom Williams
ca3276792a initial unified version of usb_mixer.cpp 2023-02-08 16:58:18 +00:00
Ross Owen
e26b934233 Conflicted merge from upstream/develop 2023-02-08 13:58:25 +00:00
Ross Owen
51629dba24 Merge pull request #310 from TDW89/host_usb_win
Host usb win pull_v2
2023-02-08 13:56:46 +00:00
Ross Owen
c5e944d73d Use of storeShort function in mixer weight read and comment updates 2023-02-08 13:18:28 +00:00
Ross Owen
22a3d5e043 Added array to size to extern to fix sizeof usage error 2023-02-08 12:20:42 +00:00
Ross Owen
58f691078d Added range checking when getting/setting mixer weights 2023-02-08 12:04:38 +00:00
Ross Owen
f80d7647e0 - Make usage (of lack of) of CS when setting/getting mixer weights more clear in the implementation
- Fix typo in IN_VOLUME_IN_MIXER define
2023-02-08 11:59:13 +00:00
Tom Williams
fe697929bc merge testing branch and osx updates into branch 2023-02-08 11:59:07 +00:00
Tom Williams
b265ccd8bf Merge remote-tracking branch 'xmos/develop' into develop
bringing personal fork up to date
2023-02-08 10:39:25 +00:00
Ross Owen
6c2e7e3042 Fixed issue setting mix maps (#308) 2023-02-08 10:02:32 +00:00
Ross Owen
15ca5ec281 Fixed unused var warning 2023-02-07 16:35:38 +00:00
Ross Owen
71aa64425d Added missing bounds checking when setting host and device maps in the mixer 2023-02-07 12:14:19 +00:00
Ross Owen
9080990234 Fixed typo in define check 2023-02-06 23:44:20 +00:00
Ross Owen
6d8cf9913f Increase timeout cycles for test_mixer_routing_output 2023-02-06 23:42:33 +00:00
Ross Owen
60040de58f Further build issue fixes and copyright comments 2023-02-06 21:08:47 +00:00
Ross Owen
27a59ab3bc - Fixed MIXER define usage in main
- Fixed unsafe pointer usage when MAX_MIX_COUNT=0
- Fixed syntax error building mixer when no features enabled relating to empty switch statement
2023-02-06 21:05:48 +00:00
Ross Owen
317e27e421 - Rationalised MIXER defines and usage
- Further removal of xc_ptr type usage in mixer in favour of native xc pointers
2023-02-06 20:28:29 +00:00
Ross Owen
035c20e01c Fixed build issue in mixer when FAST_MIXER not used 2023-02-06 18:14:48 +00:00
Ross Owen
ef97d667de Further moving of mixer from xc_ptr type to XC pointers 2023-02-06 18:09:33 +00:00
Ross Owen
0e07dc29bc Fix issue in mixer host app when retrieving mixer input strings. Also firmed up some usage error checking. 2023-02-03 11:09:43 +00:00
Ross Owen
43f77c177d Small updates to mixer control README 2023-02-03 11:08:23 +00:00
Ross Owen
6754f812c9 Fixed issues with setting mix map in mixer host app 2023-02-03 11:08:06 +00:00
Ross Owen
fc732b8512 Updated changelog 2023-02-03 11:06:40 +00:00
Ross Owen
39ed235476 Removed old module_description file 2023-02-03 11:06:23 +00:00
Ross Owen
0d7224bd6d Added -arch for to mixer host app makefile 2023-02-03 11:06:13 +00:00
Ross Owen
fd4dfd40a9 Tidy .gitignore 2023-02-03 11:05:21 +00:00
Ross Owen
3d50c96595 - Removed dead XTA pragmas and code from mixer
- Added some more asserts to mixer
2023-02-03 10:59:20 +00:00
Tom Williams
379e8eb54c changed jenkins file to use sh rather than runVS 2023-02-01 16:29:05 +00:00
Tom Williams
63763cf4f5 fixed progect file & typo in jenkinsfile 2023-02-01 15:50:42 +00:00
Tom Williams
b18c34fb0f OSX makefile changed to work on M1, VS project file changed to 2019 (toolset 142) and Jenkins file now builds and archives the binaries 2023-02-01 14:11:47 +00:00
Tom Williams
64d65afeaf project file fixes 2023-02-01 13:43:53 +00:00
Tom Williams
7a47d70229 Revert "added path variable to link project to sdk"
This reverts commit cffd35d146.
2023-02-01 13:40:54 +00:00
Ross Owen
ce8e5a6dbb Merge branch 'develop' into feature/mixer_tests 2023-02-01 12:01:47 +00:00
Ross Owen
bbed806aab Merge remote-tracking branch 'upstream' into develop 2023-02-01 12:01:21 +00:00
Ross Owen
9af31b8c70 Merge pull request #305 from TDW89/host_usb_mixer_control
host_usb_mixer_control_OSX_support
2023-02-01 12:00:45 +00:00
Ross Owen
73955c1a4c - Added mixer related defines to reduce use of magic numbers
- Increases debug output when DEBUG flag set
- Removed some dead code
- Increased alignment of asm mixer functions
- Removed some usages of “xc_ptr” type in favour of native pointers in XC
- Added some asserts to mixer
- Added test_mixer_routing_input
- Moved test_mixer_routing_output to use shared code
2023-02-01 11:54:48 +00:00
Tom Williams
cffd35d146 added path variable to link project to sdk 2023-01-25 16:31:05 +00:00
Tom Williams
ab535e0fb3 removed temporary debug code 2023-01-25 11:07:49 +00:00
Tom Williams
17b039dce8 licence updates 2023-01-25 10:48:44 +00:00
Tom Williams
7a0d0e1f97 Initial windows commit 2023-01-25 10:23:57 +00:00
Tom Williams
2f31260612 updated copyright headers 2023-01-18 16:51:47 +00:00
Tom Williams
9922190450 removed versioning and license files as they are now part of the top level. added the help option to the readme 2023-01-18 16:01:08 +00:00
Ross Owen
0ce91bec90 Copyright comment 2023-01-17 12:12:46 +00:00
Ross Owen
2404eaf35f Remove extern, mark static inline 2023-01-17 11:53:44 +00:00
Ross Owen
8966ad1bb9 Add external linkage to inline DoSampleTransfer 2023-01-17 11:39:22 +00:00
Ross Owen
513761ef5b Moved DoSampleTransfer to a header file so it can still be inlined (but also used in unit tests). Resolves fails in test_i2s_loopback 2023-01-17 11:33:52 +00:00
Ross Owen
da7c45500d - Added test_mixer_routing_output
- Various buffers no longer marked static to allow for easier unit testing 
- Added some comments and removed some dead code from the implementation
- Moved mixer control comms to functions for unit test convenience
2023-01-16 17:28:04 +00:00
Ross Owen
395c88cb22 - Removed unused mixer variable.
- Use of mixer defines rather than fixed values
2023-01-10 11:27:37 +00:00
Tom Williams
94e58edfaf documentation clarifications and some spelling / grammer fixes 2022-12-21 17:22:39 +00:00
Tom Williams
9f00f9159a improvements to documentation 2022-12-21 15:07:14 +00:00
Tom Williams
785a857ca8 moved mixer control to correct path 2022-12-01 09:37:20 +00:00
Tom Williams
3130088c91 Initial commit for host_usb_mixer_control 2022-11-23 17:53:47 +00:00
Ross Owen
c51ee0c460 Removed extra whitespace from example makefiles 2022-11-21 20:05:49 +00:00
danielpieczko
17ed636a74 Merge pull request #303 from danielpieczko/no_usb_chans_in
Avoid calling SetupZerosSendBuffer when there are no IN eps
2022-11-16 10:06:03 +00:00
Daniel Pieczko
0db1b08948 Add changelog entry 2022-11-11 08:56:20 +00:00
Daniel Pieczko
9c460f753f Avoid calling SetupZerosSendBuffer when there are no IN eps 2022-11-10 16:44:34 +00:00
danielpieczko
6a9537fb69 Merge pull request #302 from danielpieczko/develop
Revert TDM ADC clocking change from commit a1946f3
2022-11-07 14:29:16 +00:00
Daniel Pieczko
abfa3a2011 Revert TDM ADC clocking change from commit a1946f3 2022-11-07 08:59:56 +00:00
xross
a1946f340a Remove TDM ADC clocking on neg edge 2022-11-01 19:24:25 +00:00
xross
28be17282f 'Release: 3.3.1' 2022-10-26 18:33:46 +01:00
Ross Owen
a1082b1dfd Documentation
Documentation updates and version bump
2022-10-26 17:48:51 +01:00
xross
2183dd1b53 'Release: 3.3.0' 2022-10-25 19:19:43 +01:00
xross
16ce73391a xpd: Cleaned up whitespace 2022-10-25 19:18:28 +01:00
xross
3fff130e4e Removed unused lib_device_control dependency from AN00246 2022-10-25 18:52:59 +01:00
xross
155dc9a21a Update lib_xud dep version 2022-10-25 18:24:57 +01:00
xross
4f38e40f04 Changelog update 2022-10-25 13:41:23 +01:00
xross
036ebc0d33 Version bump and changelog update 2022-10-25 13:36:12 +01:00
Ross Owen
51270516e4 Merge branch 'master' into release/v3.3.0 2022-10-25 13:24:06 +01:00
xross
e86e9a156b Fix typo in define name 2022-10-19 14:20:51 +01:00
xross
f5da215428 Build fix for XUA_SYNCMODE == XUA_SYNCMODE_ADAPT 2022-10-19 14:03:02 +01:00
xross
9e5e196073 Merge branch 'develop' of github.com:xross/lib_xua into develop 2022-10-13 16:12:54 +01:00
xross
7500ed9a31 Conflicted merge from develop 2022-10-13 16:10:17 +01:00
xross
918e2ed0f1 Removed some build warnings and updated comments for doc inclusion 2022-10-13 16:08:19 +01:00
Ross Owen
77b20c13dc Add lib_adat to dep list (#293)
Add lib_adat to dep list
2022-10-07 11:22:19 +01:00
Ross Owen
a8d9df4107 Update module_build_info 2022-10-07 10:31:43 +01:00
xross
e04373d4a6 Add lib_adat to dep list 2022-10-07 09:44:32 +01:00
Ross Owen
22a6a2505a Define SELF_POWERED changed to XUA_POWERMODE and associated defines (#291)
Define SELF_POWERED changed to XUA_POWERMODE and associated defines
2022-10-04 11:24:31 +01:00
Ross Owen
eb86a72882 Updates to documentation (#280)
Documentation updates (including moving of header files
2022-09-30 16:11:53 +01:00
Ross Owen
0c368e0356 Merge pull request #290 from xross/fix/287
Add pad delay to TDM master ADC ports
2022-09-29 15:42:37 +01:00
xross
86bea717da Add pad delay to TDM master ADC ports 2022-09-29 15:26:36 +01:00
Ross Owen
49592f6e24 Merge pull request #288 from xross/fix/287
Fix/287
2022-09-29 12:09:19 +01:00
xross
d754bff62b Manually fix decouple merge 2022-09-28 19:04:33 +01:00
Ross Owen
a08e4535f2 Merge branch 'develop' into fix/287 2022-09-28 19:01:45 +01:00
xross
1259fb68fd Fix build issue with no I2S input 2022-09-28 18:59:18 +01:00
danielpieczko
f24d0c2822 Merge pull request #289 from danielpieczko/decouple_fill_level
Track decouple fill level instead of (incorrect) buffer space left
2022-09-28 14:54:57 +01:00
Daniel Pieczko
dd933ebe55 Add changelog entry 2022-09-28 13:39:43 +01:00
Daniel Pieczko
dde2363481 Remove #error 2022-09-28 12:02:09 +01:00
Daniel Pieczko
30cb913519 Track decouple fill level instead of (incorrect) buffer space left 2022-09-28 11:32:54 +01:00
xross
b7a90a3235 Changelog update 2022-09-28 11:27:12 +01:00
xross
e1d0974912 test_i2s_loopback:
- Add tracing options
- Add TDM testing at 96khz
- Fix up defines
2022-09-28 11:09:33 +01:00
xross
fe39cd7c11 - Set I2S clocks to 8mA drive on XS3
- Set sample-delay on ADC data lines in TDM mode
- Stare some port config code between I2S slave and master modes
2022-09-27 18:02:37 +01:00
xross
6beb1f34ae Tidy up first pulse of clock during startup in TDM mode 2022-09-27 17:59:13 +01:00
xross
351a38fa4b Conflicted merge 2022-09-12 12:35:05 +01:00
Ross Owen
ff6547b75c Merge pull request #286 from xross/fix/284 2022-09-09 17:56:24 +01:00
xross
9c2d77e216 Added example asserts to decouple 2022-09-09 11:21:03 +01:00
xross
4643d14b04 g_curSubSlot_In now int (cast to unsigned) 2022-09-08 18:30:19 +01:00
xross
b38ce229cb Moved various decouple unsigned vars to int 2022-09-08 18:12:29 +01:00
xross
7a2dd0b644 Revert "Updated various vars from unsigned to int in decouple"
This reverts commit 9f105dd48a.
2022-09-08 17:56:08 +01:00
xross
9d6927ade1 Properly initialise g_curUsbSpeed 2022-09-08 17:49:15 +01:00
xross
e6d3c65902 Revert "Updated various vars from unsigned to int in decouple"
This reverts commit 9f105dd48a.
2022-09-08 17:45:28 +01:00
Ross Owen
d6bc7325c4 Merge pull request #285 from xross/fix/284
Decouple tidies
2022-09-08 15:53:11 +01:00
xross
9f105dd48a Updated various vars from unsigned to int in decouple 2022-09-08 14:23:31 +01:00
xross
ea7e20a3d9 Group buffering global declarations together for readability 2022-09-08 12:14:34 +01:00
xross
b982632bdb Merge branch 'feature/adat' into develop 2022-09-07 14:32:44 +01:00
xross
085d222f45 Further rename of ADAT_TX to XUA_ADAT_TX_EN 2022-09-07 14:32:27 +01:00
xross
8b3f5abc86 ADAT related build fixed after define rename 2022-09-07 13:54:11 +01:00
Ross Owen
4f86d2c581 Merge pull request #283 from xross/feature/adat
Feature/adat
2022-09-07 11:42:04 +01:00
xross
0f1e0e1822 Changelog update 2022-09-07 11:21:14 +01:00
xross
23cabe80ee Update copyright date only 2022-09-07 11:01:26 +01:00
Ross Owen
8f77f2a7ca Merge pull request #282 from danielpieczko/develop
Fix build when CHAN_BUFF_CTRL is defined
2022-09-07 10:59:57 +01:00
xross
a3cee96166 Added cast to remove build warning 2022-09-06 17:11:53 +01:00
xross
2d697aab40 ADAT_TX renamed to XUA_ADAT_TX_EN 2022-09-06 17:11:32 +01:00
xross
11f5a9d9e1 ADAT_RX not XUA_ADAT_RX_EN 2022-09-05 16:35:57 +01:00
Daniel Pieczko
5812ce752b Fix build when CHAN_BUFF_CTRL is defined 2022-09-05 16:04:32 +01:00
Ross Owen
3336aa344d Merge pull request #277 from danielpieczko/fix/decouple_buffer_size
Fix insufficient buffering in decouple
2022-08-19 09:11:26 +01:00
Ross Owen
598acc629d Merge pull request #276 from xross/feature/ai_examples 2022-08-09 16:52:49 +01:00
Ross Owen
b7f9dd5781 Update AN00246_xua_example.rst 2022-08-09 11:25:03 +01:00
xross
aea1e97d9d Copyright comment update 2022-08-08 17:03:59 +01:00
xross
769e7b9a99 Doc updates 2022-08-08 17:02:40 +01:00
xross
8204211742 Examples doc updates 2022-08-08 16:59:02 +01:00
xross
a8fb40401c Merge remote-tracking branch 'upstream' into feature/ai_examples 2022-08-08 16:39:19 +01:00
Ross Owen
ce41732440 Merge pull request #274 from xross/feature/sync_tests
Feature/sync tests
2022-08-08 16:38:58 +01:00
xross
c811aac320 Archive documents when build 2022-08-08 16:38:34 +01:00
xross
51f5d1f0b8 Update AN000247 for AI MCAB 2022-08-08 16:34:17 +01:00
Daniel Pieczko
5d331e7f27 Fix insufficient buffering in decouple 2022-08-08 15:24:04 +01:00
xross
f363475529 Moved AN00246 from xCORE-200 to xCORE.ai MC Audio Board 2022-08-08 14:50:31 +01:00
xross
80e6f047ab Add test_support to requirements 2022-08-08 12:02:41 +01:00
xross
dfc406e322 Update Jenkinsfile testing 2022-08-08 11:28:30 +01:00
xross
5a32d60c29 Move Jenkinsfile from xmostest to pytest 2022-08-08 11:23:04 +01:00
xross
b17cc0de6d Copyright and licence comments 2022-08-08 11:15:50 +01:00
xross
5690442a4b - test_sync_clk_basic and test_sync_clk_plugin now run at FS & HS
- test_sync_clk_plugin marked as known failure (now fails as expected for HS and FS)
2022-08-04 19:54:29 +01:00
xross
3a9f2fff3a * Renamed test_sync to test_sync_clk_basic
* Authored test for known issue in sync mode, test_sync_clk_plugin
* Removed some unrequired test related files
2022-08-03 17:25:32 +01:00
xross
2c01f440fd Added basic test for PLL reference generation on Sync mode 2022-08-03 16:50:28 +01:00
xross
2b1909757b Sync related timing defines can now be overridden 2022-08-03 16:45:15 +01:00
xross
43c561c831 Add tracing related options to conftest 2022-08-03 15:12:12 +01:00
xross
2b679d1572 Slight tidy to clockgen 2022-08-03 15:11:49 +01:00
xross
4f36ce4df7 * Sync mode: added basic move to internal clock when SOF clock not available (not change over on plug event is not smooth)
* Sync mode: Removed use of float
2022-08-03 15:11:26 +01:00
xross
9fdacb2903 Remove some use of global resources 2022-07-28 14:15:16 +01:00
xross
a0f5591e0b Auto-format via black 2022-07-21 13:10:47 +01:00
xross
36dedc494c Update to latest test_support api 2022-07-21 13:10:38 +01:00
xross
06822c7499 Conflicted merge 2022-07-13 16:49:48 +01:00
Ross Owen
8157a76667 Merge pull request #273 from xross/feature/bringup_316
Feature/bringup 316
2022-07-11 16:04:29 +01:00
xross
f534537b76 Fix typo in define 2022-07-11 13:43:13 +01:00
xross
1ad26f6bac Update app_test_i2s_loopback for latest API related to TDM 2022-07-11 12:35:07 +01:00
xross
2a8f3b11d9 Updated copyright comment 2022-07-11 12:09:30 +01:00
xross
0659b1c536 Merge remote-tracking branch 'upstream/develop' into feature/bringup_316 2022-07-11 12:06:40 +01:00
Ross Owen
d6abd5d159 Merge pull request #272 from xross/feature/sync
Feature/sync
2022-07-11 12:04:37 +01:00
xross
a913cd85f1 Fixed error message 2022-07-11 11:36:53 +01:00
xross
7e098c7139 Add missing include 2022-07-05 19:22:34 +01:00
xross
5c1773a883 Copyright comment 2022-07-05 19:17:10 +01:00
xross
9401bfff83 - Rename app_test_i2s_loopback to test_i2s_loopback
- Port test_i2s_loopback from xmostest to pytest and test_support
2022-07-05 18:14:05 +01:00
xross
476e3d9f2f app_test_i2s_loopback: Update makefile 2022-07-05 12:30:13 +01:00
xross
438c24d436 Moved legacy tests into tests 2022-07-05 12:05:31 +01:00
xross
5441081927 I2S_MODE_TDM now XUA_PCM_FORMAT 2022-06-29 13:07:38 +01:00
xross
bb0dec4923 - Renamed i_sync to i_pll_ref.
- Always used i_pll_ref interface from clockgen rather than direct port access
2022-06-28 10:39:01 +01:00
xross
3e0f127b92 Use i_sync for sync signal to CS2100 interface when AUDIO_IO_TILE != PLL_REF_TILE and S/PDIF Rx is enabled. 2022-06-27 19:15:56 +01:00
xross
f3a149076b Re-named SPDIF_RX define to XUA_SPDIF_RX_EN (chanstrings.h was already using this and therefore the S/PDIF Rx strings were incorrect). Also fixes the ADAT Rx strings and string table generation script. 2022-06-27 19:09:08 +01:00
xross
29bd1a575b Fixed IN EP’s getting marked as Async in sync mode 2022-06-22 12:33:42 +01:00
xross
6f56d2ed1a Fixed issue with 44.1k etc in sync mode 2022-06-21 19:29:20 +01:00
xross
e6a8527631 When in sync mode Pll ref pin driving is now via interface to allow flexibility of port/tile 2022-06-21 19:29:07 +01:00
xross
ff42c23a6d Basic support for sync mode streaming 2022-06-21 12:11:09 +01:00
xross
22a79d9231 Descriptor changes to add sync mode (also removed some magic numbers) 2022-06-15 13:55:23 +01:00
xross
66adce4150 'Release: 3.2.0rc1' 2022-06-01 16:41:10 +01:00
xross
638a4f0d16 Bulk copyright comment update 2022-06-01 14:47:58 +01:00
xross
88251feef6 Merge branch 'develop' 2022-06-01 14:40:12 +01:00
xross
a28dbded86 Update reps in module_build info 2022-06-01 14:39:39 +01:00
xross
51d5c4bdb2 Changelog update 2022-06-01 14:34:35 +01:00
xross
c6c1b48839 'Release: 3.2.0rc0' 2022-06-01 14:22:44 +01:00
xross
206a895b74 xpd: Cleaned up whitespace 2022-06-01 14:21:44 +01:00
xross
55e01e5b49 Merge branch 'develop' 2022-06-01 14:19:26 +01:00
xross
4ffcef2347 Remove commited pdf file 2022-06-01 14:04:03 +01:00
Ross Owen
9edef4a1f1 Fixes for doc build (#270)
Document moving and rename. Fixes for latest xdoc.
2022-06-01 10:39:02 +01:00
xross
266711caf7 Merge remote-tracking branch 'upstream/develop' into develop 2022-05-30 18:50:33 +01:00
xross
4e5634167b Added CODEOWNERS 2022-05-30 18:48:10 +01:00
xross
d7a9b160c2 Automated changelog dep update 2022-05-30 18:18:42 +01:00
xross
0d8f080604 Moved to version 3.2.0 2022-05-30 18:17:31 +01:00
xross
24d0c51818 Updated dependency versions 2022-05-30 17:59:28 +01:00
xross
41cb59dc8d Removed IAP related defines 2022-05-30 17:59:18 +01:00
xross
fca2ec2058 Comment only 2022-05-30 11:44:12 +01:00
xross
0f8b9dae8c Removed extra bracing and fixed bad comment 2022-05-30 11:44:12 +01:00
xross
d5946b91a4 Resolve device hang on sample rate cange when both mixer cores are running and NUM_USB_CHAN_OUT = 0 2022-05-30 11:44:12 +01:00
Luciano Martin
d3fafdfbac Overwrite output channel descriptors only if output channels are defined (#269)
Overwrite output channel descriptors only if output channels are defined
2022-05-30 11:25:48 +01:00
Ross Owen
0e77b159c6 Merge pull request #262 from xmos/fix/261
Fix checking of return value of GetBuffer() in AudioEndpointRequests_1()
2022-04-26 14:39:21 +01:00
Ross Owen
116e7a5b90 Merge pull request #264 from xmos/fix/263
Fix sourceID of Audio In Output Term when volume control disabled
2022-04-26 14:39:03 +01:00
Ross Owen
f6a6fb9c5c Fix sourceID of Audio In Output Term when volume control disabled
#263
2022-04-26 13:36:25 +01:00
Ross Owen
392e00f989 Fix checking of return value of GetBuffer() in AudioEndpointRequests_1() 2022-04-26 13:26:41 +01:00
Ross Owen
edd34ac157 Merge pull request #251 from xross/fix/250
Enable explicit feedback EP by default
2022-03-29 15:22:52 +01:00
xross
fd58827b88 Fix build issue in AN00248 2022-03-15 12:42:18 +00:00
xross
8bf991eb76 Fixed issue where DSD_NATIVE is always enabled if DSD_CHANS_DAC defined as 0 2022-03-15 11:40:10 +00:00
xross
46a7b7ac22 Fix example builds 2022-03-14 16:17:12 +00:00
xross
ea3dffb05c Changelog update 2022-03-14 11:21:10 +00:00
xross
cf826e910d Copyright date 2022-03-14 11:20:20 +00:00
xross
a270972bf9 Enable explicit feedback EP by default 2022-03-14 11:18:26 +00:00
Brennan Magee
9a25e0538e Merge pull request #249 from kieran-kohtz/feature/jenkinsversion
Update Jenkins Shared Library Version
2022-03-09 15:22:33 +00:00
Kieran Kohtz
93959376c5 Merge remote-tracking branch 'origin/develop' into feature/jenkinsversion 2022-03-09 14:54:12 +00:00
kieran-kohtz
c09e515455 Update jenkins labels 2022-03-09 13:48:59 +00:00
Ross Owen
449a899597 Merge pull request #244 from xross/changelog
Sanitised changelog
2022-03-09 11:43:42 +00:00
Ross Owen
f0cd906730 Merge branch 'develop' into changelog 2022-03-09 11:43:30 +00:00
Ross Owen
1865b2c3f1 Merge pull request #248 from danielpieczko/fix/interface_descriptor_bytes_define
Move INTERFACE_DESCRIPTOR_BYTES definition
2022-03-09 11:41:31 +00:00
kieran-kohtz
2ba4c37363 Removed Brewfile 2022-03-08 16:15:02 +00:00
kieran-kohtz
99e61b0cd9 Removed Brew Labels 2022-03-08 16:15:01 +00:00
kieran-kohtz
2f298f84e5 Updated jenkins shared library version to v0.18.0 2022-03-08 16:15:00 +00:00
Ross Owen
6a0688d908 Update xmos_jenkins_shared_library 0.16.2 -> 0.18.0 2022-03-08 13:12:42 +00:00
Daniel Pieczko
0ce5b17c2b Move INTERFACE_DESCRIPTOR_BYTES definition 2022-03-08 12:05:05 +00:00
Ross Owen
fdc99ffccb Merge pull request #175 from xmos/QuinnWang-patch-1
decouple update for DFU "fake" SET_SAMPLE_FREQ special processing
2022-03-07 11:11:23 +00:00
xross
1f994be63e Merge branch 'develop' of github.com:xmos/lib_xua into develop 2022-03-03 12:42:31 +00:00
xross
3e87d0ec30 Added missing default case 2022-03-03 12:42:21 +00:00
Ross Owen
136fbcf08c Merge pull request #247 from danielpieczko/fix/hid_report_xua_include
Include xua_conf_full.h before checking HID_CONTROLS to ensure it's d…
2022-03-02 15:18:58 +00:00
Daniel Pieczko
c027e2df18 Include xua_conf_full.h before checking HID_CONTROLS to ensure it's defined 2022-03-02 13:45:24 +00:00
Ross Owen
2931d41882 Merge pull request #246 from danielpieczko/fix/ep_buffer_ifdefs
Fix ifdefs/endifs in ep_buffer.xc
2022-03-02 11:05:38 +00:00
Daniel Pieczko
7a493ca479 Fix ifdefs/endifs in ep_buffer.xc 2022-03-02 09:25:52 +00:00
Michael Banther
769bfa1a5a Remove unnecessary HID functionality (#243)
* Include HID report functionality only when the HID feature is enabled
* Define HID_CONTROLS=1 so HID unit tests work correctly
2022-02-21 13:20:52 +00:00
xross
7198dbf02c Sanitised changelog 2022-02-18 16:01:06 +00:00
danielpieczko
29c9b3ea75 Support lib_i2c in legacy_tests (#242)
Support lib_i2c in legacy_tests and remove dummy module_locks
2022-02-18 11:39:28 +00:00
Ross Owen
0ad3048e63 Update README.rst 2022-01-21 11:48:38 +00:00
Ross Owen
de8fbd428b Update README.rst 2022-01-21 11:47:45 +00:00
Ross Owen
1e5d57ae2c Update README.rst 2022-01-20 16:48:29 +00:00
Michael Banther
073bc9552a Merge pull request #240 from xmos/release/v3.1.0
Release v3.1.0
2022-01-13 14:04:36 +00:00
Michael Banther
39fda0a178 Merge pull request #239 from xmos/develop
Prepare release v3.1.0
2022-01-13 12:31:34 +00:00
Michael Banther
91d16b13a2 Merge pull request #238 from ACascarino/changelog_update
Upversioned, updated changelog, and removed .?project files
2022-01-13 11:42:42 +00:00
Angel Cascarino
ad889247a0 Merge pull request #3 from mbanth/changelog_update
Update module_build_info
2022-01-13 10:14:01 +00:00
mbanth
a7675ba997 Require lib_locks v2.0.3 or later since that's the latest released version 2022-01-13 10:04:56 +00:00
Angel Cascarino
41c6b90549 Pruned extraneous whitespace. 2022-01-12 17:57:16 +00:00
Angel Cascarino
b62782faa0 Moved the word "to" one line up in the changelog 2022-01-12 17:50:06 +00:00
Angel Cascarino
8c30ce60f2 Removed trailing whitespace in changelog entry 2022-01-12 17:41:52 +00:00
Angel Cascarino
b3d66f4ca4 Upversioned, updated changelog, and removed .?project files 2022-01-12 17:37:48 +00:00
Michael Banther
bdb5c56f7c Merge pull request #236 from ACascarino/feature/set_idle_work
Add swlocks to HID files, and correct operation of SetIdle
2022-01-12 16:35:39 +00:00
Angel Cascarino
a08f5d78fb Another code neatness change 2022-01-12 16:09:54 +00:00
Angel Cascarino
515ec9c022 More code neatness changes 2022-01-12 16:08:46 +00:00
Angel Cascarino
c0104fcf48 Merge branch 'feature/set_idle_work' of github.com:ACascarino/lib_xua into feature/set_idle_work 2022-01-12 15:44:09 +00:00
Angel Cascarino
f88e5877be Documentation updates 2022-01-12 15:44:05 +00:00
Angel Cascarino
d33397164b Whitespace changes in ep_buffer.xc 2022-01-12 15:30:43 +00:00
Angel Cascarino
a087e31b0f Merge pull request #2 from lucianomartin/feature/dummy_module
Add dummy module_locks
2022-01-12 14:54:35 +00:00
Angel Cascarino
418622c593 Disable debug printing in hid.xc 2022-01-12 14:49:00 +00:00
Angel Cascarino
6b0688d23e Updated ep_buffer to match 3610's xua_buffer_lite 2022-01-12 14:47:40 +00:00
lucianom
37ce235594 Add dummy module_locks 2022-01-12 14:30:30 +00:00
lucianom
64cbd072f4 Revert "Remove dependency to lib_locks"
4d68b26b42
2022-01-12 12:51:51 +00:00
lucianom
9b0e541e95 Revert "Use test view"
662b24386d
2022-01-12 12:51:43 +00:00
lucianom
4d68b26b42 Remove dependency to lib_locks 2022-01-12 12:37:33 +00:00
lucianom
662b24386d Use test view 2022-01-12 12:28:44 +00:00
Angel Cascarino
c60da7fd82 Reversed renaming function to avoid upversioning 2022-01-11 17:57:18 +00:00
Angel Cascarino
45ab345521 Update copyright 2022-01-11 16:35:44 +00:00
Angel Cascarino
692c4ee7ed Missed brace 2022-01-11 16:31:07 +00:00
Angel Cascarino
5fa86dabbb Updated unit tests to remove "reportAll" tests 2022-01-11 16:27:28 +00:00
Angel Cascarino
9863b37ead Remove ref. to IsReportIdInUse in ep_buffer 2022-01-11 16:12:05 +00:00
Angel Cascarino
46f516ddbc Updated header 2022-01-11 16:10:21 +00:00
Angel Cascarino
a404138903 Removed "reset" ability of UpdateReportPeriod
In the event where an invalid reportDuration is supplied, previously HidUpdateReportPeriod
would reset the period for the specified ID to
ENDPOINT_INT_INTERVAL_IN_HID * MS_IN_TICKS.
As the default period is now application-specific,
hid.xc cannot know what the appropriate value is,
and so this has been removed.
2022-01-11 16:06:11 +00:00
Angel Cascarino
147b5fb7f7 Corrected hidAreReportIDsInUse 2022-01-11 15:58:42 +00:00
Angel Cascarino
ebb3a0bfcb Merge branch 'feature/set_idle_work' of github.com:ACascarino/lib_xua into feature/set_idle_work 2022-01-11 15:56:35 +00:00
Angel Cascarino
ec87a43dbf Removed "0 means all" logic throughout 2022-01-11 15:56:32 +00:00
Michael Banther
b0a8735623 Merge pull request #1 from mbanth/feature/set_idle_work
Feature/set idle work
2022-01-11 14:29:42 +00:00
mbanth
93721f3144 Added missing dependency change log entry 2022-01-11 14:24:32 +00:00
mbanth
d7b41cd35f Update copyright date range 2022-01-11 14:22:03 +00:00
Angel Cascarino
d3560ca7fe Merge branch 'feature/set_idle_work' of github.com:ACascarino/lib_xua into feature/set_idle_work 2022-01-11 12:26:04 +00:00
Angel Cascarino
ff86ac8d2a Added debug printing 2022-01-11 12:26:00 +00:00
Angel Cascarino
eebd438620 Update module_build_info 2022-01-11 11:56:29 +00:00
Angel Cascarino
5bb44c54e1 Fixed the fix for swlock work 2022-01-11 11:42:41 +00:00
Angel Cascarino
36d325a457 Fixed swlock change 2022-01-11 11:40:31 +00:00
xmos-jenkins
d40ede1525 Merged in older changes 2022-01-11 11:32:14 +00:00
xmos-jenkins
4f37069efb Merge remote-tracking branch 'angel/feature/multiple_hid_report_exception' into feature/set_idle_work 2022-01-11 11:27:09 +00:00
xmos-jenkins
9f667d96f8 Added alternative hidIsGetIdleSilenced function 2022-01-11 11:23:28 +00:00
Angel Cascarino
c352ed1132 Alphabetise main functions in hid_report.c 2022-01-07 17:46:25 +00:00
Angel Cascarino
a18e5a976f Change hwlock to swlock in hid_report.c 2022-01-07 17:30:27 +00:00
mbanth
737c5bd7d0 Manually revert to capture the current time within the HidIsSetIdleSilenced() function 2022-01-05 17:52:07 +00:00
mbanth
7a0cfca280 Experiment with obtaining the time used in HidIsSetIdleSilenced() from outside of the function 2022-01-05 17:01:28 +00:00
mbanth
3988906e39 Add locks around references to included static variables. 2022-01-05 14:58:04 +00:00
Angel Cascarino
cd0248c162 Removed locks in isReportDesciptorPrepared 2022-01-04 14:19:54 +00:00
Angel Cascarino
55de7a8abd Removed locks from hidSetReportItem 2022-01-04 14:07:06 +00:00
Angel Cascarino
911c8c51f2 Change initialisation of hwlock 2022-01-04 13:48:48 +00:00
Angel Cascarino
fa9d483d2f Updated hwlock allocation 2022-01-04 13:23:15 +00:00
Angel Cascarino
1ae9c55477 Added hardware locks 2022-01-04 12:37:05 +00:00
Michael Banther
94a05a8ece Merge pull request #232 from xmos/release/v3.0.0
Release v3.0.0
2021-12-24 15:55:13 +00:00
Michael Banther
a93987d281 Merge pull request #227 from xmos/develop
Merge develop into release/v3.0.0
2021-12-23 15:50:22 +00:00
Michael Banther
4f35551547 Merge pull request #230 from CiaranWoodward/feature/unit-functional
Modify unit test report descriptor to match the working 3610
2021-12-23 15:06:48 +00:00
Ciaran Woodward
cb774f3c11 Modify unit test report descriptor to match the working 3610 2021-12-23 12:38:27 +00:00
Michael Banther
66a611f4fd Merge pull request #229 from mbanth/feature/multiple_hid_reports
Iterate through the correct set of HID Report IDs, plus some clean up.
2021-12-23 11:04:18 +00:00
mbanth
b61ea63d40 Iterate through the correct set of HID Report IDs, plus some clean up. 2021-12-23 10:31:07 +00:00
Michael Banther
8c132af069 Merge pull request #228 from CiaranWoodward/feature/multiple_hid_reports
Fix the handling of setidle requests
2021-12-22 17:15:05 +00:00
Ciaran Woodward
93229a7509 Fix refactoring error 2021-12-22 16:52:54 +00:00
Ciaran Woodward
466cc0abbb Fix the handling of setidle requests 2021-12-22 16:29:03 +00:00
Michael Banther
d5d5bd0637 Merge pull request #226 from CiaranWoodward/feature/multiple_hid_reports
Support multiple HID Reports & update examples for new API
2021-12-21 16:53:54 +00:00
Ciaran Woodward
ee6c22bd37 Loosen up usage page check in validate
While the implementation can only support one usage per report id,
the report collections themselves have usages, which are acceptable.
This change allows these usages to pass the validate check.
2021-12-21 12:43:34 +00:00
Ciaran Woodward
703a277059 Remove debug printfs 2021-12-21 12:18:57 +00:00
Ciaran Woodward
b88342ab2b Add new hid page ID constant 2021-12-21 11:21:17 +00:00
Ciaran Woodward
e7f9428731 Fix typos in unit tests 2021-12-20 17:34:01 +00:00
Ciaran Woodward
6400e146d0 Add an iterator style mechanism for iterating through report IDs 2021-12-20 17:26:08 +00:00
Ciaran Woodward
da114a1dea Merge pull request #1 from ACascarino/feature/multiple_hid_reports
Update lib_xua multiple_hid_reports from review
2021-12-20 17:21:25 +00:00
Angel Cascarino
77398218b5 Apply suggestions from code review
Co-authored-by: Ciaran Woodward <ciaranwoodward@gmail.com>
2021-12-20 17:17:34 +00:00
Angel Cascarino
244a7718a1 Corrected type in documentation 2021-12-20 17:11:50 +00:00
Angel Cascarino
e71ffdba00 Missed a semicolon... 2021-12-20 17:10:48 +00:00
Angel Cascarino
625123e4a6 Clarified ep_buffer.xc setup stall
Added getter hidIsReportDescriptorPrepared(),
allowing more readable logic in the setup phase of
ep_buffer.xc
2021-12-20 16:45:24 +00:00
Angel Cascarino
548992ab5c Removed USB_HID_REPORT_ID_CONSUMER as per review. 2021-12-20 15:46:15 +00:00
Ciaran Woodward
ccc1ee4021 Fix inverted isSilenced logic, add INVALID_ID constant 2021-12-20 14:47:20 +00:00
Angel Cascarino
ab96a726d6 Altered format on test report_descriptor.h 2021-12-20 12:51:26 +00:00
Ciaran Woodward
d3d9b5ba23 Add hidReportIdInUse command to determine whether report IDs are used 2021-12-17 14:35:23 +00:00
Ciaran Woodward
c3e95a379f Add some report time tests & fix comments] 2021-12-15 12:44:39 +00:00
Ciaran Woodward
5be97ac227 Begin work on setidle unit tests 2021-12-14 14:15:48 +00:00
Ciaran Woodward
8799f5f36e Refactor HID report descriptor validation function 2021-12-13 12:51:40 +00:00
Ciaran Woodward
71dd8b5409 Add descriptor validation function & fix issues it found
Note this is in progress, I either want to move the check function somewhere else,
or convert the printf calls to something else (I imagine some kind of log function
exists?)
2021-12-10 18:00:04 +00:00
Ciaran Woodward
e41aed6ffb Update examples to work with new API 2021-12-10 11:46:01 +00:00
Ciaran Woodward
548ccebb27 Propegate constants and helper macro around codebase 2021-12-10 11:32:04 +00:00
Ciaran Woodward
3895b486ab Add constants header for common constants; helper macro for header 2021-12-10 10:45:54 +00:00
Michael Banther
ebeae1fa17 Merge pull request #2 from CiaranWoodward/feature/multiple_hid_reports_tests
Update tests to work with new report-id api
2021-12-09 18:45:08 +00:00
Ciaran Woodward
f328deb336 style 2021-12-09 18:02:42 +00:00
Ciaran Woodward
353d7c3c8d Fix merge issues 2021-12-09 17:28:16 +00:00
Ciaran Woodward
5f971af054 Merge remote-tracking branch 'michael/feature/multiple_hid_reports' into feature/multiple_hid_reports_tests 2021-12-09 17:19:04 +00:00
mbanth
2b5dab51b5 Add explicit initialization of static variables in hid_report.c 2021-12-09 16:15:29 +00:00
Ciaran Woodward
19be25809b Fix implementation of hidGetReportIdLimit to match docs & usage 2021-12-09 16:10:28 +00:00
mbanth
26cac1abb1 Update includes of xua_hid_report.h 2021-12-09 15:58:51 +00:00
mbanth
03a5024520 Renamed xua_hid_report_descriptor.h to xua_hid_report.h 2021-12-09 15:45:05 +00:00
mbanth
08ed5ee668 Renamed hid_report_descriptor.c to hid_report.c 2021-12-09 15:44:19 +00:00
mbanth
2b96ea0171 Increment major version and add change log entries 2021-12-09 15:29:45 +00:00
Ciaran Woodward
1b186a0c2f Remove test-specific information from hid_report_descriptor.h 2021-12-09 14:55:38 +00:00
Ciaran Woodward
ed7a33b40f Write a bunch of unit tests that exercise the HID report IDs 2021-12-09 11:45:03 +00:00
Ciaran Woodward
459ce6bd63 Begin building up a set of multi-report unit tests
This work is starting by expanding the tests written for
single report purposes. I have also added a couple of
extra simple tests that made sense (under/overflow of
report IDs) as I went along.
2021-12-08 17:55:33 +00:00
Ciaran Woodward
3819f30ad0 Enable waf building unit tests in different confgurations 2021-12-08 15:47:15 +00:00
Ciaran Woodward
79e256f829 Update existing unit tests to work with the new API 2021-12-08 12:34:14 +00:00
Ciaran Woodward
be90779db5 Temporary workaround for ENDPOINT_INT_INTERVAL_IN_HID definition 2021-12-08 12:33:37 +00:00
Ciaran Woodward
de382e5cc0 Merge remote-tracking branch 'angel/feature/multiple_hid_reports' into feature/multiple_hid_reports_tests 2021-12-08 11:28:37 +00:00
Angel Cascarino
6dfc934d36 Correct error in hidCaptureReportTime 2021-12-08 11:14:52 +00:00
Ciaran Woodward
7dfd78deb4 Update unit test header to match new report id api 2021-12-08 11:01:33 +00:00
Angel Cascarino
fac0542920 Merge branch 'mbanth:feature/multiple_hid_reports' into feature/multiple_hid_reports 2021-12-08 10:47:55 +00:00
mbanth
8c9e8b11b9 Changes to support the Set Idle request with multiple Report IDs 2021-12-07 18:50:28 +00:00
Angel Cascarino
21b259bc88 Update legacy_test to new HID API 2021-12-07 18:12:00 +00:00
Angel Cascarino
589c16d56c Updated gitignore 2021-12-07 17:17:14 +00:00
mbanth
b4d5cb93f1 Use an unsigned constant with an unsigned variable 2021-12-07 10:35:20 +00:00
mbanth
1d22975fd2 Update HID initialisation and handling to include multiple reports and the effect of the Set Idle command 2021-12-06 17:28:30 +00:00
mbanth
5354d94987 Remove unused pointer 2021-12-06 17:16:11 +00:00
mbanth
171ef30f42 Remove redundant function declaration 2021-12-06 13:53:20 +00:00
mbanth
8c175187c8 Modify hidClearChangePending(), hidIsChangePending() amd hidSetChangePending() to operate on a Report ID basis 2021-12-01 12:26:26 +00:00
mbanth
53f80dfba4 Add documentation 2021-12-01 12:25:18 +00:00
mbanth
21c1e661ae Change static variable names to indicate that they are static. 2021-12-01 09:47:52 +00:00
mbanth
d515458b83 Add id parameter to hidClearChangePending(), hidIsChangePending() and hidSetChangePending(). Correct the name of the underlying static variable. 2021-12-01 09:42:32 +00:00
mbanth
b853589120 Move the HID Clear Pending, Is Pending and Set Pending functions from hid.xc to hid_report_descriptor.c.
These functions are called from the application so they do not belong in hid.xc which contains internal XUA functionality.
2021-11-30 18:29:17 +00:00
mbanth
966d8db9a9 Additional documentation and a minor renaming of an automatic variable 2021-11-30 15:05:37 +00:00
mbanth
dc22b0593f Additional documentation 2021-11-30 15:04:33 +00:00
mbanth
0892ff9a8b Move the declaration of the HID Get Report Limit function and provide its definition 2021-11-29 17:09:26 +00:00
mbanth
65b1b41ec4 Change the interface to UserHIDGetData() and UserHIDRecordEvent() 2021-11-26 16:32:12 +00:00
mbanth
3b6f1c80e2 Move HID_REPORT_COUNT to hid_report_descriptor.h 2021-11-26 16:30:47 +00:00
mbanth
bf9e150310 Use size_t for each index into an array. 2021-11-26 13:40:58 +00:00
mbanth
1857ddbc67 Set constant values explicitly to unsigned. Add access function for HID Report length. Update hidGetReportItem() and hidSetReportItem() to check for correct Reporty ID. Update hidGetReportLength() to report the length of the given HID Report. Update hidGetUsagePage() to iterate across all HID Reports. 2021-11-26 10:50:53 +00:00
mbanth
145c0cb80f Set constant values explicitly to unsigned 2021-11-26 10:46:03 +00:00
mbanth
1fe4fc6771 Safety commit. Builds but not run. 2021-11-25 17:30:30 +00:00
mbanth
88a3d6b20d Initial commit made to keep a safe copy. Builds but will not run and definitely very incomplete. 2021-11-24 16:06:17 +00:00
Ross Owen
33ec43134c Merge pull request #224 from xross/fix/223
fix/223
2021-10-26 14:57:45 +01:00
xross
2bbebc0a39 Further removed of XS1 support items 2021-10-18 17:05:35 +01:00
xross
32af5b7b20 Removed XS1 implementation in fastmix.S 2021-10-18 16:54:54 +01:00
xross
fc6915be6f Removed XS3 related warning from reboot.xc 2021-10-18 16:49:46 +01:00
xross
d9dc7cc7c7 XS2 now special case in DFU flag check 2021-10-18 16:45:07 +01:00
xross
898a6c2410 Remove XS1 related USB port. Also fixed errors related to removing XS1 support from ADAT 2021-10-18 16:38:32 +01:00
xross
da758f48fa Removed remaining references to SU1 devices 2021-10-18 16:37:33 +01:00
Michael Banther
2923f7574b Merge pull request #220 from xmos/release/v2.1.1
Release v2.1.1
2021-09-08 15:02:41 +01:00
Michael Banther
436a268781 Merge pull request #219 from xmos/develop
Prepare release of v2.1.1
2021-09-08 11:28:45 +01:00
Michael Banther
8233ef1d47 Merge pull request #218 from mbanth/feature/fix_hid_set_report_item
Fix hid set report item
2021-08-26 16:52:06 +01:00
mbanth
1109e08dd8 Increment version and add change log entry 2021-08-26 16:25:40 +01:00
mbanth
15f1d4de59 Use correct order of expected vs actual results in test assertions 2021-08-26 16:13:23 +01:00
mbanth
911a82cd83 Add test for the case of a modified item that of length 1 that overwrites data of length 2 2021-08-25 18:16:54 +01:00
mbanth
ec657d1e8d Zero the MSB if given an item of length 1 2021-08-25 18:13:12 +01:00
Luciano Martin
9e82d613bb Merge pull request #217 from xmos/release/v2.1.0
Merge release/v2.1.0 into master
2021-08-20 16:05:48 +01:00
Luciano Martin
eb62940dc6 Merge pull request #215 from xmos/develop
Merge develop into release/v2.1.0
2021-08-20 15:48:30 +01:00
Luciano Martin
ef46bd72b9 Merge pull request #216 from xmos/feature/update_dependency_version
Updare lib_xud dependency version
2021-08-20 15:48:17 +01:00
lucianom
7abcb487a9 Updare lib_xud dependency version 2021-08-20 14:55:05 +01:00
Luciano Martin
e87a53ff83 Merge pull request #214 from lucianomartin/feature/lib_xud_v2_0_0
Update clock blocks to support lib_xud v2.0.0
2021-08-06 11:50:43 +01:00
lucianom
8e05595710 Update clock in unit test 2021-08-06 10:21:38 +01:00
lucianom
ffee831f5d Updated clock blocks to support lib_xud v2.0.0 2021-08-06 08:52:36 +01:00
Michael Banther
ad88e3342e Merge pull request #211 from xmos/release/v2.0.1
Release v2.0.1
2021-07-27 13:06:03 +01:00
Michael Banther
d0986cb37f Merge pull request #210 from xmos/develop
Prepare release v2.0.1
2021-07-26 16:11:48 +01:00
Michael Banther
9d148f68a3 Merge pull request #209 from mbanth/feature/bump_version
Bump version to 2.0.1
2021-07-26 14:47:48 +01:00
mbanth
3b1b7f81dc Bumped version to 2.0.1 2021-07-26 14:23:27 +01:00
Michael Banther
1e4bcf01c7 Merge pull request #208 from mbanth/feature/revert_xud_dependency_version
Revert the dependency on lib_xud to v1.2.0
2021-07-26 13:44:04 +01:00
mbanth
46ce681a88 Revert the dependency on lib_xud to v1.2.0. XVF3510 uses that version. 2021-07-23 18:34:28 +01:00
QuinnWang
cd5f7272c8 decouple update for DFU "fake" SET_SAMPLE_FREQ special processing
DFU will send the AUDIO_STOP_FOR_DFU from endpoint0 to audio core in order to trigger the audio core running dummy_deliver instead of the deliver. The current code didn't distinguish the read SET_SAMPLE_FREQ or "fake" SET_SAMPLE_FREQ (not a real sampFreq, but is AUDIO_STOP_FOR_DFU), so when it is AUDIO_STOP_FOR_DFU, the current decouple code will reset the buffer just as it is sample rate switch, but this will cause the USB hub incorrectly reboot when there is a USB hub connected between XMOS device and the host. The MSFT XUF208 project, using a USB2.0 hub connected to Linux xhci, the error from xhci is "buffer overrun event on the endpoint, followed by a hub re-enabling from khubd. Modified like this commit will solve the problem.
So update decouple for DFU "fake" SET_SAMPLE_FREQ special processing just like what did in the ep_buffer.
2021-01-15 15:56:18 +08:00
234 changed files with 15198 additions and 6435 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @xross

56
.gitignore vendored
View File

@@ -1,25 +1,25 @@
*.log
*.dSYM
*/.build_*/*
*/bin/*
*.o
# XMOS bin files
*.xe
*.vcd
*.swo
*.bin
*/bin/*
# XMOS temp files
.build*
*.a
_build*
*.i
*.s
*.xi
*.i
*.bin
*~
*.a
*.swp
*.*~
*.pyc
.build*
*.o
*/.build_*/*
# Temp files
.DS_Store
test_results.csv
_build*
**/.venv/**
*.*~
*.swp
*.swn
*~
*.swo
# waf build files
.lock-waf_*
@@ -28,3 +28,23 @@ build/
.build*
*.pyc
xscope.xmt
# Traces
*.gtkw
*.vcd
# Host binaries
host_usb_mixer_control/xmos_mixer
# Documentation build
*.pdf
# Misc
*.log
*.dSYM
*.vcd
*.pyc
**/.venv/**
**/.vscode/**
**.egg-info
*tests/logs/*

View File

@@ -1,7 +0,0 @@
tap 'homebrew/core'
brew 'perl'
brew 'cpanm'
brew 'python@2'
brew 'pipenv'

View File

@@ -1,49 +1,182 @@
lib_xua Change Log
==================
3.5.1
-----
* FIXED: Respect I2S_CHANS_PER_FRAME when calculating bit-clock rates
* Changes to dependencies:
- lib_spdif: 5.0.0 -> 5.0.1
3.5.0
-----
* ADDED: Configurable word-length for I2S/TDM via XUA_I2S_N_BITS
* ADDED: Support for statically defined custom HID descriptor
* CHANGED: Rearranged main() such that adding custom code that uses lib_xud
is possible
* CHANGED: bNumConfigurations changed from 2 to 1, removing a work-around to
stop old Windows versions loading the composite driver
* FIXED: Memory corruption due to erroneous initialisation of mixer
weights when not in use (#152)
* FIXED: UserHostActive() not being called as expected (#326)
* FIXED: Exception when entering DSD mode (#327)
* Changes to dependencies:
- lib_spdif: 4.2.1 -> 5.0.0
- lib_xud: 2.2.2 -> 2.2.3
3.4.0
-----
* ADDED: Unit tests for mixer functionality
* ADDED: Host mixer control applications (for Win/macOS)
* CHANGED: Small tidies to mixer implementation
* CHANGED: Improved mixer control channel communication protocol to avoid
deadlock situations
* CHANGED: By default, output volume processing occurs in mixer task, if
present. Previously occurred in decouple task
* CHANGED: Some optimisations in sample transfer from decouple task
* FIXED: Exception on startup when USB input disabled
* FIXED: Full 32bit volume processing only applied when required
* FIXED: Setting OUT_VOLUME_AFTER_MIX to zero now has the expected effect
* Changes to dependencies:
- lib_xud: 2.2.1 -> 2.2.2
3.3.1
-----
* CHANGED: Documentation updates
* Changes to dependencies:
- lib_spdif: 4.1.0 -> 4.2.1
3.3.0
-----
* CHANGED: Define ADAT_RX renamed to XUA_ADAT_RX_EN
* CHANGED: Define ADAT_TX renamed to XUA_ADAT_TX_EN
* CHANGED: Define SPDIF_RX renamed to XUA_SPDIF_RX_EN
* CHANGED: Define SELF_POWERED changed to XUA_POWERMODE and associated
defines
* CHANGED: Drive strength of I2S clock lines upped to 8mA on xCORE.ai
* CHANGED: ADC datalines sampled on falling edge of clock in TDM mode
* CHANGED: Improved startup behaviour of TDM clocks
* FIXED: Intermittent underflow at MAX_FREQ on input stream start due to
insufficient packet buffering
* FIXED: Decouple buffer accounting to avoid corruption of samples
* Changes to dependencies:
- lib_adat: Added dependency 1.0.1
- lib_xud: 2.1.0 -> 2.2.1
3.2.0
-----
* CHANGED: Updated tests to use lib_locks (was legacy module_locks)
* CHANGED: Exclude HID Report functions unless the HID feature is enabled
* CHANGED: Explicit feedback EP enabled by default (see
UAC_FORCE_FEEDBACK_EP)
* FIXED: Incorrect conditional compilation of HID report code
* FIXED: Input/output descriptors written when input/output not enabled.
(Audio class 1.0 mode using XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES)
* Changes to dependencies:
- lib_dsp: 5.0.0 -> 6.2.1
- lib_locks: Added dependency 2.1.0
- lib_logging: 3.0.0 -> 3.1.1
- lib_mic_array: 4.0.0 -> 4.5.0
- lib_spdif: 4.0.0 -> 4.1.0
- lib_xassert: 4.0.0 -> 4.1.0
- lib_xud: 2.0.0 -> 2.1.0
3.1.0
-----
* CHANGED: Removed logic from HID API functions allowing a Report ID of 0 to
be used as "all/any" Report
3.0.0
-----
* ADDED: Support for HID Report IDs
* CHANGED: Renamed the HID API file xua_hid_report_descriptor.h to
xua_hid_report.h
* REMOVED: Support for HID Reports containing controls from mixed usage
pages
2.1.1
-----
* CHANGED: Setting of HID report items
2.1.0
-----
* CHANGED: Updated clock blocks to support lib_xud v2.0.0
* Changes to dependencies:
- lib_xud: 1.2.0 -> 2.0.0
2.0.0
-----
* ADDED: Function to get a Report item description
* ADDED: Support for multiple flash specs defined by DFU_FLASH_DEVICE
* ADDED: Nullable c_aud_ctl chan-end optimisation for fixed rate devices
* CHANGED: Check HID Usage Page when changing a Report item description
* CHANGED: HID event ID from list to bit and byte location in HID Report
* CHANGED: Interface to UserHIDRecordEvent()
* ADDED: Support for multiple flash specs defined by DFU_FLASH_DEVICE
* ADDED: Nullable c_aud_ctl chan-end optimisation for fixed rate devices
1.3.0
-----
* ADDED: Build default HID Report descriptor at boot-time
* ADDED: Function to return length of HID Report
* CHANGED: Move HID descriptors to ease maintenance
* CHANGED: Move legacy tests to separate directory
* CHANGED: Replace unused GPI-specific HID event names with generic ones
* ADDED: Build default HID Report descriptor at boot-time
* ADDED: Function to return length of HID Report
* CHANGED: HID Report to return multiple bytes
* CHANGED: NO_USB conditional compilation switch with XUA_USB_EN
* REMOVED: XS1 support
* CHANGED: Clock blocks used for BCLK and MCLK
* REMOVED: Arguments no longer supported by XUD_Main
* CHANGED: Arguments no longer supported by XUD_Main
* REMOVED: Support for XS1 based devices
1.2.0
-----
* ADDED: Updates for xcore.ai/XS3 compatibility
* ADDED: Makefile.Win32 for xmosdfu on Windows
* CHANGED: Use XMOS Public Licence Version 1
* FIXED: Bump default BCD device number to v1.2.0
* FIXED: xmosdfu now fails with an error when given a directory (#119)
* FIXED: Compilation errors related to HID code
* FIXED: Runtime error when using mic array interface
* CHANGED: Use XMOS Public Licence Version 1
* FIXED: Automate HID Report Descriptor length in AC1 HID Descriptor
1.1.1
-----
* RESOLVED: Zero length input packets generated before enumeration causing I2S
timing pushout at startup
* CHANGED: Pin Python package versions
* REMOVED: not necessary cpanfile
* CHANGED: Pin Python package versions
* FIXED: Zero length input packets generated before enumeration causing
I2S timing pushout at startup
1.1.0
-----
@@ -63,13 +196,12 @@ lib_xua Change Log
* 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
* ADDED: Guards to user_hid.h and xua_hid.h
* ADDED: UAC1 HID support for AC Stop (End Call), Volume Increment and
Volume Decrement
* CHANGE: UAC1 HID to report function keys f21 through f24 as specified by
* CHANGED: UAC1 HID to report function keys f21 through f24 as specified by
customer
* CHANGE: HID interface for user to set and clear events from global
* CHANGED: HID interface for user to set and clear events from global
variable to function
* CHANGE HID report descriptor to use generic events instead of GPI
events, to report Key-phrase detection as AC Search, and to report end-call
@@ -79,11 +211,24 @@ lib_xua Change Log
* ADDED: Override USB descriptor with sampling frequency and
bit-resolution set at boot time.
* ADDED: Global pointer to allow external access to masterClockFreq
* FIXED: Descriptors for XUA_ADAPTIVE incorrectly defined for IN endpoint
* Changes to dependencies:
- lib_spdif: 3.1.0 -> 4.0.0
- lib_xassert: 3.0.1 -> 4.0.0
0.2.1
-----
* HOTFIX: Fix descriptors for XUA_ADAPTIVE
* FIXED: Fix descriptors for XUA_ADAPTIVE
* Changes to dependencies:
- lib_logging: 2.1.1 -> 3.0.0
- lib_xud: 0.1.0 -> 0.2.0
0.2.0
-----
@@ -91,17 +236,17 @@ lib_xua Change Log
* ADDED: Initial library documentation
* ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit)
* ADDED: Separate callbacks for input/output audio stream start/stop
* CHANGE: I2S hardware resources no longer used globally and must be passed
* CHANGED: I2S hardware resources no longer used globally and must be passed
to XUA_AudioHub()
* CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task
* CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
* CHANGE: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS
* CHANGE: Define NO_USB renamed to XUA_USB_EN
* CHANGE: Build files updated to support new "xcommon" behaviour in xwaf.
* RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel
* CHANGED: XUA_AudioHub() no longer pars S/PDIF transmitter task
* CHANGED: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
* CHANGED: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS
* CHANGED: Define NO_USB renamed to XUA_USB_EN
* CHANGED: Build files updated to support new "xcommon" behaviour in xwaf.
* FIXED: wChannelConfig in UAC1 descriptor set according to output channel
count
* RESOLVED: Indexing of ADAT channel strings (#18059)
* RESOLVED: Rebooting device fails when PLL config "not reset" bit is set
* FIXED: Indexing of ADAT channel strings (#18059)
* FIXED: Rebooting device fails when PLL config "not reset" bit is set
* Changes to dependencies:
@@ -117,20 +262,19 @@ lib_xua Change Log
-----
* ADDED: Application note AN00246: Simple USB Audio Device using lib_xua
* CHANGE: xmosdfu emits warning if empty image read via upload
* CHANGE: Simplified mclk port sharing - no longer uses unsafe pointer
* RESOLVED: Runtime exception issues when incorrect feedback calculated
* CHANGED: xmosdfu emits warning if empty image read via upload
* CHANGED: Simplified mclk port sharing - no longer uses unsafe pointer
* FIXED: Runtime exception issues when incorrect feedback calculated
(introduced in sc_usb_audio 6.13)
* RESOLVED: Output sample counter reset on stream start. Caused playback
* FIXED: Output sample counter reset on stream start. Caused playback
issues on some Linux based hosts
0.1.1
-----
* RESOLVED: Configurations where I2S_CHANS_DAC and I2S_CHANS_ADC are both 0
now build
* RESOLVED: Deadlock in mixer when MAX_MIX_COUNT > 0 for larger channel
counts
* FIXED: Configurations where I2S_CHANS_DAC and I2S_CHANS_ADC are both 0 now
build
* FIXED: Deadlock in mixer when MAX_MIX_COUNT > 0 for larger channel counts
* Changes to dependencies:
@@ -141,31 +285,31 @@ lib_xua Change Log
0.1.0
-----
* ADDED: FB_USE_REF_CLOCK to allow feedback generation from xCORE
internal reference
* ADDED: Linux Makefile for xmosdfu host application
* ADDED: Raspberry Pi Makefile for xmosdfu host application
* ADDED: Documentation of PID argument to xmosdfu
* ADDED: Optional build time microphone delay line (MIC_BUFFER_DEPTH)
* CHANGE: Removal of audManage_if, users should define their own
interfaces as required
* CHANGE: Vendor specific control interface in UAC1 descriptor now has a
* ADDED: FB_USE_REF_CLOCK to allow feedback generation from xCORE internal
reference
* ADDED: Linux Makefile for xmosdfu host application
* ADDED: Raspberry Pi Makefile for xmosdfu host application
* ADDED: Documentation of PID argument to xmosdfu
* ADDED: Optional build time microphone delay line (MIC_BUFFER_DEPTH)
* CHANGED: Removal of audManage_if, users should define their own interfaces
as required
* CHANGED: Vendor specific control interface in UAC1 descriptor now has a
string descriptor so it shows up with a descriptive name in Windows Device
Manager
* CHANGE: DFU_BCD_DEVICE removed (now uses BCD_DEVICE)
* CHANGE: Renaming in descriptors.h to avoid clashes with application
* CHANGE: Make device reboot function no-argument (was one channel end)
* RESOLVED: FIR gain compensation for PDM mics set incorrectly for divide of
* CHANGED: DFU_BCD_DEVICE removed (now uses BCD_DEVICE)
* CHANGED: Renaming in descriptors.h to avoid clashes with application
* CHANGED: Make device reboot function no-argument (was one channel end)
* FIXED: FIR gain compensation for PDM mics set incorrectly for divide of
8
* RESOLVED: Incorrect xmosdfu DYLD path in test script code
* RESOLVED: xmosdfu cannot find XMOS device on modern MacBook Pro (#17897)
* RESOLVED: Issue when feedback is initially incorrect when two SOF's are
not yet received
* RESOLVED: AUDIO_TILE and PDM_TILE may now share the same value/tile
* RESOLVED: Cope with out of order interface numbers in xmosdfu
* RESOLVED: DSD playback not functional on xCORE-200 (introduced in
* FIXED: Incorrect xmosdfu DYLD path in test script code
* FIXED: xmosdfu cannot find XMOS device on modern MacBook Pro (#17897)
* FIXED: Issue when feedback is initially incorrect when two SOF's are not
yet received
* FIXED: AUDIO_TILE and PDM_TILE may now share the same value/tile
* FIXED: Cope with out of order interface numbers in xmosdfu
* FIXED: DSD playback not functional on xCORE-200 (introduced in
sc_usb_audio 6.14)
* RESOLVED: Improvements made to clock sync code in TDM slave mode
* FIXED: Improvements made to clock sync code in TDM slave mode
Legacy release history
@@ -175,105 +319,105 @@ Legacy release history
7.4.1
-----
- RESOLVED: Exception due to null chanend when using NO_USB
- FIXED: Exception due to null chanend when using NO_USB
7.4.0
-----
- RESOLVED: PID_DFU now based on AUDIO_CLASS. This potentially caused issues
- FIXED: PID_DFU now based on AUDIO_CLASS. This potentially caused issues
with UAC1 DFU
7.3.0
-----
- CHANGE: Example OSX DFU host app updated to now take PID as runtime
- CHANGED: Example OSX DFU host app updated to now take PID as runtime
argument. This enabled multiple XMOS devices to be attached to the host
during DFU process
7.2.0
-----
- ADDED: DFU to UAC1 descriptors (guarded by DFU and FORCE_UAC1_DFU)
- RESOLVED: Removed 'reinterpretation to type of larger alignment' warnings
- RESOLVED: DFU flash code run on tile[0] even if XUD_TILE and AUDIO_IO_TILE are not 0
- FIXED: Removed 'reinterpretation to type of larger alignment' warnings
- FIXED: DFU flash code run on tile[0] even if XUD_TILE and AUDIO_IO_TILE are not 0
7.1.0
-----
- ADDED: UserBufferManagementInit() to reset any state required in UserBufferManagement()
- ADDED: I2S output up-sampling (enabled when AUD_TO_USB_RATIO is > 1)
- ADDED: PDM Mic decimator output rate can now be controlled independently (via AUD_TO_MICS_RATIO)
- CHANGE: Rename I2S input down-sampling (enabled when AUD_TO_USB_RATIO is > 1, rather than via I2S_DOWNSAMPLE_FACTOR)
- RESOLVED: Crosstalk between input channels when I2S input down-sampling is enabled
- RESOLVED: Mic decimation data tables properly sized when mic sample-rate < USB audio sample-rate
- CHANGED: Rename I2S input down-sampling (enabled when AUD_TO_USB_RATIO is > 1, rather than via I2S_DOWNSAMPLE_FACTOR)
- FIXED: Crosstalk between input channels when I2S input down-sampling is enabled
- FIXED: Mic decimation data tables properly sized when mic sample-rate < USB audio sample-rate
7.0.1
-----
- RESOLVED: PDM microphone decimation issue at some sample rates caused by integration
- FIXED: PDM microphone decimation issue at some sample rates caused by integration
7.0.0
------
- ADDED: I2S down-sampling (I2S_DOWNSAMPLE_FACTOR)
- ADDED: I2S resynchronisation when in slave mode (CODEC_MASTER=1)
- CHANGE: Various memory optimisations when MAX_FREQ = MIN_FREQ
- CHANGE: Memory optimisations in audio buffering
- CHANGE: Various memory optimisations in UAC1 mode
- CHANGE: user_pdm_process() API change
- CHANGE: PDM Mic decimator table now related to MIN_FREQ (memory optimisation)
- RESOLVED: Audio request interrupt handler properly eliminated
- CHANGED: Various memory optimisations when MAX_FREQ = MIN_FREQ
- CHANGED: Memory optimisations in audio buffering
- CHANGED: Various memory optimisations in UAC1 mode
- CHANGED: user_pdm_process() API change
- CHANGED: PDM Mic decimator table now related to MIN_FREQ (memory optimisation)
- FIXED: Audio request interrupt handler properly eliminated
6.30.0
------
- RESOLVED: Number of PDM microphone channels configured now based on NUM_PDM_MICS define
(previously hard-coded)
- RESOLVED: PDM microphone clock divide now based MCLK defines (previously hard-coded)
- CHANGE: Second microphone decimation core only run if NUM_PDM_MICS > 4
- FIXED: Number of PDM microphone channels configured now based on NUM_PDM_MICS define
(previously hard-coded)
- FIXED: PDM microphone clock divide now based MCLK defines (previously hard-coded)
- CHANGED: Second microphone decimation core only run if NUM_PDM_MICS > 4
6.20.0
------
- RESOLVED: Intra-frame sample delays of 1/2 samples on input streaming in TDM mode
- RESOLVED: Build issue with NUM_USB_CHAN_OUT set to 0 and MIXER enabled
- RESOLVED: SPDIF_TX_INDEX not defined build warning only emitted when SPDIF_TX defined
- RESOLVED: Failure to enter DFU mode when configured without input volume control
- FIXED: Intra-frame sample delays of 1/2 samples on input streaming in TDM mode
- FIXED: Build issue with NUM_USB_CHAN_OUT set to 0 and MIXER enabled
- FIXED: SPDIF_TX_INDEX not defined build warning only emitted when SPDIF_TX defined
- FIXED: Failure to enter DFU mode when configured without input volume control
6.19.0
------
- RESOLVED: SPDIF_TX_INDEX not defined build warning only emitted when SPDIF_TX defined
- RESOLVED: Failure to enter DFU mode when configured without input volume control
- FIXED: SPDIF_TX_INDEX not defined build warning only emitted when SPDIF_TX defined
- FIXED: Failure to enter DFU mode when configured without input volume control
6.18.1
------
- ADDED: Vendor Specific control interface added to UAC1 descriptors to allow control of
XVSM params from Windows (via lib_usb)
- ADDED: Vendor Specific control interface added to UAC1 descriptors to allow control of
XVSM params from Windows (via lib_usb)
6.18.0
------
- ADDED: Call to VendorRequests() and VendorRequests_Init() to Endpoint 0
- ADDED: VENDOR_REQUESTS_PARAMS define to allow for custom parameters to VendorRequest calls
- RESOLVED: FIR gain compensation set appropriately in lib_mic_array usage
- CHANGE: i_dsp interface renamed i_audManage
- ADDED: Call to VendorRequests() and VendorRequests_Init() to Endpoint 0
- ADDED: VENDOR_REQUESTS_PARAMS define to allow for custom parameters to VendorRequest calls
- FIXED: FIR gain compensation set appropriately in lib_mic_array usage
- CHANGED: i_dsp interface renamed i_audManage
6.16.0
------
- ADDED: Call to UserBufferManagement()
- ADDED: PDM_MIC_INDEX in devicedefines.h and usage
- CHANGE: pdm_buffer() task now combinable
- CHANGE: Audio I/O task now takes i_dsp interface as a parameter
- CHANGE: Removed built-in support for A/U series internal ADC
- CHANGE: User PDM Microphone processing now uses an interface (previously function call)
- CHANGED: pdm_buffer() task now combinable
- CHANGED: Audio I/O task now takes i_dsp interface as a parameter
- CHANGED: Removed built-in support for A/U series internal ADC
- CHANGED: User PDM Microphone processing now uses an interface (previously function call)
6.15.2
------
- RESOLVED: interrupt.h (used in audio buffering) now compatible with xCORE-200 ABI
- FIXED: interrupt.h (used in audio buffering) now compatible with xCORE-200 ABI
6.15.1
------
- RESOLVED: DAC data mis-alignment issue in TDM/I2S slave mode
- CHANGE: Updates to support API changes in lib_mic_array version 2.0
- FIXED: DAC data mis-alignment issue in TDM/I2S slave mode
- CHANGED: Updates to support API changes in lib_mic_array version 2.0
6.15.0
------
- RESOLVED: UAC 1.0 descriptors now support multi-channel volume control (previously were
- FIXED: UAC 1.0 descriptors now support multi-channel volume control (previously were
hard-coded as stereo)
- CHANGE: Removed 32kHz sample-rate support when PDM microphones enabled (lib_mic_array
- CHANGED: Removed 32kHz sample-rate support when PDM microphones enabled (lib_mic_array
currently does not support non-integer decimation factors)
6.14.0
@@ -287,75 +431,75 @@ Legacy release history
list and UAC 1.0 descriptors
- ADDED: Support for the use and integration of PDM microphones (including PDM to PCM
conversion) via lib_mic_array
- RESOLVED: MIDI data not accepted after "sleep" in OSX 10.11 (El Capitan) - related to sc_xud
- FIXED: MIDI data not accepted after "sleep" in OSX 10.11 (El Capitan) - related to sc_xud
issue #17092
- CHANGE: Asynchronous feedback system re-implemented to allow for the first two ADDED
- CHANGED: Asynchronous feedback system re-implemented to allow for the first two ADDED
changelog items
- CHANGE: Hardware divider used to generate bit-clock from master clock (xCORE-200 only).
- CHANGED: Hardware divider used to generate bit-clock from master clock (xCORE-200 only).
Allows easy support for greater number of master-clock to sample-rate ratios.
- CHANGE: module_queue no longer uses any assert module/lib
- CHANGED: module_queue no longer uses any assert module/lib
6.13.0
------
- ADDED: Device now uses implicit feedback when input stream is available (previously explicit
feedback pipe always used). This saves chanend/EP resources and means less processing
burden for the host. Previous behaviour available by enabling UAC_FORCE_FEEDBACK_EP
- RESOLVED: Exception when SPDIF_TX and ADAT_TX both enabled due to clock-block being configured
- FIXED: Exception when SPDIF_TX and ADAT_TX both enabled due to clock-block being configured
after already started. Caused by SPDIF_TX define check typo
- RESOLVED: DFU flag address changed to properly conform to memory address range allocated to
- FIXED: DFU flag address changed to properly conform to memory address range allocated to
apps by tools
- RESOLVED: Build failure when DFU disabled
- RESOLVED: Build issue when I2S_CHANS_ADC/DAC set to 0 and CODEC_MASTER enabled
- RESOLVED: Typo in MCLK_441 checking for MIN_FREQ define
- CHANGE: Mixer and non-mixer channel comms scheme (decouple <-> audio path) now identical
- CHANGE: Input stream buffering modified such that during overflow older samples are removed
- FIXED: Build failure when DFU disabled
- FIXED: Build issue when I2S_CHANS_ADC/DAC set to 0 and CODEC_MASTER enabled
- FIXED: Typo in MCLK_441 checking for MIN_FREQ define
- CHANGED: Mixer and non-mixer channel comms scheme (decouple <-> audio path) now identical
- CHANGED: Input stream buffering modified such that during overflow older samples are removed
rather than ignoring most recent samples. Removes any chance of stale input packets
being sent to host
- CHANGE: module_queue (in sc_usb_audio) now uses lib_xassert rather than module_xassert
- CHANGED: module_queue (in sc_usb_audio) now uses lib_xassert rather than module_xassert
6.12.6
------
- RESOLVED: Build error when DFU is disabled
- RESOLVED: Build error when I2S_CHANS_ADC or I2S_CHANS_DAC set to 0 and CODEC_MASTER enabled
- FIXED: Build error when DFU is disabled
- FIXED: Build error when I2S_CHANS_ADC or I2S_CHANS_DAC set to 0 and CODEC_MASTER enabled
6.12.5
------
- RESOLVED: Stream issue when NUM_USB_CHAN_IN < I2S_CHANS_ADC
- FIXED: Stream issue when NUM_USB_CHAN_IN < I2S_CHANS_ADC
6.12.4
------
- RESOLVED: DFU fail when DSD enabled and USB library not running on tile[0]
- FIXED: DFU fail when DSD enabled and USB library not running on tile[0]
6.12.3
------
- RESOLVED: Method for storing persistent state over a DFU reboot modified to improve resilience
- FIXED: Method for storing persistent state over a DFU reboot modified to improve resilience
against code-base and tools changes
6.12.2
------
- RESOLVED: Reboot code (used for DFU) failure in tools versions > 14.0.2 (xCORE-200 only)
- RESOLVED: Run-time exception in mixer when MAX_MIX_COUNT > 0 (xCORE-200 only)
- RESOLVED: MAX_MIX_COUNT checked properly for mix strings in string table
- CHANGE: DFU code re-written to use an XC interface. The flash-part may now be connected
- FIXED: Reboot code (used for DFU) failure in tools versions > 14.0.2 (xCORE-200 only)
- FIXED: Run-time exception in mixer when MAX_MIX_COUNT > 0 (xCORE-200 only)
- FIXED: MAX_MIX_COUNT checked properly for mix strings in string table
- CHANGED: DFU code re-written to use an XC interface. The flash-part may now be connected
to a separate tile to the tile running USB code
- CHANGE: DFU code can now use quad-SPI flash
- CHANGE: Example xmos_dfu application now uses a list of PIDs to allow adding PIDs easier.
- CHANGED: DFU code can now use quad-SPI flash
- CHANGED: Example xmos_dfu application now uses a list of PIDs to allow adding PIDs easier.
--listdevices command also added.
- CHANGE: I2S_CHANS_PER_FRAME and I2S_WIRES_xxx defines tidied
- CHANGED: I2S_CHANS_PER_FRAME and I2S_WIRES_xxx defines tidied
6.12.1
------
- RESOLVED: Fixes to TDM input timing/sample-alignment when BCLK=MCLK
- RESOLVED: Various minor fixes to allow ADAT_RX to run on xCORE 200 MC AUDIO hardware
- CHANGE: Moved from old SPDIF define to SPDIF_TX
- FIXED: Fixes to TDM input timing/sample-alignment when BCLK=MCLK
- FIXED: Various minor fixes to allow ADAT_RX to run on xCORE 200 MC AUDIO hardware
- CHANGED: Moved from old SPDIF define to SPDIF_TX
6.12.0
------
- ADDED: Checks for XUD_200_SERIES define where required
- RESOLVED: Run-time exception due to decouple interrupt not entering correct issue mode
- FIXED: Run-time exception due to decouple interrupt not entering correct issue mode
(affects XCORE-200 only)
- CHANGE: SPDIF Tx Core may now reside on a different tile from I2S
- CHANGE: I2C ports now in structure to match new module_i2c_singleport/shared API.
- CHANGED: SPDIF Tx Core may now reside on a different tile from I2S
- CHANGED: I2C ports now in structure to match new module_i2c_singleport/shared API.
* Changes to dependencies:
@@ -365,48 +509,48 @@ Legacy release history
6.11.3
------
- RESOLVED: (Major) Streaming issue when mixer not enabled (introduced in 6.11.2)
- FIXED: (Major) Streaming issue when mixer not enabled (introduced in 6.11.2)
6.11.2
------
- RESOLVED: (Major) Enumeration issue when MAX_MIX_COUNT > 0 only. Introduced in mixer
- FIXED: (Major) Enumeration issue when MAX_MIX_COUNT > 0 only. Introduced in mixer
optimisations in 6.11.0. Only affects designs using mixer functionality.
- RESOLVED: (Normal) Audio buffering request system modified such that the mixer output is
- FIXED: (Normal) Audio buffering request system modified such that the mixer output is
not silent when in underflow case (i.e. host output stream not active) This issue was
introduced with the addition of DSD functionality and only affects designs using
mixer functionality.
- RESOLVED: (Minor) Potential build issue due to duplicate labels in inline asm in
- FIXED: (Minor) Potential build issue due to duplicate labels in inline asm in
set_interrupt_handler macro
- RESOLVED: (Minor) BCD_DEVICE define in devicedefines.h now guarded by ifndef (caused issues
- FIXED: (Minor) BCD_DEVICE define in devicedefines.h now guarded by ifndef (caused issues
with DFU test build configs.
- RESOLVED: (Minor) String descriptor for Clock Selector unit incorrectly reported
- RESOLVED: (Minor) BCD_DEVICE in devicedefines.h now guarded by #ifndef (Caused issues with
- FIXED: (Minor) String descriptor for Clock Selector unit incorrectly reported
- FIXED: (Minor) BCD_DEVICE in devicedefines.h now guarded by #ifndef (Caused issues with
default DFU test build configs.
- CHANGE: HID report descriptor defines added to shared user_hid.h
- CHANGE: Now uses module_adat_rx from sc_adat (local module_usb_audio_adat removed)
- CHANGED: HID report descriptor defines added to shared user_hid.h
- CHANGED: Now uses module_adat_rx from sc_adat (local module_usb_audio_adat removed)
6.11.1
------
- ADDED: ADAT transmit functionality, including SMUX. See ADAT_TX and ADAT_TX_INDEX.
- RESOLVED: (Normal) Build issue with CODEC_MASTER (xCore is I2S slave) enabled
- RESOLVED: (Minor) Channel ordering issue in when TDM and CODEC_MASTER mode enabled
- RESOLVED: (Normal) DFU fails when SPDIF_RX enabled due to clock block being shared between SPDIF
- FIXED: (Normal) Build issue with CODEC_MASTER (xCore is I2S slave) enabled
- FIXED: (Minor) Channel ordering issue in when TDM and CODEC_MASTER mode enabled
- FIXED: (Normal) DFU fails when SPDIF_RX enabled due to clock block being shared between SPDIF
core and FlashLib
6.11.0
------
- ADDED: Basic TDM I2S functionality added. See I2S_CHANS_PER_FRAME and I2S_MODE_TDM
- CHANGE: Various optimisations in 'mixer' core to improve performance for higher
- CHANGED: Various optimisations in 'mixer' core to improve performance for higher
channel counts including the use of XC unsafe pointers instead of inline ASM
- CHANGE: Mixer mapping disabled when MAX_MIX_COUNT is 0 since this is wasted processing.
- CHANGE: Descriptor changes to allow for channel input/output channel count up to 32
- CHANGED: Mixer mapping disabled when MAX_MIX_COUNT is 0 since this is wasted processing.
- CHANGED: Descriptor changes to allow for channel input/output channel count up to 32
(previous limit was 18)
6.10.0
------
- CHANGE: Endpoint management for iAP EA Native Transport now merged into buffer() core.
- CHANGED: Endpoint management for iAP EA Native Transport now merged into buffer() core.
Previously was separate core (as added in 6.8.0).
- CHANGE: Minor optimisation to I2S port code for inputs from ADC
- CHANGED: Minor optimisation to I2S port code for inputs from ADC
6.9.0
-----
@@ -414,35 +558,35 @@ Legacy release history
supported (4 channels at 96kHz).
- ADDED: Explicit build warnings if sample rate/depth & channel combination exceeds
available USB bus bandwidth.
- RESOLVED: (Major) Reinstated ADAT input functionality, including descriptors and clock
- FIXED: (Major) Reinstated ADAT input functionality, including descriptors and clock
generation/control and stream configuration defines/tables.
- RESOLVED: (Major) S/PDIF/ADAT sample transfer code in audio() (from ClockGen()) moved to
- FIXED: (Major) S/PDIF/ADAT sample transfer code in audio() (from ClockGen()) moved to
aid timing.
- CHANGE: Modifying mix map now only affects specified mix, previous was applied to all
- CHANGED: Modifying mix map now only affects specified mix, previous was applied to all
mixes. CS_XU_MIXSEL control selector now takes values 0 to MAX_MIX_COUNT + 1
(with 0 affecting all mixes).
- CHANGE: Channel c_dig_rx is no longer nullable, assists with timing due to removal of
- CHANGED: Channel c_dig_rx is no longer nullable, assists with timing due to removal of
null checks inserted by compiler.
- CHANGE: ADAT SMUX selection now based on device sample frequency rather than selected
- CHANGED: ADAT SMUX selection now based on device sample frequency rather than selected
stream format - Endpoint 0 now configures clockgen() on a sample-rate change
rather than stream start.
6.8.0
-----
- ADDED: Evaluation support for iAP EA Native Transport endpoints
- RESOLVED: (Minor) Reverted change in 6.5.1 release where sample rate listing in Audio Class
- FIXED: (Minor) Reverted change in 6.5.1 release where sample rate listing in Audio Class
1.0 descriptors was trimmed (previously 4 rates were always reported). This change
appears to highlight a Windows (only) enumeration issue with the Input & Output
configs
- RESOLVED: (Major) Mixer functionality re-instated, including descriptors and various required
- FIXED: (Major) Mixer functionality re-instated, including descriptors and various required
updates compatibility with 13 tools
- RESOLVED: (Major) Endpoint 0 was requesting an out of bounds channel whilst requesting level data
- RESOLVED: (Major) Fast mix code not operates correctly in 13 tools, assembler inserting long jmp
- FIXED: (Major) Endpoint 0 was requesting an out of bounds channel whilst requesting level data
- FIXED: (Major) Fast mix code not operates correctly in 13 tools, assembler inserting long jmp
instructions
- RESOLVED: (Minor) LED level meter code now compatible with 13 tools (shared mem access)
- RESOLVED (Minor) Ordering of level data from the device now matches channel ordering into
- FIXED: (Minor) LED level meter code now compatible with 13 tools (shared mem access)
- FIXED: (Minor) Ordering of level data from the device now matches channel ordering into
mixer (previously the device input data and the stream from host were swapped)
- CHANGE: Level meter buffer naming now resemble functionality
- CHANGED: Level meter buffer naming now resemble functionality
Legacy release history

86
Jenkinsfile vendored
View File

@@ -1,4 +1,4 @@
@Library('xmos_jenkins_shared_library@v0.16.2') _
@Library('xmos_jenkins_shared_library@v0.24.0') _
getApproval()
@@ -14,7 +14,7 @@ pipeline {
stages {
stage('Basic tests') {
agent {
label 'x86_64&&brew'
label 'x86_64 && linux'
}
stages {
stage('Get view') {
@@ -24,28 +24,32 @@ pipeline {
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}")
xcoreLibraryChecks("${REPO}", false)
}
}
stage('XS2 Tests') {
stage('Testing') {
failFast true
parallel {
stage('Legacy tests') {
stage('Tests') {
steps {
runXmostest("${REPO}", 'legacy_tests')
dir("${REPO}/tests"){
viewEnv(){
withVenv{
runPytest('--numprocesses=4')
}
}
}
}
}
stage('Unit tests') {
stage('Unity tests') {
steps {
dir("${REPO}") {
dir('tests') {
dir('xua_unit_tests') {
withVenv {
runWaf('.', "configure clean build --target=xcore200")
// runWaf('.', "configure clean build --target=xcoreai")
// stash name: 'xua_unit_tests', includes: 'bin/*xcoreai.xe, '
viewEnv() {
runPython("TARGET=XCORE200 pytest -n 1")
runPython("TARGET=XCORE200 pytest -s")
}
}
}
@@ -55,42 +59,6 @@ pipeline {
}
}
}
// stage('xcore.ai Verification') {
// agent {
// label 'xcore.ai-explorer'
// }
// options {
// skipDefaultCheckout()
// }
// stages{
// stage('Get View') {
// steps {
// xcorePrepareSandbox("${VIEW}", "${REPO}")
// }
// }
// stage('Unit tests') {
// steps {
// dir("${REPO}") {
// dir('tests') {
// dir('xua_unit_tests') {
// withVenv {
// unstash 'xua_unit_tests'
// viewEnv() {
// runPython("TARGET=XCOREAI pytest -s")
// }
// }
// }
// }
// }
// }
// }
// } // stages
// post {
// cleanup {
// cleanWs()
// }
// }
// }
stage('xCORE builds') {
steps {
dir("${REPO}") {
@@ -99,6 +67,8 @@ pipeline {
runXdoc('doc')
}
}
// Archive all the generated .pdf docs
archiveArtifacts artifacts: "${REPO}/**/pdf/*.pdf", fingerprint: true, allowEmptyArchive: true
}
}
}
@@ -113,7 +83,7 @@ pipeline {
parallel {
stage('Build Linux host app') {
agent {
label 'x86_64&&brew&&linux'
label 'x86_64&&linux'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
@@ -129,13 +99,19 @@ pipeline {
}
stage('Build Mac host app') {
agent {
label 'x86_64&&brew&&macOS'
label 'x86_64&&macOS'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.OSX64'
}
dir("${REPO}/host_usb_mixer_control") {
sh 'make -f Makefile.OSX'
sh 'mkdir OSX/x86'
sh 'mv xmos_mixer OSX/x86/xmos_mixer'
archiveArtifacts artifacts: "OSX/x86/xmos_mixer", fingerprint: true
}
}
post {
cleanup {
@@ -169,7 +145,17 @@ pipeline {
dir("${REPO}") {
checkout scm
dir("${REPO}/host/xmosdfu") {
runVS('nmake /f Makefile.Win32')
withVS("vcvars32.bat") {
bat "nmake /f Makefile.Win32"
}
}
dir("host_usb_mixer_control") {
withVS() {
bat 'msbuild host_usb_mixer_control.vcxproj /property:Configuration=Release /property:Platform=x64'
}
bat 'mkdir Win\\x64'
bat 'mv bin/Release/x64/host_usb_mixer_control.exe Win/x64/xmos_mixer.exe'
archiveArtifacts artifacts: "Win/x64/xmos_mixer.exe", fingerprint: true
}
}
}
@@ -183,7 +169,7 @@ pipeline {
}
stage('Update') {
agent {
label 'x86_64&&brew'
label 'x86_64 && linux'
}
steps {
updateViewfiles()

View File

@@ -1,25 +1,31 @@
lib_xua
=======
#######
:Version: 3.5.1
:Vendor: XMOS
:Scope: General Use
Summary
-------
*******
USB Audio Shared Components for use in the XMOS USB Audio Refererence Designs.
lib_xua contains shared components for use in the XMOS USB Audio (XUA) Reference Designs.
This library enables the development of USB Audio devices on the XMOS xCORE architecture.
These components enable the development of USB Audio devices on the XMOS xCORE architecture.
Features
........
========
Key features of the various applications in this repository are as follows
Key features of the various components in this repository are as follows
- USB Audio Class 1.0/2.0 Compliant
- Fully Asynchronous operation
- Fully Asynchronous operation (synchronous mode as an option)
- Support for the following sample frequencies: 8, 11.025, 12, 16, 32, 44.1, 48, 88.2, 96, 176.4, 192, 352.8, 384kHz
- Input/output channel and individual volume/mute controls supported
- Volume/mute controls for input/output (for both master and individual channels)
- Support for dynamically selectable output audio formats (e.g. resolution)
@@ -33,30 +39,66 @@ Key features of the various applications in this repository are as follows
- ADAT input
- Synchronisation to external digital streams i.e. S/PDIF or ADAT (when in asynchronous mode)
- I2S (slave/master modes with configurable word-length)
- TDM (slave/master modes with configurable word-length)
- MIDI input/output (Compliant to USB Class Specification for MIDI devices)
- DSD output (Native and DoP mode) at DSD64 and DSD128 rates
- DSD output ("native" and DoP mode) at DSD64 and DSD128 rates
- Mixer with flexible routing
- Simple playback controls via Human Interface Device (HID)
- Simple playback controls via USB Human Interface Device (HID) Class
- Support for operation with Apple devices (requires software module sc_mfi for MFI licensees only - please contact XMOS)
- Support for adding custom HID interfaces
Note, not all features may be supported at all sample frequencies, simultaneously or on all devices. Some features also require specific host driver support.
Note, not all features may be supported at all sample frequencies, simultaneously or on all devices.
Some features may also require specific host driver support.
Host System Requirements
========================
Software version and dependencies
.................................
USB Audio devices built using `lib_xua` have the following host system requirements.
The CHANGELOG contains information about the current and previous versions.
For a list of direct dependencies, look for DEPENDENT_MODULES in lib_xua/module_build_info.
- Mac OSX version 10.6 or later
- Windows Vista, 7, 8 or 10 with Thesycon Audio Class 2.0 driver for Windows (Tested against version 3.20). Please contact XMOS for details.
- Windows Vista, 7, 8 or 10 with built-in USB Audio Class 1.0 driver.
Older versions of Windows are not guaranteed to operate as expected. Devices are also expected to operate with various Linux distributions including mobile variants.
Related Application Notes
.........................
=========================
The following application notes use this library:
* AN000246 - Simple USB Audio Device using lib_xua
* AN000247 - Using lib_xua with lib_spdif (transmit)
* AN000248 - Using lib_xua with lib_mic_array
* AN000246 - Simple USB Audio Device using lib_xua
* AN000247 - Using lib_xua with lib_spdif (transmit)
* AN000248 - Using lib_xua with lib_mic_array
Required Software (dependencies)
================================
* lib_locks (www.github.com/xmos/lib_locks)
* lib_logging (www.github.com/xmos/lib_logging)
* lib_mic_array (www.github.com/xmos/lib_mic_array)
* lib_xassert (www.github.com/xmos/lib_xassert)
* lib_dsp (www.github.com/xmos/lib_dsp)
* lib_spdif (www.github.com/xmos/lib_spdif)
* lib_xud (www.github.com/xmos/lib_xud)
* lib_adat (www.github.com/xmos/lib_adat)
Documentation
=============
You can find the documentation for this software in the /doc directory of the package.
Support
=======
This package is supported by XMOS Ltd. Issues can be raised against the software at: http://www.xmos.com/support

3
doc/dfu/rst/xdoc.conf Normal file
View File

@@ -0,0 +1,3 @@
XMOSNEWSTYLE=2
SOURCE_INCLUDE_DIRS=../../../lib_xua/host/xmosdfu
SPHINX_MASTER_DOC=dfu

1
doc_dfu/.gitignore vendored
View File

@@ -1 +0,0 @@
_build

View File

@@ -1,84 +0,0 @@
*******************************
XMOS PUBLIC LICENCE: Version 1
*******************************
Subject to the conditions and limitations below, permission is hereby granted by XMOS LIMITED (“XMOS”), free of charge, to any person or entity obtaining a copy of the XMOS Software.
**1. Definitions**
**“Applicable Patent Rights”** means: (a) where XMOS is the grantor of the rights, (i) claims of patents that are now or in future owned by or assigned to XMOS and (ii) that cover subject matter contained in the Software, but only to the extent it is necessary to use, reproduce or distribute the Software without infringement; and (b) where you are the grantor of the rights, (i) claims of patents that are now or in future owned by or assigned to you and (ii) that cover the subject matter contained in your Derivatives, taken alone or in combination with the Software.
**“Compiled Code”** means any compiled, binary, machine readable or executable version of the Source Code.
**“Contributor”** means any person or entity that creates or contributes to the creation of Derivatives.
**“Derivatives”** means any addition to, deletion from and/or change to the substance, structure of the Software, any previous Derivatives, the combination of the Derivatives and the Software and/or any respective portions thereof.
**“Source Code”** means the human readable code that is suitable for making modifications but excluding any Compiled Code.
**“Software”** means the software and associated documentation files which XMOS makes available and which contain a notice identifying the software as original XMOS software and referring to the software being subject to the terms of this XMOS Public Licence.
This Licence refers to XMOS Software and does not relate to any XMOS hardware or devices which are protected by intellectual property rights (including patent and trade marks) which may be sold to you under a separate agreement.
**2. Licence**
**Permitted Uses, Conditions and Restrictions.** Subject to the conditions below, XMOS grants you a worldwide, royalty free, non-exclusive licence, to the extent of any Patent Rights to do the following:
2.1 **Unmodified Software.** You may use, copy, display, publish, distribute and make available unmodified copies of the Software:
2.1.1 for personal or academic, non-commercial purposes; or
2.1.2 for commercial purposes provided the Software is at all times used on a device designed, licensed or developed by XMOS and, provided that in each instance (2.1.1 and 2.1.2):
(a) you must retain and reproduce in all copies of the Software the copyright and proprietary notices and disclaimers of XMOS as they appear in the Software, and keep intact all notices and disclaimers in the Software files that refer to this Licence; and
(b) you must include a copy of this Licence with every copy of the Software and documentation you publish, distribute and make available and you may not offer or impose any terms on such Software that alter or restrict this Licence or the intent of such Licence, except as permitted below (Additional Terms).
The licence above does not include any Compiled Code which XMOS may make available under a separate support and licence agreement.
2.2 **Derivatives.** You may create and modify Derivatives and use, copy, display, publish, distribute and make available Derivatives:
2.2.1 for personal or academic, non-commercial purposes; or
2.2.2 for commercial purposes, provided the Derivatives are at all times used on a device designed, licensed or developed by XMOS and, provided that in each instance (2.2.1 and 2.2.2):
(a) you must comply with the terms of clause 2.1 with respect to the Derivatives;
(b) you must copy (to the extent it doesnt already exist) the notice below in each file of the Derivatives, and ensure all the modified files carry prominent notices stating that you have changed the files and the date of any change; and
(c) if you sublicence, distribute or otherwise make the Software and/or the Derivatives available for commercial purposes, you must provide that the Software and Derivatives are at all times used on a device designed, licensed or developed by XMOS.
Without limitation to these terms and clause 3 below, the Source Code and Compiled Code to your Derivatives may at your discretion (but without obligation) be released, copied, displayed, published, distributed and made available; and if you elect to do so, it must be under the terms of this Licence including the terms of the licence at clauses 2.2.1, 2.2.2 and clause 3 below.
2.3 **Distribution of Executable Versions.** If you distribute or make available Derivatives, you must include a prominent notice in the code itself as well as in all related documentation, stating that the Source Code of the Software from which the Derivatives are based is available under the terms of this Licence, with information on how and where to obtain such Source Code.
**3. Your Grant of Rights.** In consideration and as a condition to this Licence, you grant to any person or entity receiving or distributing any Derivatives, a non-exclusive, royalty free, perpetual, irrevocable license under your Applicable Patent Rights and all other intellectual property rights owned or controlled by you, to use, copy, display, publish, distribute and make available your Derivatives of the same scope and extent as XMOSs licence under clause 2.2 above.
**4. Combined Products.** You may create a combined product by combining Software, Derivatives and other code not covered by this Licence as a single application or product. In such instance, you must comply with the requirements of this Licence for any portion of the Software and/or Derivatives.
**5. Additional Terms.** You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the term of this Licence (“Additional Terms”) to any legitimate recipients of the Software and/or Derivatives. The terms on which you provide such Additional Terms are on your sole responsibility and you shall indemnify, defend and hold XMOS harmless against any claims asserted against XMOS.
**6. New Versions.** XMOS may publish revised and/or new versions of this Licence from time to time to accommodate changes to the Licence terms, new versions, updates and bug fixes of the Software. Each version will be given a distinguishing version number. Once Software has been published under a particular version of this Licence, you may continue to use it under the terms of that version. You may also choose to use the latest version of the Software under any subsequent version published by XMOS. Only XMOS shall have the right to modify these terms.
**7. IPR and Ownership**
Any rights, including all intellectual property rights and all trademarks not expressly granted herein are reserved in full by the authors or copyright holders. Any requests for additional permissions by XMOS including any rights to use XMOS trademarks, should be made (without obligation) to XMOS at **support@xmos.com**
Nothing herein shall limit any rights that XMOS is otherwise entitled to under the doctrines of patent exhaustion, implied license, or legal estoppel. Neither the name of the authors, the copyright holders or any contributors may be used to endorse or promote any Derivatives from this Software without specific written permission. Any attempt to deal with the Software which does not comply with this Licence shall be void and shall automatically terminate any rights granted under this licence (including any licence of any intellectual property rights granted herein).
Subject to the licences granted under this Licence any Contributor retains all rights, title and interest in and to any Derivatives made by Contributor subject to the underlying rights of XMOS in the Software. XMOS shall retain all rights, title and interest in the Software and any Derivatives made by XMOS (“XMOS Derivatives”). XMOS Derivatives will not automatically be subject to this Licence and XMOS shall be entitled to licence such rights on any terms (without obligation) as it sees fit.
**8. Termination**
8.1 This Licence will automatically terminate immediately, without notice to you, if:
(a) you fail to comply with the terms of this Licence; and/or
(b) you directly or indirectly commence any action for patent or intellectual property right infringement against XMOS, or any parent, group, affiliate or subsidiary of XMOS; provided XMOS did not first commence an action or patent infringement against you in that instance; and/or
(c) the terms of this Licence are held by any court of competent jurisdiction to be unenforceable in whole or in part.
**9. Critical Applications.** Unless XMOS has agreed in writing with you an agreement specifically governing use of the Goods in military, aerospace, automotive or medically related functions (collectively and individually hereinafter referred to as "Special Use"), any permitted use of the Software excludes Special Use. Notwithstanding any agreement between XMOS and you for Special Use, Special Use shall be at your own risk, and you shall fully indemnify XMOS against any damages, losses, costs and claims (direct and indirect) arising out of any Special Use.
**10. NO WARRANTY OR SUPPORT.** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL XMOS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, WARRANTY, CIVIL TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE INCLUDING GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOT WITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE. IN SOME JURISDICTIONS PARTIES ARE UNABLE TO LIMIT LIABILTY IN THIS WAY, IF THIS APPLIES TO YOUR JURISDICTION THIS LIABILITY CLAUSE ABOVE MAY NOT APPLY. NOTWITHSTANDING THE ABOVE, IN NO EVENT SHALL XMOSs TOTAL LIABILITY TO YOU FOR ALL DAMAGES, LOSS OR OTHERWISE EXCEED $50.
**11. Governing Law and Jurisdiction.** This Licence constitutes the entire agreement between the parties with respect to the subject matter hereof. The Licence shall be governed by the laws of England and the conflict of laws and UN Convention on Contracts for the International Sale of Goods, shall not apply.

View File

@@ -1 +0,0 @@
SOURCE_INCLUDE_DIRS=../lib_xua/host/xmosdfu

View File

@@ -1,18 +1,19 @@
APP_NAME = app_xua_simple
TARGET = xk-audio-216-mc.xn
TARGET = xk-audio-316-mc.xn
# The flags passed to xcc when building the application
XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \
-g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES \
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[1] -fxscope
XCC_FLAGS = -O3 -report \
-g -Wno-unused-function \
-DXUD_CORE_CLOCK=600 \
-DUSB_TILE=tile[0] \
-fxscope \
-DUAC_FORCE_FEEDBACK_EP=0
#-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 lib_i2c
USED_MODULES = lib_xua lib_xud lib_i2c
#=============================================================================
# The following part of the Makefile includes the common build infrastructure
@@ -20,4 +21,3 @@ USED_MODULES = lib_xua lib_device_control lib_xud lib_i2c
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -11,7 +11,7 @@ Introduction
The XMOS USB Audio (XUA) library provides an implemention of USB Audio Class versions 1.0 and 2.0.
This application note demonstrates the implementation of a basic USB Audio Device on
the xCORE-200 MC Audio board.
the xCORE.ai Multichannel (MC) Audio board (XK-AUDIO-316-MC).
The Makefile
@@ -26,14 +26,10 @@ The Makefile also includes::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly the
``lib_xud`` library requires some flags for correct operation. Namely 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 ..
XCC_FLAGS = .. -DUSB_TILE=tile[0] ..
Includes
........
@@ -52,23 +48,22 @@ be included in your code to use the library.
:start-on: include "xua.h"
:end-on: include "xud_device.h"
Allocating hardware resources
Allocating Hardware Resources
.............................
A basic implementation of a USB Audio device (i.e. simple stereo input and output via I2S)
A basic implementation of a USB Audio device (i.e. simple stereo 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::
This application note assumes xCORE is I2S bus master
On an xCORE the pins are controlled by ``ports``. The application therefore declares various ``ports``
In the xCORE architecture the I/O pins are controlled and accessed by ``ports``. The application therefore declares various ``ports``
for this purpose:
.. literalinclude:: app_xua_simple.xc
@@ -76,8 +71,8 @@ for this purpose:
:end-on: in port p_mclk_in
``lib_xua`` also requires two ports for internally calculating USB feedback. Please refer to
the ``lib_xua`` library documentation for further details. The additonal input port for the master
clock is required since USB and S/PDIF do not reside of the same tiles on the example hardware.
the ``lib_xua`` library documentation for further details. The additional input port for the master
clock is required since USB and S/PDIF do not reside of the same tiles on the xCORE.ai MC Audio Board.
These ports are declared as follows:
@@ -95,11 +90,11 @@ Again, for the same reasoning as the master-clock ports, two master-clock clock-
- one on each tile.
Other declarations
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()``).
``lib_xud`` and the calling the main XUD function in a par (``XUD_Main()``).
For a simple application the following endpoints are required:
@@ -112,12 +107,12 @@ These are declared as follows:
:start-on: /* Endpoint type tables
:end-on: XUD_EpType epTypeTableIn
The application main() function
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.
Various channels are required in order to allow the required tasks to communicate.
These must first be declared:
.. literalinclude:: app_xua_simple.xc
@@ -134,6 +129,9 @@ using the xC ``par`` construct:
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).
It also runs a small function ``ctrlPort()`` that simply writes some values to an I/O port to configure some external
hardware (it enables analogue power supplies and correctly routes the master clock) and then closes.
Configuration
.............
@@ -162,9 +160,10 @@ implentation e.g. master clock frequencies and must be defined. Please see the
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.
To run the demo, use a USB cable to connect the on-board xTAG debug adapter (marked ``DEBUG``) to your development computer.
Use another USB cable to connect the USB receptacle marked ``USB DEVICE`` to the device you wish to play audio from.
Plug a device capable of receiving analogue audio (i.e. an amplified speaker) to the 3.5mm jack marked ``OUT 1/2``.
.. figure:: images/hw_setup.*
:width: 80%
@@ -173,40 +172,27 @@ development machine.
|newpage|
Launching the demo application
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 the demo example has been built from the command line using ``xmake``
it can be executed on the xCORE.ai 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
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
xrun ./bin/app_xua_simple.xe
Once this command has executed the application will be running on the
xCORE-200 MC Audio Board
xCORE.ai 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
Running the Application
.......................
Once running the device will be detected as a USB Audio device - note, Windows operating
@@ -237,11 +223,11 @@ References
|newpage|
Full source code listing
Full Source Code Listing
------------------------
Source code for main.xc
.......................
Source Code for app_xua_simple.xc
.................................
.. literalinclude:: app_xua_simple.xc
:largelisting:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 4.7 MiB

View File

@@ -1,2 +1,3 @@
XMOSNEWSTYLE=1
SOURCE_INCLUDE_DIRS=../../src
XMOSNEWSTYLE=2
SOURCE_INCLUDE_DIRS=../../src
SPHINX_MASTER_DOC=AN00246_xua_example

View File

@@ -1,13 +1,13 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
/* A very simple *example* of a USB audio application (and as such is un-verified for production)
*
* It uses the main blocks from the lib_xua
* It uses the main blocks from the lib_xua
*
* - 2 in/ 2 out I2S only
* - 2 channels out I2S only
* - No DFU
* - I2S only
* - I2S only
*
*/
@@ -19,7 +19,6 @@
/* Port declarations. Note, the defines come from the xn file */
buffered out port:32 p_i2s_dac[] = {PORT_I2S_DAC0}; /* I2S Data-line(s) */
buffered in port:32 p_i2s_adc[] = {PORT_I2S_ADC0}; /* I2S Data-line(s) */
buffered out port:32 p_lrclk = PORT_I2S_LRCLK; /* I2S Bit-clock */
buffered out port:32 p_bclk = PORT_I2S_BCLK; /* I2S L/R-clock */
@@ -31,15 +30,22 @@ in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for count
in port p_mclk_in_usb = PORT_MCLK_IN_USB; /* Extra master clock input for the USB tile */
/* Clock-block declarations */
clock clk_audio_bclk = on tile[0]: XS1_CLKBLK_4; /* Bit clock */
clock clk_audio_mclk = on tile[0]: XS1_CLKBLK_5; /* Master clock */
clock clk_audio_mclk_usb = on tile[1]: XS1_CLKBLK_1; /* Master clock for USB tile */
clock clk_audio_bclk = on tile[1]: XS1_CLKBLK_4; /* Bit clock */
clock clk_audio_mclk = on tile[1]: XS1_CLKBLK_5; /* Master clock */
clock clk_audio_mclk_usb = on tile[0]: XS1_CLKBLK_1; /* Master clock for USB tile */
/* Endpoint type tables - informs XUD what the transfer types for each Endpoint in use and also
* if the endpoint wishes to be informed of USB bus resets */
XUD_EpType epTypeTableOut[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO};
XUD_EpType epTypeTableIn[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO};
/* Port declarations for I2C to config ADC's */
on tile[0]: port p_scl = XS1_PORT_1L;
on tile[0]: port p_sda = XS1_PORT_1M;
/* See hwsupport.xc */
void ctrlPort();
int main()
{
/* Channels for lib_xud */
@@ -51,25 +57,25 @@ int main()
/* Channel for audio data between buffering cores and AudioHub/IO core */
chan c_aud;
/* Channel for communicating control messages from EP0 to the rest of the device (via the buffering cores) */
chan c_aud_ctl;
par
{
/* Low level USB device layer core */
on tile[1]: XUD_Main(c_ep_out, 2, c_ep_in, 2,
c_sof, epTypeTableOut, epTypeTableIn,
/* Low level USB device layer core */
on tile[0]: XUD_Main(c_ep_out, 2, c_ep_in, 2,
c_sof, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_SELF);
/* Endpoint 0 core from lib_xua */
/* Note, since we are not using many features we pass in null for quite a few params.. */
on tile[1]: XUA_Endpoint0(c_ep_out[0], c_ep_in[0], c_aud_ctl, null, null, null, null);
on tile[0]: XUA_Endpoint0(c_ep_out[0], c_ep_in[0], c_aud_ctl, null, null, null, null);
/* Buffering cores - handles audio data to/from EP's and gives/gets data to/from the audio I/O core */
/* Note, this spawns two cores */
on tile[1]: {
on tile[0]: {
/* Connect master-clock clock-block to clock-block pin */
set_clock_src(clk_audio_mclk_usb, p_mclk_in_usb); /* Clock clock-block from mclk pin */
set_port_clock(p_for_mclk_count, clk_audio_mclk_usb); /* Clock the "count" port from the clock block */
@@ -80,9 +86,11 @@ int main()
}
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
on tile[0]: XUA_AudioHub(c_aud, clk_audio_mclk, clk_audio_bclk, p_mclk_in, p_lrclk, p_bclk, p_i2s_dac, p_i2s_adc);
on tile[1]: XUA_AudioHub(c_aud, clk_audio_mclk, clk_audio_bclk, p_mclk_in, p_lrclk, p_bclk, p_i2s_dac, null);
on tile[0]: ctrlPort();
}
return 0;
}

View File

@@ -1,112 +0,0 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __hid_report_descriptor_h__
#define __hid_report_descriptor_h__
#include "xua_hid_report_descriptor.h"
#if 0
/* Existing static report descriptor kept for reference */
unsigned char hidReportDescriptor[] =
{
0x05, 0x0c, /* Usage Page (Consumer Device) */
0x09, 0x01, /* Usage (Consumer Control) */
0xa1, 0x01, /* Collection (Application) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x09, 0xb0, /* Usage (Play) */
0x09, 0xb5, /* Usage (Scan Next Track) */
0x09, 0xb6, /* Usage (Scan Previous Track) */
0x09, 0xe9, /* Usage (Volume Up) */
0x09, 0xea, /* Usage (Volume Down) */
0x09, 0xe2, /* Usage (Mute) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x06, /* Report Count (6) */
0x81, 0x02, /* Input (Data, Var, Abs) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x01, /* Input (Cnst, Ary, Abs) */
0xc0 /* End collection */
};
#endif
/*
* Define non-configurable items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t hidCollectionApplication = { .header = 0xA1, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidCollectionEnd = { .header = 0xC0, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputConstArray = { .header = 0x81, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputDataVar = { .header = 0x81, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum0 = { .header = 0x25, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum1 = { .header = 0x25, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMinimum0 = { .header = 0x15, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount2 = { .header = 0x95, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount6 = { .header = 0x95, .data = { 0x06, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportSize1 = { .header = 0x75, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsageConsumerControl = { .header = 0x09, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsagePageConsumer = { .header = 0x05, .data = { 0x0C, 0x00 }, .location = 0x00 };
/*
* Define configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t hidUsageByte0Bit5 = { .header = 0x09, .data = { 0xE2, 0x00 }, .location = 0x50 }; // Mute
static USB_HID_Short_Item_t hidUsageByte0Bit4 = { .header = 0x09, .data = { 0xEA, 0x00 }, .location = 0x40 }; // Vol-
static USB_HID_Short_Item_t hidUsageByte0Bit3 = { .header = 0x09, .data = { 0xE9, 0x00 }, .location = 0x30 }; // Vol+
static USB_HID_Short_Item_t hidUsageByte0Bit2 = { .header = 0x09, .data = { 0xB6, 0x00 }, .location = 0x20 }; // Scan Prev
static USB_HID_Short_Item_t hidUsageByte0Bit1 = { .header = 0x09, .data = { 0xB5, 0x00 }, .location = 0x10 }; // Scan Next
static USB_HID_Short_Item_t hidUsageByte0Bit0 = { .header = 0x09, .data = { 0xB0, 0x00 }, .location = 0x00 }; // Play
/*
* List the configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t* const hidConfigurableItems[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* List Usage pages in the HID Report descriptor, one per byte.
*/
static const USB_HID_Short_Item_t* const hidUsagePages[] = {
&hidUsagePageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&hidUsagePageConsumer,
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5,
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* Define the length of the HID Report.
* This value must match the number of Report bytes defined by hidReportDescriptorItems.
*/
#define HID_REPORT_LENGTH ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,146 +1,56 @@
// Copyright 2016-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
#include <platform.h>
#include <timer.h>
#include <stdint.h>
#include "xua.h"
#include "i2c.h" /* From lib_i2c */
#include "../../shared/apppll.h"
#include "cs5368.h"
#include "cs4384.h"
on tile[0]: out port p_ctrl = XS1_PORT_8D;
port p_i2c = on tile[0]:XS1_PORT_4A;
/* p_ctrl:
* [0:3] - Unused
* [4] - EN_3v3_N
* [5] - EN_3v3A
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
* [7] - MCLK_DIR (Out:0, In: 1)
*/
#define EXT_PLL_SEL__MCLK_DIR (0x80)
/* General output port bit definitions */
#define P_GPIO_DSD_MODE (1 << 0) /* DSD mode select 0 = 8i/8o I2S, 1 = 8o DSD*/
#define P_GPIO_DAC_RST_N (1 << 1)
#define P_GPIO_USB_SEL0 (1 << 2)
#define P_GPIO_USB_SEL1 (1 << 3)
#define P_GPIO_VBUS_EN (1 << 4)
#define P_GPIO_PLL_SEL (1 << 5) /* 1 = CS2100, 0 = Phaselink clock source */
#define P_GPIO_ADC_RST_N (1 << 6)
#define P_GPIO_MCLK_FSEL (1 << 7) /* Select frequency on Phaselink clock. 0 = 24.576MHz for 48k, 1 = 22.5792MHz for 44.1k.*/
#define DAC_REGWRITE(reg, val) result = i2c.write_reg(CS4384_I2C_ADDR, reg, val);
#define DAC_REGREAD(reg) data = i2c.read_reg(CS4384_I2C_ADDR, reg, result);
#define ADC_REGWRITE(reg, val) result = i2c.write_reg(CS5368_I2C_ADDR, reg, val);
out port p_gpio = on tile[0]:XS1_PORT_8C;
void AudioHwConfig2(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC, client interface i2c_master_if i2c)
/* Note, this runs on Tile[0] */
void ctrlPort()
{
unsigned char gpioVal = 0;
i2c_regop_res_t result;
/* Set master clock select appropriately and put ADC and DAC into reset */
if (mClk == MCLK_441)
// Drive control port to turn on 3V3 and set MCLK_DIR
// Note, "soft-start" to reduce current spike
// Note, 3v3_EN is inverted
for (int i = 0; i < 30; i++)
{
gpioVal = P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
p_ctrl <: EXT_PLL_SEL__MCLK_DIR | 0x30; /* 3v3: off, 3v3A: on */
delay_microseconds(5);
p_ctrl <: EXT_PLL_SEL__MCLK_DIR | 0x20; /* 3v3: on, 3v3A: on */
delay_microseconds(5);
}
else
{
gpioVal = P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1 | P_GPIO_MCLK_FSEL;
}
p_gpio <: gpioVal;
/* Allow MCLK to settle */
delay_microseconds(20000);
/* Take ADC out of reset */
gpioVal |= P_GPIO_ADC_RST_N;
p_gpio <: gpioVal;
/* Configure ADC for I2S slave mode via I2C */
unsigned dif = 0, mode = 0;
dif = 0x01; /* I2S */
mode = 0x03; /* Slave mode all speeds */
/* Reg 0x01: (GCTL) Global Mode Control Register
* Bit[7]: CP-EN: Manages control-port mode
* Bit[6]: CLKMODE: Setting puts part in 384x mode
* Bit[5:4]: MDIV[1:0]: Set to 01 for /2
* Bit[3:2]: DIF[1:0]: Data Format: 0x01 for I2S, 0x02 for TDM
* Bit[1:0]: MODE[1:0]: Mode: 0x11 for slave mode
*/
ADC_REGWRITE(CS5368_GCTL_MDE, 0b10010000 | (dif << 2) | mode);
/* Reg 0x06: (PDN) Power Down Register */
/* Bit[7:6]: Reserved
* Bit[5]: PDN-BG: When set, this bit powers-own the bandgap reference
* Bit[4]: PDM-OSC: Controls power to internal oscillator core
* Bit[3:0]: PDN: When any bit is set all clocks going to that channel pair are turned off
*/
ADC_REGWRITE(CS5368_PWR_DN, 0b00000000);
/* Configure DAC with PCM values. Note 2 writes to mode control to enable/disable freeze/power down */
/* Take DAC out of reset */
gpioVal |= P_GPIO_DAC_RST_N;
p_gpio <: gpioVal;
delay_microseconds(500);
/* Mode Control 1 (Address: 0x02) */
/* bit[7] : Control Port Enable (CPEN) : Set to 1 for enable
* bit[6] : Freeze controls (FREEZE) : Set to 1 for freeze
* bit[5] : PCM/DSD Selection (DSD/PCM) : Set to 0 for PCM
* bit[4:1] : DAC Pair Disable (DACx_DIS) : All Dac Pairs enabled
* bit[0] : Power Down (PDN) : Powered down
*/
DAC_REGWRITE(CS4384_MODE_CTRL, 0b11000001);
/* PCM Control (Address: 0x03) */
/* bit[7:4] : Digital Interface Format (DIF) : 0b0001 for I2S up to 24bit
* bit[3:2] : Reserved
* bit[1:0] : Functional Mode (FM) : 0x00 - single-speed mode (4-50kHz)
* : 0x01 - double-speed mode (50-100kHz)
* : 0x10 - quad-speed mode (100-200kHz)
* : 0x11 - auto-speed detect (32 to 200kHz)
* (note, some Mclk/SR ratios not supported in auto)
*
*/
unsigned char regVal = 0;
if(samFreq < 50000)
regVal = 0b00010100;
else if(samFreq < 100000)
regVal = 0b00010101;
else //if(samFreq < 200000)
regVal = 0b00010110;
DAC_REGWRITE(CS4384_PCM_CTRL, regVal);
/* Mode Control 1 (Address: 0x02) */
/* bit[7] : Control Port Enable (CPEN) : Set to 1 for enable
* bit[6] : Freeze controls (FREEZE) : Set to 0 for freeze
* bit[5] : PCM/DSD Selection (DSD/PCM) : Set to 0 for PCM
* bit[4:1] : DAC Pair Disable (DACx_DIS) : All Dac Pairs enabled
* bit[0] : Power Down (PDN) : Not powered down
*/
DAC_REGWRITE(CS4384_MODE_CTRL, 0b10000000);
/* Kill the i2c task */
i2c.shutdown();
return;
}
/* Configures the external audio hardware at startup. Note this runs on Tile[1] */
void AudioHwInit()
{
/* Set USB Mux to micro-b */
/* ADC and DAC in reset */
p_gpio <: P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
/* Wait for power supply to come up */
delay_milliseconds(100);
/* Use xCORE Secondary PLL to generate *fixed* master clock */
AppPllEnable_SampleRate(DEFAULT_FREQ);
delay_milliseconds(100);
/* DAC setup: For basic I2S input we don't need any register setup. DACs will clock auto detect etc.
* It holds DAC in reset until it gets clocks anyway.
* Note, this example doesn't use the ADC's
*/
}
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
/* Configures the external audio hardware for the required sample frequency */
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC)
{
i2c_master_if i2c[1];
par
{
i2c_master_single_port(i2c, 1, p_i2c, 10, 0, 1, 0);
AudioHwConfig2(samFreq, mClk, dsdMode, sampRes_DAC, sampRes_ADC, i2c[0]);
}
AppPllEnable_SampleRate(samFreq);
}

View File

@@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xmos.com http://www.xmos.com" ManuallySpecifiedRouting="true">
<Type>Board</Type>
<Name>XS2 MC Audio</Name>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
<Declaration>tileref usb_tile</Declaration>
</Declarations>
<Packages>
<Package id="0" Type="XS2-UnA-512-FB236">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS2-L16A-512" Oscillator="24MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="SPI:bootFlash"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
<Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_1A" Name="PORT_PLL_REF"/>
<Port Location="XS1_PORT_1F" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1G" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1H" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1M" Name="PORT_I2S_DAC0"/>
<port Location="XS1_PORT_1N" Name="PORT_I2S_DAC1"/>
<port Location="XS1_PORT_1O" Name="PORT_I2S_DAC2"/>
<port Location="XS1_PORT_1P" Name="PORT_I2S_DAC3"/>
<Port Location="XS1_PORT_1I" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_1J" Name="PORT_I2S_ADC1"/>
<Port Location="XS1_PORT_1K" Name="PORT_I2S_ADC2"/>
<Port Location="XS1_PORT_1L" Name="PORT_I2S_ADC3"/>
<Port Location="XS1_PORT_4A" Name="PORT_I2C"/>
<Port Location="XS1_PORT_1M" Name="PORT_DSD_DAC0"/>
<port Location="XS1_PORT_1N" Name="PORT_DSD_DAC1"/>
<Port Location="XS1_PORT_1G" Name="PORT_DSD_CLK"/>
<Port Location="XS1_PORT_1E" Name="PORT_ADAT_OUT"/>--> <!-- D: COAX E: OPT -->
<Port Location="XS1_PORT_1D" Name="PORT_SPDIF_OUT"/>--> <!-- D: COAX E: OPT -->
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- USB intended to run on this tile -->
<!-- Ports for USB feedback calculation -->
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
<Port Location="XS1_PORT_1L" Name="PORT_MCLK_IN_USB"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_1M" Name="PORT_MIDI_IN"/>
<Port Location="XS1_PORT_1N" Name="PORT_MIDI_OUT"/>
<Port Location="XS1_PORT_1O" Name="PORT_ADAT_IN"/>--> <!-- P: COAX O: OPT -->
<Port Location="XS1_PORT_1P" Name="PORT_SPDIF_IN"/>--> <!-- P: COAX O: OPT -->
</Tile>
</Node>
<Node Id="1" InPackageId="1" Type="periph:XS1-SU" Reference="usb_tile" Oscillator="24MHz">
</Node>
</Nodes>
<Links>
<Link Encoding="5wire">
<LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk"/>
<LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk"/>
</Link>
</Links>
</Package>
</Packages>
<Nodes>
<Node Id="2" Type="device:" RoutingId="0x8000">
<Service Id="0" Proto="xscope_host_data(chanend c);">
<Chanend Identifier="c" end="3"/>
</Service>
</Node>
</Nodes>
<Links>
<Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
<LinkEndpoint NodeId="0" Link="XL0"/>
<LinkEndpoint NodeId="2" Chanend="1"/>
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K" PageSize="256" SectorSize="4096" NumPages="8192">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
<JTAGDevice NodeId="1"/>
</JTAGChain>
</Network>

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
<Type>Board</Type>
<Name>xcore.ai MC Audio Board</Name>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
</Declarations>
<Packages>
<Package id="0" Type="XS3-UnA-1024-FB265">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS3-L16A-1024" Oscillator="24MHz" SystemFrequency="600MHz" ReferenceFrequency="100MHz">
<Boot>
<Source Location="bootFlash"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
<Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>
<!-- Various ctrl signals -->
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<!-- I2C -->
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<!-- Clocking -->
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
<Port Location="XS1_PORT_1D" Name="PORT_MCLK_IN_USB"/>
<Port Location="XS1_PORT_1A" Name="PORT_PLL_REF"/>
<!-- Audio Ports: Digital -->
<Port Location="XS1_PORT_1O" Name="PORT_ADAT_IN"/> <!-- N: Coax O: Optical -->
<Port Location="XS1_PORT_1N" Name="PORT_SPDIF_IN"/> <!-- N: Coax O: Optical -->
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- Audio Ports: I2S -->
<Port Location="XS1_PORT_1D" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1B" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1C" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1P" Name="PORT_I2S_DAC0"/>
<port Location="XS1_PORT_1O" Name="PORT_I2S_DAC1"/>
<port Location="XS1_PORT_1N" Name="PORT_I2S_DAC2"/>
<port Location="XS1_PORT_1M" Name="PORT_I2S_DAC3"/>
<Port Location="XS1_PORT_1I" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_1J" Name="PORT_I2S_ADC1"/>
<Port Location="XS1_PORT_1K" Name="PORT_I2S_ADC2"/>
<Port Location="XS1_PORT_1L" Name="PORT_I2S_ADC3"/>
<!-- Audio Ports: Digital -->
<Port Location="XS1_PORT_1E" Name="PORT_ADAT_OUT"/> <!-- A: Coax E: Optical -->
<Port Location="XS1_PORT_1A" Name="PORT_SPDIF_OUT"/> <!-- A: Coax E: Optical -->
<!-- MIDI -->
<Port Location="XS1_PORT_1F" Name="PORT_MIDI_IN"/>
<Port Location="XS1_PORT_4C" Name="PORT_MIDI_OUT"/> <!-- bit[0] -->
</Tile>
</Node>
</Nodes>
</Package>
</Packages>
<Nodes>
<Node Id="2" Type="device:" RoutingId="0x8000">
<Service Id="0" Proto="xscope_host_data(chanend c);">
<Chanend Identifier="c" end="3"/>
</Service>
</Node>
</Nodes>
<Links>
<Link Encoding="2wire" Delays="5clk" Flags="XSCOPE">
<LinkEndpoint NodeId="0" Link="XL0"/>
<LinkEndpoint NodeId="2" Chanend="1"/>
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" PageSize="256" SectorSize="4096" NumPages="8192">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
</JTAGChain>
</Network>

View File

@@ -1,13 +1,13 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_CONF_H_
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
#define NUM_USB_CHAN_OUT 2 /* Number of channels from host to device */
#define NUM_USB_CHAN_IN 2 /* Number of channels from device to host */
#define NUM_USB_CHAN_IN 0 /* Number of channels from device to host */
#define I2S_CHANS_DAC 2 /* Number of I2S channels out of xCORE */
#define I2S_CHANS_ADC 2 /* Number of I2S channels in to 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 MIN_FREQ 48000 /* Minimum sample rate */
@@ -19,7 +19,7 @@
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA Example"
#define PRODUCT_STR_A1 "XUA Example"
#define PID_AUDIO_1 1
#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

View File

@@ -1,11 +1,13 @@
APP_NAME = app_xua_simple
APP_NAME = app_xua_spdiftx
TARGET = xk-audio-216-mc.xn
TARGET = xk-audio-316-mc.xn
# The flags passed to xcc when building the application
XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \
-g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES \
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[1] -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope
XCC_FLAGS = -O3 -report \
-g -Wno-unused-function \
-DXUD_CORE_CLOCK=600 \
-DUSB_TILE=tile[0] \
-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.
@@ -18,4 +20,3 @@ USED_MODULES = lib_xua lib_xud lib_spdif
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -8,13 +8,13 @@ Overview
Introduction
............
The XMOS USB Audio (XUA) library provides an implemention of USB Audio Class versions 1.0 and 2.0.
The XMOS USB Audio (XUA) library provides an implementation of USB Audio Class versions 1.0 and 2.0.
This application note demonstrates the implementation of a basic USB Audio Device with
S/PDIF transmit functionality the xCORE-200 MC Audio board.
S/PDIF transmit functionality the xCORE.ai Multichannel (MC) Audio board.
To reduce complexity this application note does not enable any other audio interfaces other that S/PDIF transmit
(i.e. no I2S). Readers are encouraged to read applicaition note AN00246 in conjunction with this application
(i.e. no I2S). Readers are encouraged to read application note AN00246 in conjunction with this application
note.
@@ -30,14 +30,11 @@ The Makefile also includes::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly the
``lib_xud`` library requires some flags for correct operation. Namely the
tile on which ``lib_xud`` will be execute, for example::
XCC_FLAGS = .. -DUSB_TILE=tile[1] ..
XCC_FLAGS = .. -DUSB_TILE=tile[0] ..
Secondly, the architecture of the target device, for example::
XCC_FLAGS = .. -DXUD_SERIES_SUPPORT=XUD_X200_SERIES ..
Includes
--------
@@ -45,21 +42,21 @@ Includes
This application requires the system header that defines XMOS xCORE specific
defines for declaring and initialising hardware:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: include <xs1.h>
: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
.. literalinclude:: app_xua_spdiftx.xc
:start-on: include "xua.h"
:end-on: include "xud_device.h"
The application uses the S/PDIF transmitter from ``lib_spdif``. This header
must be included in your code.
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* From lib_spdif
:end-on: include "spdif.h"
@@ -69,7 +66,7 @@ Declarations
Allocating hardware resources for lib_xua
.........................................
A minimal implementation of a USB Audio device, without I2S functionalilty,
A minimal implementation of a USB Audio device, without I2S functionality,
using ``lib_xua`` requires the follow pins:
- Audio Master clock (from clock source to xCORE)
@@ -77,23 +74,23 @@ using ``lib_xua`` requires the follow pins:
On an xCORE the pins are controlled by ``ports``. The application therefore declares a
port for the master clock input signal.
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Lib_xua port declaration
:end-on: in port p_mclk_in
``lib_xua`` also requires two ports for internally calculating USB feedback. Please refer to
the ``lib_xua`` library documentation for further details. The additonal input port for the master
the ``lib_xua`` library documentation for further details. The additional input port for the master
clock is required since USB and S/PDIF do not reside of the same tiles on the example hardware.
These ports are declared as follows:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Resources for USB feedback
:end-on: in port p_mclk_in_usb
In addition to ``port`` resources two clock-block resources are also required:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Clock-block
:end-on: clock clk_audio_mclk_usb
@@ -106,14 +103,14 @@ Allocating hardware resources for lib_spdif
The S/PDIF transmitter requires a single (buffered) 1-bit port:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Lib_spdif port
:end-on: buffered out port
This port must be clocked from the audio master clock. This application note chooses to declare
an extra clock-block as follows:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: clock clk_spdif_tx
:end-before: /* Lib_xua
@@ -126,19 +123,19 @@ Other declarations
For a simple application the following endpoints are required:
- ``Control`` enpoint zero
- ``Control`` endpoint zero
- ``Isochonous`` endpoint for each direction for audio data to/from the USB host
These are declared as follows:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Endpoint type tables
:end-on: XUD_EpType epTypeTableIn
Configuring lib_xua
-------------------
``lib_xua`` must be configued to enable S/PDIF Tx functionality.
``lib_xua`` must be configured to enable S/PDIF Tx functionality.
``lib_xua`` has many parameters than can be configured at build time, some examples include:
@@ -164,26 +161,26 @@ 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.
Various channels are required in order to allow the required tasks to communicate.
These must first be declared:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:start-on: /* Channels for lib_xud
:end-on: chan c_spdif_tx
The rest of the ``main()`` function starts all of the tasks in parallel
using the xC ``par`` construct:
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.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. Note, since there is no I2S funcitonality in this example this task simply forwards samples to the
the audio I/O. Note, since there is no I2S functionality in this example this task simply forwards samples to the
SPDIF transmitter task. In addition the ``spdif_tx()`` task is also run.
Note that the ``spdif_tx_port_config()`` function is called before a nested ``par`` of ``spdif_tx()`` and ``XUA_AudioHub()``.
This is because of the "shared" nature of ``p_mclk_in`` and avoids a parrallel usage check failure by the XMOS toolchain.
This is because of the "shared" nature of ``p_mclk_in`` and avoids a parallel usage check failure by the XMOS tool-chain.
|appendix|
|newpage|
@@ -191,9 +188,10 @@ This is because of the "shared" nature of ``p_mclk_in`` and avoids a parrallel u
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.
To run the demo, use a USB cable to connect the on-board xTAG debug adapter (marked DEBUG) to your development computer.
Use another USB cable to connect the USB receptacle marked USB DEVICE to the device you wish to play audio from.
A device capable of receiving an S/PDIF signal (ie. a speaker) should be connected to COAX TX.
.. figure:: images/hw_setup.*
:width: 80%
@@ -206,7 +204,7 @@ 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
via the build mechanism of xTIMEcomposer studio it can be executed on the xCORE.ai
MC Audio board.
Once built there will be a ``bin/`` directory within the project which contains
@@ -221,7 +219,7 @@ 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
xCORE.ai MC Audio Board
Launching from xTIMEcomposer Studio
...................................
@@ -233,7 +231,7 @@ 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.
xCORE.ai MC Audio board.
Running the application
.......................
@@ -272,7 +270,7 @@ Full source code listing
Source code for main.xc
.......................
.. literalinclude:: app_xua_simple.xc
.. literalinclude:: app_xua_spdiftx.xc
:largelisting:
|newpage|

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 4.2 MiB

View File

@@ -1,2 +1,3 @@
XMOSNEWSTYLE=1
SOURCE_INCLUDE_DIRS=../../src
XMOSNEWSTYLE=2
SOURCE_INCLUDE_DIRS=../../src
SPHINX_MASTER_DOC=AN00247_xua_example_spdif_tx

View File

@@ -1,9 +1,9 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
/* A very simple *example* of a USB audio application (and as such is un-verified for production)
*
* It uses the main blocks from the lib_xua
* It uses the main blocks from the lib_xua
*
* - S/PDIF output only
* - No DFU
@@ -20,9 +20,9 @@
#include "spdif.h"
/* Lib_spdif port declarations. Note, the defines come from the xn file */
buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT; /* SPDIF transmit port */
buffered out port:32 p_spdif_tx = PORT_COAX_OUT; /* SPDIF transmit port */
clock clk_spdif_tx = on tile[0]: XS1_CLKBLK_4; /* Clock block for S/PDIF transmit */
clock clk_spdif_tx = on tile[1]: XS1_CLKBLK_4; /* Clock block for S/PDIF transmit */
/* Lib_xua port declarations. Note, the defines come from the xn file */
in port p_mclk_in = PORT_MCLK_IN; /* Master clock for the audio IO tile */
@@ -32,14 +32,17 @@ in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for count
in port p_mclk_in_usb = PORT_MCLK_IN_USB; /* Extra master clock input for the USB tile */
/* Clock-block declarations */
clock clk_audio_mclk = on tile[0]: XS1_CLKBLK_5; /* Master clock */
clock clk_audio_mclk_usb = on tile[1]: XS1_CLKBLK_1; /* Master clock for USB tile */
clock clk_audio_mclk = on tile[1]: XS1_CLKBLK_5; /* Master clock */
clock clk_audio_mclk_usb = on tile[0]: XS1_CLKBLK_1; /* Master clock for USB tile */
/* Endpoint type tables - informs XUD what the transfer types for each Endpoint in use and also
* if the endpoint wishes to be informed of USB bus resets */
XUD_EpType epTypeTableOut[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO};
XUD_EpType epTypeTableIn[] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_ISO};
/* From hwsupport.h */
void ctrlPort();
int main()
{
/* Channels for lib_xud */
@@ -51,7 +54,7 @@ int main()
/* Channel for audio data between buffering cores and AudioHub/IO core */
chan c_aud;
/* Channel for communicating control messages from EP0 to the rest of the device (via the buffering cores) */
chan c_aud_ctl;
@@ -60,17 +63,17 @@ int main()
par
{
/* Low level USB device layer core */
on tile[1]: XUD_Main(c_ep_out, 2, c_ep_in, 2, c_sof, epTypeTableOut, epTypeTableIn, XUD_SPEED_HS, XUD_PWR_SELF);
/* Low level USB device layer core */
on tile[0]: XUD_Main(c_ep_out, 2, c_ep_in, 2, c_sof, epTypeTableOut, epTypeTableIn, XUD_SPEED_HS, XUD_PWR_SELF);
/* Endpoint 0 core from lib_xua */
/* Note, since we are not using many features we pass in null for quite a few params.. */
on tile[1]: XUA_Endpoint0(c_ep_out[0], c_ep_in[0], c_aud_ctl, null, null, null, null);
on tile[0]: XUA_Endpoint0(c_ep_out[0], c_ep_in[0], c_aud_ctl, null, null, null, null);
/* Buffering cores - handles audio data to/from EP's and gives/gets data to/from the audio I/O core */
/* Note, this spawns two cores */
on tile[1]: {
on tile[0]: {
/* Connect master-clock clock-block to clock-block pin */
set_clock_src(clk_audio_mclk_usb, p_mclk_in_usb); /* Clock clock-block from mclk pin */
set_port_clock(p_for_mclk_count, clk_audio_mclk_usb); /* Clock the "count" port from the clock block */
@@ -78,28 +81,32 @@ int main()
XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
}
/* AudioHub() (I2S) and S/SPDIF Tx are on the same tile */
on tile[0]: {
on tile[1]: {
/* Setup S/PDIF tx port from clock etc - note we do this before par to avoid parallel usage */
spdif_tx_port_config(p_spdif_tx, clk_spdif_tx, p_mclk_in, 7);
start_clock(clk_spdif_tx);
par
{
while(1)
{
/* Run the S/PDIF transmitter task */
spdif_tx(p_spdif_tx, c_spdif_tx);
spdif_tx(p_spdif_tx, c_spdif_tx);
}
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
/* Note, since we are not using I2S we pass in null for LR and Bit clock ports and the I2S dataline ports */
XUA_AudioHub(c_aud, clk_audio_mclk, null, p_mclk_in, null, null, null, null, c_spdif_tx);
}
}
on tile[0]: ctrlPort();
}
return 0;
}

View File

@@ -1,112 +0,0 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __hid_report_descriptor_h__
#define __hid_report_descriptor_h__
#include "xua_hid_report_descriptor.h"
#if 0
/* Existing static report descriptor kept for reference */
unsigned char hidReportDescriptor[] =
{
0x05, 0x0c, /* Usage Page (Consumer Device) */
0x09, 0x01, /* Usage (Consumer Control) */
0xa1, 0x01, /* Collection (Application) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x09, 0xb0, /* Usage (Play) */
0x09, 0xb5, /* Usage (Scan Next Track) */
0x09, 0xb6, /* Usage (Scan Previous Track) */
0x09, 0xe9, /* Usage (Volume Up) */
0x09, 0xea, /* Usage (Volume Down) */
0x09, 0xe2, /* Usage (Mute) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x06, /* Report Count (6) */
0x81, 0x02, /* Input (Data, Var, Abs) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x01, /* Input (Cnst, Ary, Abs) */
0xc0 /* End collection */
};
#endif
/*
* Define non-configurable items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t hidCollectionApplication = { .header = 0xA1, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidCollectionEnd = { .header = 0xC0, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputConstArray = { .header = 0x81, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputDataVar = { .header = 0x81, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum0 = { .header = 0x25, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum1 = { .header = 0x25, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMinimum0 = { .header = 0x15, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount2 = { .header = 0x95, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount6 = { .header = 0x95, .data = { 0x06, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportSize1 = { .header = 0x75, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsageConsumerControl = { .header = 0x09, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsagePageConsumer = { .header = 0x05, .data = { 0x0C, 0x00 }, .location = 0x00 };
/*
* Define configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t hidUsageByte0Bit5 = { .header = 0x09, .data = { 0xE2, 0x00 }, .location = 0x50 }; // Mute
static USB_HID_Short_Item_t hidUsageByte0Bit4 = { .header = 0x09, .data = { 0xEA, 0x00 }, .location = 0x40 }; // Vol-
static USB_HID_Short_Item_t hidUsageByte0Bit3 = { .header = 0x09, .data = { 0xE9, 0x00 }, .location = 0x30 }; // Vol+
static USB_HID_Short_Item_t hidUsageByte0Bit2 = { .header = 0x09, .data = { 0xB6, 0x00 }, .location = 0x20 }; // Scan Prev
static USB_HID_Short_Item_t hidUsageByte0Bit1 = { .header = 0x09, .data = { 0xB5, 0x00 }, .location = 0x10 }; // Scan Next
static USB_HID_Short_Item_t hidUsageByte0Bit0 = { .header = 0x09, .data = { 0xB0, 0x00 }, .location = 0x00 }; // Play
/*
* List the configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t* const hidConfigurableItems[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* List Usage pages in the HID Report descriptor, one per byte.
*/
static const USB_HID_Short_Item_t* const hidUsagePages[] = {
&hidUsagePageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&hidUsagePageConsumer,
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5,
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* Define the length of the HID Report.
* This value must match the number of Report bytes defined by hidReportDescriptorItems.
*/
#define HID_REPORT_LENGTH ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,52 +1,56 @@
// Copyright 2016-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
#include <platform.h>
#include <timer.h>
#include "xua.h"
#include "../../shared/apppll.h"
/* General output port bit definitions */
#define P_GPIO_DSD_MODE (1 << 0) /* DSD mode select 0 = 8i/8o I2S, 1 = 8o DSD*/
#define P_GPIO_DAC_RST_N (1 << 1)
#define P_GPIO_USB_SEL0 (1 << 2)
#define P_GPIO_USB_SEL1 (1 << 3)
#define P_GPIO_VBUS_EN (1 << 4)
#define P_GPIO_PLL_SEL (1 << 5) /* 1 = CS2100, 0 = Phaselink clock source */
#define P_GPIO_ADC_RST_N (1 << 6)
#define P_GPIO_MCLK_FSEL (1 << 7) /* Select frequency on Phaselink clock. 0 = 24.576MHz for 48k, 1 = 22.5792MHz for 44.1k.*/
on tile[0]: out port p_ctrl = XS1_PORT_8D;
/* p_ctrl:
* [0:3] - Unused
* [4] - EN_3v3_N
* [5] - EN_3v3A
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
* [7] - MCLK_DIR (Out:0, In: 1)
*/
#define EXT_PLL_SEL__MCLK_DIR (0x80)
out port p_gpio = on tile[0]:XS1_PORT_8C;
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
/* Note, this runs on Tile[0] */
void ctrlPort()
{
unsigned char gpioVal = 0;
/* Set master clock select appropriately and put ADC and DAC into reset */
if (mClk == MCLK_441)
// Drive control port to turn on 3V3 and set MCLK_DIR
// Note, "soft-start" to reduce current spike
// Note, 3v3_EN is inverted
for (int i = 0; i < 30; i++)
{
gpioVal = P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
p_ctrl <: EXT_PLL_SEL__MCLK_DIR | 0x30; /* 3v3: off, 3v3A: on */
delay_microseconds(5);
p_ctrl <: EXT_PLL_SEL__MCLK_DIR | 0x20; /* 3v3: on, 3v3A: on */
delay_microseconds(5);
}
else
{
gpioVal = P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1 | P_GPIO_MCLK_FSEL;
}
/* Note, DAC and ADC held in reset */
p_gpio <: gpioVal;
/* Allow MCLK to settle */
delay_microseconds(20000);
return;
}
/* Configures the external audio hardware at startup. Note this runs on Tile[1] */
void AudioHwInit()
{
/* Set USB Mux to micro-b */
/* ADC and DAC in reset */
p_gpio <: P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
/* Wait for power supply to come up */
delay_milliseconds(100);
/* Use xCORE Secondary PLL to generate *fixed* master clock */
AppPllEnable_SampleRate(DEFAULT_FREQ);
delay_milliseconds(100);
/* DAC setup: For basic I2S input we don't need any register setup. DACs will clock auto detect etc.
* It holds DAC in reset until it gets clocks anyway.
* Note, this example doesn't use the ADC's
*/
}
/* Configures the external audio hardware for the required sample frequency */
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC)
{
AppPllEnable_SampleRate(samFreq);
}

View File

@@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xmos.com http://www.xmos.com" ManuallySpecifiedRouting="true">
<Type>Board</Type>
<Name>XS2 MC Audio</Name>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
<Declaration>tileref usb_tile</Declaration>
</Declarations>
<Packages>
<Package id="0" Type="XS2-UnA-512-FB236">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS2-L16A-512" Oscillator="24MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="SPI:bootFlash"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
<Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_1A" Name="PORT_PLL_REF"/>
<Port Location="XS1_PORT_1F" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1G" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1H" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1M" Name="PORT_I2S_DAC0"/>
<port Location="XS1_PORT_1N" Name="PORT_I2S_DAC1"/>
<port Location="XS1_PORT_1O" Name="PORT_I2S_DAC2"/>
<port Location="XS1_PORT_1P" Name="PORT_I2S_DAC3"/>
<Port Location="XS1_PORT_1I" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_1J" Name="PORT_I2S_ADC1"/>
<Port Location="XS1_PORT_1K" Name="PORT_I2S_ADC2"/>
<Port Location="XS1_PORT_1L" Name="PORT_I2S_ADC3"/>
<Port Location="XS1_PORT_4A" Name="PORT_I2C"/>
<Port Location="XS1_PORT_1M" Name="PORT_DSD_DAC0"/>
<port Location="XS1_PORT_1N" Name="PORT_DSD_DAC1"/>
<Port Location="XS1_PORT_1G" Name="PORT_DSD_CLK"/>
<Port Location="XS1_PORT_1E" Name="PORT_ADAT_OUT"/>--> <!-- D: COAX E: OPT -->
<Port Location="XS1_PORT_1D" Name="PORT_SPDIF_OUT"/>--> <!-- D: COAX E: OPT -->
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- USB intended to run on this tile -->
<!-- Ports for USB feedback calculation -->
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
<Port Location="XS1_PORT_1L" Name="PORT_MCLK_IN_USB"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_1M" Name="PORT_MIDI_IN"/>
<Port Location="XS1_PORT_1N" Name="PORT_MIDI_OUT"/>
<Port Location="XS1_PORT_1O" Name="PORT_ADAT_IN"/>--> <!-- P: COAX O: OPT -->
<Port Location="XS1_PORT_1P" Name="PORT_SPDIF_IN"/>--> <!-- P: COAX O: OPT -->
</Tile>
</Node>
<Node Id="1" InPackageId="1" Type="periph:XS1-SU" Reference="usb_tile" Oscillator="24MHz">
</Node>
</Nodes>
<Links>
<Link Encoding="5wire">
<LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk"/>
<LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk"/>
</Link>
</Links>
</Package>
</Packages>
<Nodes>
<Node Id="2" Type="device:" RoutingId="0x8000">
<Service Id="0" Proto="xscope_host_data(chanend c);">
<Chanend Identifier="c" end="3"/>
</Service>
</Node>
</Nodes>
<Links>
<Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
<LinkEndpoint NodeId="0" Link="XL0"/>
<LinkEndpoint NodeId="2" Chanend="1"/>
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K" PageSize="256" SectorSize="4096" NumPages="8192">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
<JTAGDevice NodeId="1"/>
</JTAGChain>
</Network>

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
<Type>Board</Type>
<Name>xcore.ai MC Audio Board</Name>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
</Declarations>
<Packages>
<Package id="0" Type="XS3-UnA-1024-FB265">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS3-L16A-1024" Oscillator="24MHz" SystemFrequency="600MHz" ReferenceFrequency="100MHz">
<Boot>
<Source Location="bootFlash"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
<Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>
<!-- Various ctrl signals -->
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<!-- I2C -->
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<Port Location="XS1_PORT_8D" Name="PORT_CTRL"/>
<!-- Clocking -->
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
<Port Location="XS1_PORT_1D" Name="PORT_MCLK_IN_USB"/>
<Port Location="XS1_PORT_1A" Name="PORT_PLL_REF"/>
<!-- Audio Ports: Digital -->
<Port Location="XS1_PORT_1O" Name="PORT_OPTICAL_IN"/>
<Port Location="XS1_PORT_1N" Name="PORT_COAX_IN"/>
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- Audio Ports: I2S -->
<Port Location="XS1_PORT_1D" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1B" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1C" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1P" Name="PORT_I2S_DAC0"/>
<port Location="XS1_PORT_1O" Name="PORT_I2S_DAC1"/>
<port Location="XS1_PORT_1N" Name="PORT_I2S_DAC2"/>
<port Location="XS1_PORT_1M" Name="PORT_I2S_DAC3"/>
<Port Location="XS1_PORT_1I" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_1J" Name="PORT_I2S_ADC1"/>
<Port Location="XS1_PORT_1K" Name="PORT_I2S_ADC2"/>
<Port Location="XS1_PORT_1L" Name="PORT_I2S_ADC3"/>
<!-- Audio Ports: Digital -->
<Port Location="XS1_PORT_1G" Name="PORT_OPTICAL_OUT"/>
<Port Location="XS1_PORT_1A" Name="PORT_COAX_OUT"/>
<!-- MIDI -->
<Port Location="XS1_PORT_1F" Name="PORT_MIDI_IN"/>
<Port Location="XS1_PORT_4C" Name="PORT_MIDI_OUT"/> <!-- bit[0] -->
</Tile>
</Node>
</Nodes>
</Package>
</Packages>
<Nodes>
<Node Id="2" Type="device:" RoutingId="0x8000">
<Service Id="0" Proto="xscope_host_data(chanend c);">
<Chanend Identifier="c" end="3"/>
</Service>
</Node>
</Nodes>
<Links>
<Link Encoding="2wire" Delays="5clk" Flags="XSCOPE">
<LinkEndpoint NodeId="0" Link="XL0"/>
<LinkEndpoint NodeId="2" Chanend="1"/>
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" PageSize="256" SectorSize="4096" NumPages="8192">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
</JTAGChain>
</Network>

View File

@@ -1,32 +1,31 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_CONF_H_
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
#define NUM_USB_CHAN_OUT 2
#define NUM_USB_CHAN_IN 0
#define I2S_CHANS_DAC 0
#define I2S_CHANS_ADC 0
#define MCLK_441 (512 * 44100)
#define MCLK_48 (512 * 48000)
#define MIN_FREQ 48000
#define MAX_FREQ 48000
#define NUM_USB_CHAN_OUT (2)
#define NUM_USB_CHAN_IN (0)
#define I2S_CHANS_DAC (0)
#define I2S_CHANS_ADC (0)
#define MCLK_441 (512 * 44100)
#define MCLK_48 (512 * 48000)
#define MIN_FREQ (48000)
#define MAX_FREQ (48000)
#define EXCLUDE_USB_AUDIO_MAIN
#define XUA_SPDIF_TX_EN 1
#define SPDIF_TX_INDEX 0
#define VENDOR_STR "XMOS"
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA SPDIF Example"
#define PRODUCT_STR_A1 "XUA SPDIF 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
#define MIC_DUAL_ENABLED 0 // Use multi-threaded design
#define XUA_SPDIF_TX_EN (1)
#define SPDIF_TX_INDEX (0)
#define VENDOR_STR "XMOS"
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA SPDIF Example"
#define PRODUCT_STR_A1 "XUA SPDIF 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)
#endif

View File

@@ -1,8 +0,0 @@
// Copyright 2017-2021 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

View File

@@ -5,7 +5,8 @@ TARGET = mic_array_ref.xn
# The flags passed to xcc when building the application
XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \
-g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES \
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[1] -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[1] -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope \
-DUAC_FORCE_FEEDBACK_EP=0
# The USED_MODULES variable lists other module used by the application. These
# modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables.
@@ -18,4 +19,3 @@ USED_MODULES = lib_xua lib_xud lib_mic_array
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -36,15 +36,11 @@ The Makefile therefore also includes this lib::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly the
``lib_xud`` library requires some flags for correct operation. Namely the
tile on which ``lib_xud`` will be executed, 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
--------
@@ -228,7 +224,7 @@ The ``mic_array_pdm_rx()`` task expects the PDM microphone port to be clocked fr
Demo Hardware Setup
-------------------
To run the demo, connect a USB cable to power the xCORE-200 MC Audio board
To run the demo, connect a USB cable to power the xCORE-200 Array Microphone board
and plug the xTAG to the board and connect the xTAG USB cable to your
development machine.
@@ -244,7 +240,7 @@ 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.
Array Microphone 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.
@@ -258,7 +254,7 @@ 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
xCORE-200 Array Microphone board
Launching from xTIMEcomposer Studio
...................................
@@ -270,7 +266,7 @@ 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.
xCORE-200 Array Microphone board.
Running the application
.......................

View File

@@ -1,2 +1,3 @@
XMOSNEWSTYLE=1
SOURCE_INCLUDE_DIRS=../../src
XMOSNEWSTYLE=2
SOURCE_INCLUDE_DIRS=../../src
SPHINX_MASTER_DOC=AN00248_xua_example_pdm_mics

View File

@@ -1,9 +1,9 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
/* A very simple *example* of a USB audio application (and as such is un-verified for production)
*
* It uses the main blocks from the lib_xua with the addition of PDM mic support using lib_mic_array
* It uses the main blocks from the lib_xua with the addition of PDM mic support using lib_mic_array
*
* - No DFU
*
@@ -24,7 +24,7 @@ in port p_pdm_mclk = PORT_PDM_MCLK; /* Master clock f
in buffered port:32 p_pdm_mics = PORT_PDM_DATA; /* Port for PDM mic data */
clock clk_pdm = on tile[0]: XS1_CLKBLK_1; /* Clock-block for PDM mics */
clock clk_pdm = on tile[0]: XS1_CLKBLK_1; /* Clock-block for PDM mics */
/* Lib_xua port declarations. Note, the defines come from the xn file */
@@ -52,7 +52,7 @@ int main()
/* Channel for audio data between buffering cores and AudioHub/IO core */
chan c_aud;
/* Channel for communicating control messages from EP0 to the rest of the device (via the buffering cores) */
chan c_aud_ctl;
@@ -64,26 +64,26 @@ int main()
par
{
/* Low level USB device layer core */
/* Low level USB device layer core */
on tile[1]: XUD_Main(c_ep_out, 2, c_ep_in, 2, c_sof, epTypeTableOut, epTypeTableIn, XUD_SPEED_HS, XUD_PWR_BUS);
/* Endpoint 0 core from lib_xua */
/* Note, since we are not using many features we pass in null for quite a few params.. */
on tile[1]: XUA_Endpoint0(c_ep_out[0], c_ep_in[0], c_aud_ctl, null, null, null, null);
on tile[1]:
on tile[1]:
{
/* Connect master-clock clock-block to clock-block pin */
set_clock_src(clk_audio_mclk, p_mclk_in); /* Clock clock-block from mclk pin */
set_port_clock(p_for_mclk_count, clk_audio_mclk); /* Clock the "count" port from the clock block */
/* Note, AudioHub() will start the clock */
par
{
/* Buffering task - handles audio data to/from EP's and gives/gets data to/from the audio I/O core */
/* Note, this spawns two cores */
XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
/* Note, since we are not using I2S we pass in null for LR and Bit clock ports and the I2S dataline ports */
XUA_AudioHub(c_aud, clk_audio_mclk, null, p_mclk_in, null, null, null, null, c_mic_pcm);
@@ -105,7 +105,7 @@ int main()
{
/* PDM receive I/O task */
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
/* Run two decimator tasks for 8 mics */
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
@@ -114,7 +114,7 @@ int main()
}
}
}
return 0;
}

View File

@@ -1,4 +1,4 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
@@ -16,7 +16,7 @@ void AudioHwInit()
/* DAC in reset */
p_gpio <: 0;
return;
return;
}
/* Configures the external audio hardware for the required sample frequency */

View File

@@ -1,9 +1,9 @@
// Copyright 2021 XMOS LIMITED.
// Copyright 2021-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __hid_report_descriptor_h__
#define __hid_report_descriptor_h__
#include "xua_hid_report_descriptor.h"
#include "xua_hid_report.h"
#if 0
/* Existing static report descriptor kept for reference */
@@ -32,38 +32,92 @@ unsigned char hidReportDescriptor[] =
/*
* Define non-configurable items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t hidCollectionApplication = { .header = 0xA1, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidCollectionEnd = { .header = 0xC0, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidCollectionApplication = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_MAIN, HID_REPORT_ITEM_TAG_COLLECTION),
.data = { 0x01, 0x00 } };
static const USB_HID_Short_Item_t hidCollectionEnd = {
.header = HID_REPORT_SET_HEADER(0, HID_REPORT_ITEM_TYPE_MAIN, HID_REPORT_ITEM_TAG_END_COLLECTION),
.data = { 0x00, 0x00 } };
static const USB_HID_Short_Item_t hidInputConstArray = { .header = 0x81, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputDataVar = { .header = 0x81, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputConstArray = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_MAIN, HID_REPORT_ITEM_TAG_INPUT),
.data = { 0x01, 0x00 } };
static const USB_HID_Short_Item_t hidInputDataVar = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_MAIN, HID_REPORT_ITEM_TAG_INPUT),
.data = { 0x02, 0x00 } };
static const USB_HID_Short_Item_t hidLogicalMaximum0 = { .header = 0x25, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum1 = { .header = 0x25, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMinimum0 = { .header = 0x15, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum0 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_LOGICAL_MAXIMUM),
.data = { 0x00, 0x00 } };
static const USB_HID_Short_Item_t hidLogicalMaximum1 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_LOGICAL_MAXIMUM),
.data = { 0x01, 0x00 } };
static const USB_HID_Short_Item_t hidLogicalMinimum0 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_LOGICAL_MINIMUM),
.data = { 0x00, 0x00 } };
static const USB_HID_Short_Item_t hidReportCount2 = { .header = 0x95, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount6 = { .header = 0x95, .data = { 0x06, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportSize1 = { .header = 0x75, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount2 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_REPORT_COUNT),
.data = { 0x02, 0x00 } };
static const USB_HID_Short_Item_t hidReportCount6 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_REPORT_COUNT),
.data = { 0x06, 0x00 } };
static const USB_HID_Short_Item_t hidReportSize1 = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_REPORT_SIZE),
.data = { 0x01, 0x00 } };
static const USB_HID_Short_Item_t hidUsageConsumerControl = { .header = 0x09, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsageConsumerControl = {
.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.data = { 0x01, 0x00 } };
static const USB_HID_Short_Item_t hidUsagePageConsumer = { .header = 0x05, .data = { 0x0C, 0x00 }, .location = 0x00 };
/*
* Define the HID Report Descriptor Item, Usage Page, Report ID and length for each HID Report
* For internal purposes, a report element with ID of 0 must be included if report IDs are not being used.
*/
static const USB_HID_Report_Element_t hidReportPageConsumer = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_GLOBAL, HID_REPORT_ITEM_TAG_USAGE_PAGE),
.item.data = { USB_HID_USAGE_PAGE_ID_CONSUMER, 0x00 },
.location = HID_REPORT_SET_LOC( 0, 2, 0, 0 )
};
/*
* Define configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t hidUsageByte0Bit5 = { .header = 0x09, .data = { 0xE2, 0x00 }, .location = 0x50 }; // Mute
static USB_HID_Short_Item_t hidUsageByte0Bit4 = { .header = 0x09, .data = { 0xEA, 0x00 }, .location = 0x40 }; // Vol-
static USB_HID_Short_Item_t hidUsageByte0Bit3 = { .header = 0x09, .data = { 0xE9, 0x00 }, .location = 0x30 }; // Vol+
static USB_HID_Short_Item_t hidUsageByte0Bit2 = { .header = 0x09, .data = { 0xB6, 0x00 }, .location = 0x20 }; // Scan Prev
static USB_HID_Short_Item_t hidUsageByte0Bit1 = { .header = 0x09, .data = { 0xB5, 0x00 }, .location = 0x10 }; // Scan Next
static USB_HID_Short_Item_t hidUsageByte0Bit0 = { .header = 0x09, .data = { 0xB0, 0x00 }, .location = 0x00 }; // Play
static USB_HID_Report_Element_t hidUsageByte0Bit5 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xE2, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 5)
}; // Mute
static USB_HID_Report_Element_t hidUsageByte0Bit4 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xEA, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 4)
}; // Vol-
static USB_HID_Report_Element_t hidUsageByte0Bit3 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xE9, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 3)
}; // Vol+
static USB_HID_Report_Element_t hidUsageByte0Bit2 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xB6, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 2)
}; // Scan Prev
static USB_HID_Report_Element_t hidUsageByte0Bit1 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xB5, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 1)
}; // Scan Next
static USB_HID_Report_Element_t hidUsageByte0Bit0 = {
.item.header = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.item.data = { 0xB0, 0x00 },
.location = HID_REPORT_SET_LOC(0, 0, 0, 0)
}; // Play
/*
* List the configurable items in the HID Report descriptor.
* List the configurable elements in the HID Report descriptor.
*/
static USB_HID_Short_Item_t* const hidConfigurableItems[] = {
static USB_HID_Report_Element_t* const hidConfigurableElements[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
@@ -73,27 +127,28 @@ static USB_HID_Short_Item_t* const hidConfigurableItems[] = {
};
/*
* List Usage pages in the HID Report descriptor, one per byte.
* List HID Reports, one per Report ID. This should be a usage page item with the relevant
* If not using report IDs - still have one with report ID 0
*/
static const USB_HID_Short_Item_t* const hidUsagePages[] = {
&hidUsagePageConsumer
static const USB_HID_Report_Element_t* const hidReports[] = {
&hidReportPageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&hidUsagePageConsumer,
&(hidReportPageConsumer.item),
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5,
&(hidUsageByte0Bit0.item),
&(hidUsageByte0Bit1.item),
&(hidUsageByte0Bit2.item),
&(hidUsageByte0Bit3.item),
&(hidUsageByte0Bit4.item),
&(hidUsageByte0Bit5.item),
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
@@ -104,9 +159,10 @@ static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
};
/*
* Define the length of the HID Report.
* This value must match the number of Report bytes defined by hidReportDescriptorItems.
* Define the number of HID Reports
* Due to XC not supporting designated initializers, this constant has a hard-coded value.
* It must equal ( sizeof hidReports / sizeof ( USB_HID_Report_Element_t* ))
*/
#define HID_REPORT_LENGTH ( 1 )
#define HID_REPORT_COUNT ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,7 +1,7 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_CONF_H_
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
#define NUM_USB_CHAN_OUT 0

109
examples/shared/apppll.h Normal file
View File

@@ -0,0 +1,109 @@
// Copyright 2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <stdint.h>
#include "xassert.h"
// App PLL setup
#define APP_PLL_CTL_BYPASS (0) // 0 = no bypass, 1 = bypass.
#define APP_PLL_CTL_INPUT_SEL (0) // 0 = XTAL, 1 = sysPLL
#define APP_PLL_CTL_ENABLE (1) // 0 = disabled, 1 = enabled.
// 24MHz in, 24.576MHz out, integer mode
// Found exact solution: IN 24000000.0, OUT 24576000.0, VCO 2457600000.0, RD 5, FD 512, OD 10, FOD 10
#define APP_PLL_CTL_OD_48 (4) // Output divider = (OD+1)
#define APP_PLL_CTL_F_48 (511) // FB divider = (F+1)/2
#define APP_PLL_CTL_R_48 (4) // Ref divider = (R+1)
#define APP_PLL_CTL_48 ((APP_PLL_CTL_BYPASS << 29) | (APP_PLL_CTL_INPUT_SEL << 28) | (APP_PLL_CTL_ENABLE << 27) |\
(APP_PLL_CTL_OD_48 << 23) | (APP_PLL_CTL_F_48 << 8) | APP_PLL_CTL_R_48)
// Fractional divide is M/N
#define APP_PLL_FRAC_EN_48 (0) // 0 = disabled
#define APP_PLL_FRAC_NPLUS1_CYCLES_48 (0) // M value is this reg value + 1.
#define APP_PLL_FRAC_TOTAL_CYCLES_48 (0) // N value is this reg value + 1.
#define APP_PLL_FRAC_48 ((APP_PLL_FRAC_EN_48 << 31) | (APP_PLL_FRAC_NPLUS1_CYCLES_48 << 8) | APP_PLL_FRAC_TOTAL_CYCLES_48)
// 24MHz in, 22.5792MHz out (44.1kHz * 512), frac mode
// Found exact solution: IN 24000000.0, OUT 22579200.0, VCO 2257920000.0, RD 5, FD 470.400 (m = 2, n = 5), OD 5, FOD 10
#define APP_PLL_CTL_OD_441 (4) // Output divider = (OD+1)
#define APP_PLL_CTL_F_441 (469) // FB divider = (F+1)/2
#define APP_PLL_CTL_R_441 (4) // Ref divider = (R+1)
#define APP_PLL_CTL_441 ((APP_PLL_CTL_BYPASS << 29) | (APP_PLL_CTL_INPUT_SEL << 28) | (APP_PLL_CTL_ENABLE << 27) |\
(APP_PLL_CTL_OD_441 << 23) | (APP_PLL_CTL_F_441 << 8) | APP_PLL_CTL_R_441)
#define APP_PLL_FRAC_EN_44 (1) // 1 = enabled
#define APP_PLL_FRAC_NPLUS1_CYCLES_44 (1) // M value is this reg value + 1.
#define APP_PLL_FRAC_TOTAL_CYCLES_44 (4) // N value is this reg value + 1.define APP_PLL_CTL_R_441 (4) // Ref divider = (R+1)
#define APP_PLL_FRAC_44 ((APP_PLL_FRAC_EN_44 << 31) | (APP_PLL_FRAC_NPLUS1_CYCLES_44 << 8) | APP_PLL_FRAC_TOTAL_CYCLES_44)
#define APP_PLL_DIV_INPUT_SEL (1) // 0 = sysPLL, 1 = app_PLL
#define APP_PLL_DIV_DISABLE (0) // 1 = disabled (pin connected to X1D11), 0 = enabled divider output to pin.
#define APP_PLL_DIV_VALUE (4) // Divide by N+1 - remember there's a /2 also afterwards for 50/50 duty cycle.
#define APP_PLL_DIV ((APP_PLL_DIV_INPUT_SEL << 31) | (APP_PLL_DIV_DISABLE << 16) | APP_PLL_DIV_VALUE)
/* TODO support more than two freqs..*/
void AppPllEnable(int32_t clkFreq_hz)
{
switch(clkFreq_hz)
{
case 44100*512:
// Disable the PLL
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, (APP_PLL_CTL_441 & 0xF7FFFFFF));
// Enable the PLL to invoke a reset on the appPLL.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_441);
// Must write the CTL register twice so that the F and R divider values are captured using a running clock.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_441);
// Now disable and re-enable the PLL so we get the full 5us reset time with the correct F and R values.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, (APP_PLL_CTL_441 & 0xF7FFFFFF));
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_441);
// Set the fractional divider if used
write_node_config_reg(tile[0], XS1_SSWITCH_SS_APP_PLL_FRAC_N_DIVIDER_NUM, APP_PLL_FRAC_44);
break;
case 48000*512:
// Disable the PLL
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, (APP_PLL_CTL_48 & 0xF7FFFFFF));
// Enable the PLL to invoke a reset on the appPLL.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_48);
// Must write the CTL register twice so that the F and R divider values are captured using a running clock.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_48);
// Now disable and re-enable the PLL so we get the full 5us reset time with the correct F and R values.
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, (APP_PLL_CTL_48 & 0xF7FFFFFF));
write_node_config_reg(tile[1], XS1_SSWITCH_SS_APP_PLL_CTL_NUM, APP_PLL_CTL_48);
// Set the fractional divider if used
write_node_config_reg(tile[0], XS1_SSWITCH_SS_APP_PLL_FRAC_N_DIVIDER_NUM, APP_PLL_FRAC_48);
break;
default:
assert(0);
break;
}
// Wait for PLL output frequency to stabilise due to fractional divider enable
delay_microseconds(100);
// Turn on the clock output
write_node_config_reg(tile[0], XS1_SSWITCH_SS_APP_CLK_DIVIDER_NUM, APP_PLL_DIV);
}
void AppPllEnable_SampleRate(int32_t sampleRate_hz)
{
assert(sampleRate_hz >= 22050);
if(sampleRate_hz % 22050 == 0)
{
AppPllEnable(44100*512);
}
else
{
AppPllEnable(48000*512);
}
}

View File

@@ -0,0 +1,10 @@
all:
@echo =======================================================
@echo Build complete [module only - cannot be run on its own]
@echo =======================================================
clean:
@echo =======================================================
@echo Build clean [module only - cannot be run on its own]
@echo =======================================================

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>host_usb_mixer_control</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>xmake</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
all:
g++ -g -o xmos_mixer usb_mixer.cpp mixer_app.cpp -I. -IOSX OSX/libusb-1.0.0.dylib -arch x86_64

View File

@@ -0,0 +1,5 @@
!if [set SDKPath=C:\Program^ Files\XMOS\tusbaudiosdk]
!endif
all:
msbuild host_usb_mixer_control.vcxproj /property:Configuration=Release /property:Platform=x64

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,117 @@
The XMOS USB Audio Reference Design, by default, contains an 18x8 mixer unit
(note that at sample rates above 96Khz only the first two outputs are
enabled).
----WINDOWS REQUIREMENTS----
Building the mixer on Windows requires the tusbaudio SDK from Thesycon. The
default location for the SDK is C:\Program Files\XMOS\tusbaudiosdk\
If it can be found on a different path then this can be changed in
Makefile.Win.
The mixer app on windows makes use of a USB dynamic library, also from Thesycon.
If required please contact thesycon.de for support.
----------------------------
This unit takes input takes 18 inputs: USB OUT channels 1..10 and
DEVICE IN channels 1..6,9..10 and produces 8 outputs: Mixer Output
1..8
Before the mixer there is an unit that allows the selection of the 18 mixer inputs
from all the possible device inputs (DAW and physical audio). This is
an extension unit with id 50 in the descriptors
After the mixer unit there is are channel map units for each output terminal:
Each of these outputs can select a source from one of 28 channels sources: USB OUT
channels 1..10, DEVICE IN channels 1..10 and Mixer Output 1..8
The channel map units are extension unit with init ids 51 and 52. This unit
lets you implement arbitrary routings including loopbacks.
The mixer is controlled on macOS via the command line utility
xmos_mixer. Running this application requires having the
libusb-1.0.0.dylib in the dynamic library load path. Sourcing the
setup.sh script will do this. Source code for the application is
provided as a guide on how to communicate with the device.
Here are the commands for the mixer application (note that the USB
audio reference design has only one unit so the mixer_id argument
should always be 0):
--help
--display-info
Show information about the device.
--display-mixer-nodes mixer_id
Display all the weights of all the mixer nodes (and their id) of a particular mixer.
--display-min mixer_id
Display the minimum allowable weights of a particular mixer.
--display-max mixer_id
Display the maximum allowable weights of a particular mixer.
--display-res mixer_id
Display the resolution of a particular mixer.
--set-value mixer_id mixer_unit value
Set the weight value in the mixer. The second argument should
correspond to the values shown by the --display-unit command. Values
can range from -127db to +128db with the special value -inf for mute.
--get-value mixer_id mixer_unit
Get the weight value in the mixer. The second argument should
correspond to the values shown by the --display-unit command. Values
can range from -127db to +128db with the special value -inf for mute.
--set-mixer-source mixer_id, dst_channel_id, src_channel_id
Allows the selection of the mixer inputs. Sets mixer input (dst) to src
--display-current-mixer-sources mixer_id
Displays the current inputs to a particular mixer
--display-available-mixer-sources mixer_id
Displays all the input channels available that can be fed into the inputs of a particular mixer
--set-aud-channel-map dst src
Sets a channel map value for the device audio output
--display-aud-channel-map
Show audio output channel map i.e. for each audio output of the device what the source is.
--display-aud-channel-map-sources
Show the available audio output channel map sources.
--set-daw-channel-map dst src
Sets a channel map value for the DAW output to the host
--display-daw-channel-map
Show audio output channel map i.e. for each DAW output to host, what the source is.
--display-daw-channel-map-sources
Show the DAW output channel map sources.
--get-mixer-levels-input
--get-mixer-levels-output
--vendor-audio-request-get bRequest, ControlSelector, ChannelNumber, UnitId
--vendor-audio-request-set bRequest, ControlSelector, ChannelNumber, UnitId, Data[0], Data[1],...

View File

@@ -0,0 +1,48 @@
// Copyright 2022-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
/************************************************************************
*
* Module: global.h
* Description:
* APP global includes, constants, declarations, etc.
*
* Author(s):
* Udo Eberhardt
*
* Companies:
* Thesycon GmbH, Germany http://www.thesycon.de
*
************************************************************************/
#ifndef __global_h__
#define __global_h__
// define the Windows versions supported by the application
#define _WIN32_WINNT 0x0500 //Windows 2000 or later
//#define _WIN32_WINNT 0x0501 //Windows XP or later
//#define _WIN32_WINNT 0x0600 //Windows Vista or later
//#define _WIN32_WINNT 0x0A00 //Windows 10 or later
// exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
// version defs
//#include "version.h"
// libwn.h pulls in windows.h
#include "libwn.h"
// TUSBAUDIO driver API
#include "tusbaudioapi.h"
#include "TUsbAudioApiDll.h"
#endif // __global_h__
/*************************** EOF **************************************/

View File

@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{84eacf4f-e405-4909-b440-a04a84a3f8c8}</ProjectGuid>
<RootNamespace>
</RootNamespace>
<SDKPath Condition="'$(SDKPath)' == ''">C:\Program Files\XMOS\tusbaudiosdk</SDKPath>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
<Import Project="$(SDKPath)\source\tusbaudioapi_inc\tusbaudioapi_inc_vs2019.vcxitems" Label="Shared" />
<Import Project="$(SDKPath)\source\libwn_min\_libwn_min_vs2019.vcxitems" Label="Shared" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>.\bin\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(Configuration)\$(PlatformName)_$(PlatformToolset)</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\bin\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(Configuration)\$(PlatformName)_$(PlatformToolset)</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_AMD64;_CONSOLE;_UNICODE;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.;.\Win;$(SDKPath)\source\shared;$(SDKPath)\source\inc;$(SDKPath)\source\libwn_min;$(SDKPath)\source\libwtl;$(SDKPath)\source\tusbaudioapi_inc</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeaderFile />
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<EnableUAC>false</EnableUAC>
<UACExecutionLevel />
<UACUIAccess />
<GenerateMapFile>true</GenerateMapFile>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>_AMD64;_CONSOLE;_UNICODE;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.;.\Win;$(SDKPath)\source\shared;$(SDKPath)\source\inc;$(SDKPath)\source\libwn_min;$(SDKPath)\source\libwtl;$(SDKPath)\source\tusbaudioapi_inc</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeaderFile />
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<EnableUAC>false</EnableUAC>
<UACExecutionLevel />
<UACUIAccess />
<GenerateMapFile>true</GenerateMapFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="usb_mixer.h" />
<ClInclude Include="Win\global.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="mixer_app.cpp" />
<ClCompile Include="usb_mixer.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="usb_mixer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Win\global.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="mixer_app.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Win\usb_mixer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@@ -0,0 +1,718 @@
// Copyright 2022-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "usb_mixer.h"
#define MIXER_UNIT_DISPLAY_VALUE 2
#define MIXER_UNIT_DISPLAY_MIN 3
#define MIXER_UNIT_DISPLAY_MAX 4
#define MIXER_UNIT_DISPLAY_RES 5
// TODO
// res, min, max
int mixer_init(void)
{
/* Open the connection to the USB mixer */
if (usb_mixer_connect() == USB_MIXER_FAILURE)
{
return USB_MIXER_FAILURE;
}
return USB_MIXER_SUCCESS;
}
int mixer_deinit(void) {
// Close the connection to the USB mixer
if (usb_mixer_disconnect() == USB_MIXER_FAILURE) {
return USB_MIXER_FAILURE;
}
return USB_MIXER_SUCCESS;
}
int mixer_display(unsigned int mixer_index, unsigned int type) {
int i = 0;
int j = 0;
int num_inputs = usb_mixer_get_num_inputs(mixer_index);
int num_outputs = usb_mixer_get_num_outputs(mixer_index);
printf("\n");
switch (type) {
case MIXER_UNIT_DISPLAY_VALUE:
//mixer_update_all_values(mixer_index);
printf(" Mixer Values (%d)\n", mixer_index);
printf(" ----------------\n\n");
break;
case MIXER_UNIT_DISPLAY_MIN:
printf(" Mixer Ranges Min (%d)\n", mixer_index);
printf(" --------------------\n\n");
break;
case MIXER_UNIT_DISPLAY_MAX:
printf(" Mixer Ranges Max (%d)\n", mixer_index);
printf(" --------------------\n\n");
break;
case MIXER_UNIT_DISPLAY_RES:
printf(" Mixer Ranges Res (%d)\n", mixer_index);
printf(" --------------------\n\n");
break;
default:
return USB_MIXER_FAILURE;
break;
}
printf(" \t\t\t");
printf("Mixer Outputs\n");
printf("\t\t ");
for (i = 0; i < num_outputs; i++) {
printf(" %d", i+1);
}
printf("\n");
for (i = 0; i < num_inputs; i++) {
printf(" %-20s", usb_mixer_get_input_name(mixer_index,i));
for (j = 0; j < num_outputs; j++) {
switch (type) {
case MIXER_UNIT_DISPLAY_VALUE:
{
double mixNodeVal = usb_mixer_get_value(mixer_index, (i*num_outputs)+j);
int nodeid = (i*num_outputs)+j;
if (mixNodeVal <= -127.996)// todo shoud be < min
{
printf("\t%3d:[ %s ]", nodeid,"-inf");
}
else
{
printf("\t%3d:[%08.03f]", nodeid, mixNodeVal);
}
}
break;
case MIXER_UNIT_DISPLAY_MIN:
{
int nodeid = (i*num_outputs)+j;
printf("\t%3d:[%08.03f]", nodeid, usb_mixer_get_min(mixer_index, (i*num_outputs)+j)) ;
}
break;
case MIXER_UNIT_DISPLAY_MAX:
{
int nodeid = (i*num_outputs)+j;
printf("\t%3d:[%08.03f]", nodeid, usb_mixer_get_max(mixer_index, (i*num_outputs)+j)) ;
}
break;
case MIXER_UNIT_DISPLAY_RES:
{
int nodeid = (i*num_outputs)+j;
printf("\t%3d:[%08.03f]", nodeid, usb_mixer_get_res(mixer_index, (i*num_outputs)+j)) ;
}
break;
default:
return USB_MIXER_FAILURE;
break;
}
}
printf("\n");
}
printf("\n");
return USB_MIXER_SUCCESS;
}
/* Displays basic mixer information */
int mixer_display_info(void)
{
unsigned int i = 0;
int num_mixers = usb_mixer_get_num_mixers();
printf("\n");
printf(" Mixer Info\n");
printf(" ----------\n\n");
printf(" Mixers : %d\n\n", num_mixers);
for (i = 0; i < num_mixers; i++)
{
int num_inputs = usb_mixer_get_num_inputs(i);
int num_outputs = usb_mixer_get_num_outputs(i);
printf(" Mixer %d\n", i);
printf(" -------\n");
printf(" Inputs : %d\n"
" Outputs : %d\n\n", num_inputs, num_outputs);
printf(" Mixer Output Labels:\n");
for(int j = 0; j < num_outputs; j++)
{
printf(" %d: %s\n", j,usb_mixer_get_output_name(i,j));
}
//printf("\n Selectable Inputs (%d): \n", usb_mixsel_get_input_count(i));
//for(int j = 0; j < usb_mixsel_get_input_count(i); j++)
//{
// printf(" %d: %s\n", j, usb_mixsel_get_input_string(i,j));
//}
}
printf("\n");
return USB_MIXER_SUCCESS;
}
void display_available_mixer_sources(int mixIndex)
{
printf("\n");
printf(" Available Mixer Sources (%d)\n", mixIndex);
printf(" -------------------------\n\n");
for(int j = 0; j < usb_mixsel_get_input_count(mixIndex); j++)
{
printf(" %d: %s\n", j, usb_mixsel_get_input_string(mixIndex,j));
}
}
/* Gets the current mixer inputs from the device an displays them */
void display_mixer_sources(int mixerIndex)
{
printf("\n");
printf(" Current Mixer Sources (%d)\n", mixerIndex);
printf(" -------------------------\n\n");
/* Note, mixSel output cound and mixer input chan count should be the same! */
printf(" Number of mixer sources: %d\n", usb_mixsel_get_output_count(mixerIndex));
/* Get the current channel number for every mixer input */
for(int i = 0; i < usb_mixsel_get_output_count(mixerIndex); i++)
{
int inputChan = (int)usb_mixsel_get_state(mixerIndex, i);
char *str = usb_mixer_get_input_name(mixerIndex,inputChan);
printf(" Mixer input %d: Source chan id: %d (%s)\n", i, inputChan, str);
}
}
/* set mixer source */
void set_mixer_source(unsigned mixerIndex, unsigned dst, unsigned src)
{
usb_mixsel_set_state(mixerIndex, dst, src);
/* String lookup */
char *str = usb_mixer_get_input_name(mixerIndex, dst);
int state = usb_mixsel_get_state(mixerIndex, dst);
printf("\n Set mixer(%d) input %d to device input %d (%s)\n", mixerIndex, dst, state, str);
}
void display_aud_channel_map()
{
printf("\n");
printf(" Audio Output Channel Map\n");
printf(" ------------------------\n\n");
for (int i=0;i<usb_get_aud_channel_map_num_outputs();i++)
{
int x = usb_get_aud_channel_map(i);
printf("%d (DEVICE OUT - %s) source is ",i, usb_get_aud_channel_map_name(i));
switch (usb_get_aud_channel_map_type(x))
{
case USB_CHAN_OUT:
printf(" %d (DAW OUT - %s)\n",x,usb_get_aud_channel_map_name(x));
break;
case USB_CHAN_IN:
printf("%d (DEVICE IN - %s)\n",x,usb_get_aud_channel_map_name(x));
break;
case USB_CHAN_MIXER:
printf("%d (%s)\n",x,usb_get_aud_channel_map_name(x));
break;
}
}
}
void display_daw_channel_map()
{
printf("\n");
printf(" DAW Output To Host Channel Map\n");
printf(" ------------------------\n\n");
for (int i=0;i<usb_get_usb_channel_map_num_outputs();i++)
{
int x = usb_get_usb_channel_map(i);
printf("%d (DAW IN - %s) source is ",i, usb_get_usb_channel_map_name(i + usb_get_aud_channel_map_num_outputs()));
switch (usb_get_usb_channel_map_type(x))
{
case USB_CHAN_OUT:
printf(" %d (DAW OUT - %s)\n",x,usb_get_usb_channel_map_name(x));
break;
case USB_CHAN_IN:
printf("%d (DEVICE IN - %s)\n",x,usb_get_usb_channel_map_name(x));
break;
case USB_CHAN_MIXER:
printf("%d (%s)\n",x,usb_get_usb_channel_map_name(x));
break;
}
}
}
void display_aud_channel_map_sources(void)
{
printf("\n");
printf(" Audio Output Channel Map Source List\n");
printf(" ------------------------------------\n\n");
for (int i=0;i<usb_get_aud_channel_map_num_inputs();i++) {
switch (usb_get_aud_channel_map_type(i))
{
case USB_CHAN_OUT:
printf("%d (DAW OUT - %s)\n",i,usb_get_aud_channel_map_name(i));
break;
case USB_CHAN_IN:
printf("%d (DEVICE IN - %s)\n",i,usb_get_aud_channel_map_name(i));
break;
case USB_CHAN_MIXER:
printf("%d (%s)\n",i,usb_get_aud_channel_map_name(i));
break;
}
}
}
void display_daw_channel_map_sources(void)
{
printf("\n");
printf(" DAW Output to Host Channel Map Source List\n");
printf(" ------------------------------------------\n\n");
for (int i=0;i<usb_get_usb_channel_map_num_inputs();i++) {
switch (usb_get_usb_channel_map_type(i))
{
case USB_CHAN_OUT:
printf("%d (DAW OUT - %s)\n",i,usb_get_usb_channel_map_name(i));
break;
case USB_CHAN_IN:
printf("%d (DEVICE IN - %s)\n",i,usb_get_usb_channel_map_name(i));
break;
case USB_CHAN_MIXER:
printf("%d (%s)\n",i,usb_get_usb_channel_map_name(i));
break;
}
}
}
int usb_audio_request_get(unsigned bRequest, unsigned cs, unsigned cn, unsigned unitId, unsigned char *data)
{
char reqStr[] = "Custom";
if(bRequest == CUR)
{
strcpy(reqStr, "CUR");
}
else if(bRequest == RANGE)
{
strcpy(reqStr, "RANGE");
}
else if(bRequest == MEM)
{
strcpy(reqStr, "MEM");
}
printf("Performing class GET request to Audio Interface:\n\
bRequest: 0x%02x (%s)\n\
wValue: 0x%04x (Control Sel: %d, Channel Number: %d)\n\
wIndex: 0x%04x (Interface: 0, Entity: %d)\n\
\n", bRequest, reqStr, (cs<<8)|cn, cs, cn, unitId<<8, unitId);
return usb_audio_class_get(bRequest, cs, cn, unitId, 64, data);
}
int usb_audio_request_set(unsigned bRequest, unsigned cs, unsigned cn, unsigned unitId,
unsigned char *data, int datalength)
{
char reqStr[] = "Custom";
if(bRequest == CUR)
{
strcpy(reqStr, "CUR");
}
else if(bRequest == RANGE)
{
strcpy(reqStr, "RANGE");
}
{
strcpy(reqStr, "MEM");
}
printf("Performing class SET request to Audio Interface:\n\
bRequest: 0x%02x (%s)\n\
wValue: 0x%04x (Control Sel: %d, Channel Number: %d)\n\
wIndex: 0x%04x (Interface: 0, Entity: %d)\n\
\n", bRequest, reqStr, (cs<<8)|cn, cs, cn, unitId<<8, unitId);
return usb_audio_class_set(bRequest, cs, cn, unitId, datalength, data);
}
int usb_audio_memreq_get(unsigned unitId, unsigned offset, unsigned char *data)
{
/* Mem requests dont have CS/CN, just an offset.. */
return usb_audio_request_get(MEM, (offset>>8), offset&0xff, unitId, data);
}
void print_levels(const char* levelTitle, unsigned char* levels, int levelBytes)
{
unsigned levelCount = levelBytes/2;
unsigned short* levelData = (unsigned short*) levels;
printf("\n %s Level Data\n"
" ----------------------\n\n"
"%d bytes (%d channels) returned:\n"
, levelTitle, levelBytes, levelCount);
for(int i = 0; i<levelCount; i++)
{
printf("%s %d: 0x%04x\n", levelTitle, i,levelData[i]);
}
}
void mixer_display_usage(void) {
fprintf(stderr, "Usage :\n");
fprintf(stderr,
" --display-info\n"
" --display-mixer-nodes mixer_id\n"
" --display-min mixer_id\n"
" --display-max mixer_id\n"
" --display-res mixer_id\n"
" --set-value mixer_id, mixer_node, value\n"
" --get-value mixer_id, mixer_node\n"
"\n"
" --set-mixer-source mixer_id dst channel_id, src_channel_id\n"
" --display-current-mixer-sources mixer_id\n"
" --display-available-mixer-sources mixer_id\n"
"\n"
" --set-aud-channel-map dst_channel_id, src_channel_id\n"
" --display-aud-channel-map \n"
" --display-aud-channel-map-sources\n"
" --set-daw-channel-map dst_channel_id, src_channel_id\n"
" --display-daw-channel-map \n"
" --display-daw-channel-map-sources\n"
"\n"
" --get-mixer-levels-input mixer_id\n"
" --get-mixer-levels-output mixer_id\n"
" --vendor-audio-request-get bRequest, ControlSelector, ChannelNumber, UnitId\n"
" --vendor-audio-request-set bRequest, ControlSelector, ChannelNumber, UnitId, Data[0], Data[1],...\n"
);
}
void usage_error()
{
fprintf(stderr, "ERROR :: incorrect number of arguments passed. See --help\n");
}
int main (int argc, char **argv) {
unsigned int mixer_index = 0;
unsigned int result = 0;
if (argc < 2) {
fprintf(stderr, "ERROR :: No options passed to mixer application\n");
mixer_display_usage();
return -1;
}
if (strcmp(argv[1], "--help") == 0) {
mixer_display_usage();
return 0;
}
if (mixer_init() != USB_MIXER_SUCCESS) {
fprintf(stderr, "ERROR :: Cannot connect\n");
return -1;
}
if (strcmp(argv[1], "--display-info") == 0)
{
mixer_display_info();
}
else if (strcmp(argv[1], "--display-mixer-nodes") == 0)
{
if (argv[2])
{
mixer_index = atoi(argv[2]);
} else {
fprintf(stderr, "ERROR :: No mixer index supplied\n");
return -1;
}
mixer_display(mixer_index, MIXER_UNIT_DISPLAY_VALUE);
} else if (strcmp(argv[1], "--display-mixer-nodes") == 0) {
if (argv[2]) {
mixer_index = atoi(argv[2]);
} else {
fprintf(stderr, "ERROR :: No mixer index supplied\n");
return -1;
}
mixer_display(mixer_index, MIXER_UNIT_DISPLAY_VALUE);
} else if (strcmp(argv[1], "--display-min") == 0) {
if (argv[2]) {
mixer_index = atoi(argv[2]);
} else {
fprintf(stderr, "ERROR :: No mixer index supplied\n");
return -1;
}
mixer_display(mixer_index, MIXER_UNIT_DISPLAY_MIN);
} else if (strcmp(argv[1], "--display-max") == 0) {
if (argv[2]) {
mixer_index = atoi(argv[2]);
} else {
fprintf(stderr, "ERROR :: No mixer index supplied\n");
return -1;
}
mixer_display(mixer_index, MIXER_UNIT_DISPLAY_MAX);
} else if (strcmp(argv[1], "--display-res") == 0) {
if (argv[2]) {
mixer_index = atoi(argv[2]);
} else {
fprintf(stderr, "ERROR :: No mixer index supplied\n");
return -1;
}
mixer_display(mixer_index, MIXER_UNIT_DISPLAY_RES);
}
else if (strcmp(argv[1], "--set-value") == 0) {
unsigned int mixer_unit = 0;
double value = 0;
if (argc < 5) {
fprintf(stderr, "ERROR :: incorrect number of arguments passed\n");
return -1;
}
mixer_index = atoi(argv[2]);
mixer_unit = atoi(argv[3]);
if (strcmp(argv[4],"-inf")==0)
value = -128;
else
value = atof(argv[4]);
usb_mixer_set_value(mixer_index, mixer_unit, value);
} else if (strcmp(argv[1], "--get-value") == 0) {
unsigned int mixer_unit = 0;
double result = 0;
if (argc < 4) {
fprintf(stderr, "ERROR :: incorrect number of arguments passed\n");
return -1;
}
mixer_index = atoi(argv[2]);
mixer_unit = atoi(argv[3]);
result = usb_mixer_get_value(mixer_index, mixer_unit);
if (result <= -127.996)
printf("%s\n", "-inf");
else
printf("%g\n",result);
}
else if (strcmp(argv[1], "--display-current-mixer-sources") == 0)
{
if(argc < 3)
{
usage_error();
return -1;
}
display_mixer_sources(atoi(argv[2]));
}
else if (strcmp(argv[1], "--display-available-mixer-sources") == 0)
{
if(argc < 3)
{
usage_error();
return -1;
}
display_available_mixer_sources(atoi(argv[2]));
}
else if(strcmp(argv[1], "--set-mixer-source") == 0)
{
if(argc < 5)
{
usage_error();
return -1;
}
set_mixer_source(atoi(argv[2]), atoi(argv[3]), atoi(argv[4]));
}
else if (strcmp(argv[1], "--display-aud-channel-map") == 0)
{
/* Display the channel mapping to the devices audio outputs */
display_aud_channel_map();
}
else if (strcmp(argv[1], "--display-aud-channel-map-sources") == 0)
{
display_aud_channel_map_sources();
}
else if (strcmp(argv[1], "--display-daw-channel-map") == 0)
{
/* Display the channel mapping to the devices DAW output to host */
display_daw_channel_map();
}
else if (strcmp(argv[1], "--display-daw-channel-map-sources") == 0)
{
display_daw_channel_map_sources();
}
else if (strcmp(argv[1], "--set-aud-channel-map") == 0)
{
unsigned int dst = 0;
unsigned int src = 0;
if (argc != 4)
{
usage_error();
return -1;
}
dst = atoi(argv[2]);
src = atoi(argv[3]);
usb_set_aud_channel_map(dst, src);
}
else if (strcmp(argv[1], "--set-daw-channel-map") == 0)
{
unsigned int dst = 0;
unsigned int src = 0;
if (argc != 4)
{
usage_error();
return -1;
}
dst = atoi(argv[2]);
src = atoi(argv[3]);
usb_set_usb_channel_map(dst, src);
}
else if(strcmp(argv[1], "--get-mixer-levels-input") == 0 ||
strcmp(argv[1],"--get-mixer-levels-output") == 0)
{
unsigned int dst = 0;
unsigned char levels[64];
int datalength = 0;
int offset = 0;
if (argc < 3) {
fprintf(stderr, "ERROR :: incorrect number of arguments passed\n");
return -1;
}
if(strcmp(argv[1],"--get-mixer-levels-output") == 0)
offset = 1;
for(int i = 0; i < 64; i++)
levels[i] = 0;
dst = atoi(argv[2]);
/* Mem request to mixer with offset of 0 gives input levels */
datalength = usb_mixer_mem_get(dst, offset, levels);
if(datalength < 0)
{
fprintf(stderr, "ERROR in control request: %d\n", datalength);
return -1;
}
if(offset)
print_levels("Mixer Output", levels, datalength);
else
print_levels("Mixer Input", levels, datalength);
}
else if(strcmp(argv[1], "--vendor-audio-request-get") == 0)
{
unsigned int bRequest = 0;
unsigned int cs = 0;
unsigned int cn = 0;
unsigned int unitId = 0;
int datalength = 0;
unsigned char data[64];
if(argc < 6)
{
fprintf(stderr, "ERROR :: incorrect number of arguments passed\n");
return -1;
}
for(int i = 0; i < 64; i++)
data[i] = 0;
bRequest = atoi(argv[2]);
cs = atoi(argv[3]);
cn = atoi(argv[4]);
unitId = atoi(argv[5]);
/* Do request */
datalength = usb_audio_request_get(bRequest, cs, cn, unitId, data);
/* Print result */
if(datalength < 0)
{
fprintf(stderr, "ERROR in control request: %d\n", datalength);
}
else
{
printf("Response (%d bytes):\n", datalength);
for(int i = 0; i < datalength; i++)
printf("0x%02x\n" ,data[i]);
}
}
else if(strcmp(argv[1], "--vendor-audio-request-set") == 0)
{
unsigned int bRequest = 0;
unsigned int cs = 0;
unsigned int cn = 0;
unsigned int unitId = 0;
unsigned char data[64];
for(int i=0; i<64; i++)
{
data[i] = 0;
}
if(argc < 7)
{
fprintf(stderr, "ERROR :: incorrect number of arguments passed - no data passed\n");
return -1;
}
bRequest = atoi(argv[2]);
cs = atoi(argv[3]);
cn = atoi(argv[4]);
unitId = atoi(argv[5]);
/* Get data */
for(int i=0; i < argc-6; i++)
{
data[i] = atoi(argv[i+6]);
}
result = usb_audio_request_set(bRequest, cs, cn, unitId, data, argc-6);
if(result < 0)
{
fprintf(stderr, "ERROR :: Error detected in Set request: %d\n", result);
return -1;
}
}
else
{
fprintf(stderr, "ERROR :: Invalid option passed to mixer application\n");
return -1;
}
mixer_deinit();
return result;
}

View File

@@ -0,0 +1 @@
export DYLD_LIBRARY_PATH=$PWD/OSX:$DYLD_LIBRARY_PATH

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,108 @@
// Copyright 2022-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#define USB_MIXER_SUCCESS 0
#define USB_MIXER_FAILURE -1
#define USB_MIXERS 1
#define USB_MIXER_INPUTS 18
#define USB_MIXER_OUTPUTS 8
#define USB_MAX_CHANNEL_MAP_SIZE 40
#define USB_MIXER_MAX_NAME_LEN 64
enum usb_chan_type {
USB_CHAN_OUT=0,
USB_CHAN_IN=1,
USB_CHAN_MIXER=2
};
/* A.14 Audio Class-Specific Request Codes */
#define REQUEST_CODE_UNDEFINED 0x00
#define CUR (1)
#define RANGE (2)
#define MEM (3)
int usb_mixer_connect();
int usb_mixer_disconnect();
/* MIXER UNIT(s) INTERFACE */
/* Returns total number of mixers in device */
int usb_mixer_get_num_mixers();
/* Returns number of inputs and outputs for a selected mixer */
int usb_mixer_get_layout(unsigned int mixer, unsigned int *inputs, unsigned int *outputs);
/* Returns the name for a selected mixer input */
char *usb_mixer_get_input_name(unsigned int mixer, unsigned int input);
/* Returns the name for a selected mixer output */
char *usb_mixer_get_output_name(unsigned int mixer, unsigned int output);
/* Returns the current value of a selected mixer unit */
double usb_mixer_get_value(unsigned int mixer, unsigned int mixer_unit);
/* Sets the current value for a selected mixer unit */
int usb_mixer_set_value(unsigned int mixer, unsigned int mixer_unit, double val);
/* Returns the range values for a selected mixer unit */
int usb_mixer_get_range(unsigned int mixer, unsigned int mixer_unit, double *min, double *max, double *res);
/* Returns the number of bytes read from a mem request, data is stored in data */
int usb_mixer_mem_get(unsigned int mixer, unsigned offset, unsigned char *data);
/* INPUT / OUTPUT / MIXER MAPPING UNIT INTERFACE */
/* Get the number of selectable inputs */
int usb_mixsel_get_input_count(unsigned int mixer);
/* Get the string of a input */
char *usb_mixsel_get_input_string(unsigned int mixer, unsigned int channel);
int usb_mixsel_get_output_count(unsigned int mixer);
int usb_mixer_get_num_outputs(unsigned int mixer);
int usb_mixer_get_num_inputs(unsigned int mixer);
unsigned char usb_mixsel_get_state(unsigned int mixer, unsigned int channel);
void usb_mixsel_set_state(unsigned int mixer, unsigned int dst, unsigned int src);
int usb_set_usb_channel_map(int channel, int val);
/* Get the current map for a specified input / output / mixer channel */
int usb_get_usb_channel_map(int channel);
int usb_get_aud_channel_map(int channel);
/* Maps an input / output / mixer channel to another input / output / mixer channel */
int usb_set_aud_channel_map(int channel, int val);
int usb_set_usb_channel_map(int channel, int val);
/* Gets the name of a specified channel */
char *usb_get_aud_channel_map_name(int channel);
char *usb_get_usb_channel_map_name(int channel);
/* Get the type of a channel map */
enum usb_chan_type usb_get_aud_channel_map_type(int channel);
enum usb_chan_type usb_get_usb_channel_map_type(int channel);
int usb_get_aud_channel_map_num_outputs();
int usb_get_usb_channel_map_num_outputs();
int usb_get_aud_channel_map_num_inputs();
int usb_get_usb_channel_map_num_inputs();
/* CUSTOM/GENERIC AUDIO CLASS REQUESTS */
int usb_audio_class_get(unsigned char bRequest, unsigned char cs, unsigned char cn, unsigned short unitID, unsigned short wLength, unsigned char *data);
int usb_audio_class_set(unsigned char bRequest, unsigned char cs, unsigned char cn, unsigned short unitID, unsigned short wLength, unsigned char *data);
double usb_mixer_get_res(unsigned int mixer, unsigned int nodeId);
double usb_mixer_get_min(unsigned int mixer, unsigned int nodeId) ;
double usb_mixer_get_max(unsigned int mixer, unsigned int nodeId) ;

View File

@@ -1,99 +0,0 @@
# Copyright (c) 2016, XMOS Ltd, All rights reserved
TARGET = xk-audio-216-mc.xn
USED_MODULES = lib_xua \
module_i2c_shared module_i2c_single_port lib_logging
BUILD_FLAGS = -O0 -g -lflash -DXUD_SERIES_SUPPORT=4 -DXUD_CORE_CLOCK=600 -fxscope -save-temps -march=xs2a -DUSB_TILE=tile[1]
BUILD_FLAGS_i2s_master_2in_2out_48khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=2 -D NUM_USB_CHAN_OUT=2 -DI2S_CHANS_ADC=2 -DI2S_CHANS_DAC=2 \
-D DEFAULT_FREQ=48000
BUILD_FLAGS_i2s_slave_2in_2out_48khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=2 -D NUM_USB_CHAN_OUT=2 -DI2S_CHANS_ADC=2 -DI2S_CHANS_DAC=2 \
-D DEFAULT_FREQ=48000 -DCODEC_MASTER=1
BUILD_FLAGS_i2s_master_2in_2out_192khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=2 -D NUM_USB_CHAN_OUT=2 -D I2S_CHANS_ADC=2 -D I2S_CHANS_DAC=2 \
-D DEFAULT_FREQ=192000
BUILD_FLAGS_i2s_slave_2in_2out_192khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=2 -D NUM_USB_CHAN_OUT=2 -DI2S_CHANS_ADC=2 -DI2S_CHANS_DAC=2 \
-D DEFAULT_FREQ=192000 -DCODEC_MASTER=1
BUILD_FLAGS_i2s_master_8in_8out_48khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=48000
BUILD_FLAGS_i2s_slave_8in_8out_48khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=48000 -DCODEC_MASTER=1
BUILD_FLAGS_i2s_master_8in_8out_192khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=192000 \
-O2 # optimisations to meet timing
BUILD_FLAGS_i2s_slave_8in_8out_192khz = $(BUILD_FLAGS) \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=192000 -DCODEC_MASTER=1 \
-O2 # optimisations to meet timing
BUILD_FLAGS_tdm_master_8in_8out_48khz = $(BUILD_FLAGS) -D I2S_MODE_TDM=1 \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=48000 \
-O2 # optimisations to meet timing
BUILD_FLAGS_tdm_slave_8in_8out_48khz = $(BUILD_FLAGS) -D I2S_MODE_TDM=1 \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=8 -D NUM_USB_CHAN_OUT=8 -D I2S_CHANS_ADC=8 -D I2S_CHANS_DAC=8 \
-D DEFAULT_FREQ=48000 -DCODEC_MASTER=1 \
-O2 # optimisations to meet timing
BUILD_FLAGS_tdm_master_16in_16out_48khz = $(BUILD_FLAGS) -D I2S_MODE_TDM=1 \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=16 -D NUM_USB_CHAN_OUT=16 -D I2S_CHANS_ADC=16 -D I2S_CHANS_DAC=16 \
-D DEFAULT_FREQ=48000 \
-O2 # optimisations to meet timing
BUILD_FLAGS_tdm_slave_16in_16out_48khz = $(BUILD_FLAGS) -D I2S_MODE_TDM=1 \
-D ADAT_RX=0 -D ADAT_TX=0 -D SPDIF_RX=0 -D SPDIF_TX=0 -D MIDI=0 \
-D NUM_USB_CHAN_IN=16 -D NUM_USB_CHAN_OUT=16 -D I2S_CHANS_ADC=16 -D I2S_CHANS_DAC=16 \
-D DEFAULT_FREQ=48000 -DCODEC_MASTER=1 \
-O2 # optimisations to meet timing
#XCC_FLAGS_hardware_i2s_master_2in_2out_48khz = -D HARDWARE $(BUILD_FLAGS_i2s_master_2in_2out_48khz)
#XCC_FLAGS_hardware_i2s_master_2in_2out_192khz = -D HARDWARE $(BUILD_FLAGS_i2s_master_2in_2out_192khz)
#XCC_FLAGS_hardware_i2s_master_8in_8out_48khz = -D HARDWARE $(BUILD_FLAGS_i2s_master_8in_8out_48khz)
#XCC_FLAGS_hardware_i2s_master_8in_8out_192khz = -D HARDWARE $(BUILD_FLAGS_i2s_master_8in_8out_192khz)
#XCC_FLAGS_hardware_tdm_master_8in_8out_48khz = -D HARDWARE $(BUILD_FLAGS_tdm_master_8in_8out_48khz)
XCC_FLAGS_simulation_i2s_master_2in_2out_48khz = -D SIMULATION $(BUILD_FLAGS_i2s_master_2in_2out_48khz)
XCC_FLAGS_simulation_i2s_slave_2in_2out_48khz = -D SIMULATION $(BUILD_FLAGS_i2s_slave_2in_2out_48khz)
XCC_FLAGS_simulation_i2s_master_2in_2out_192khz = -D SIMULATION $(BUILD_FLAGS_i2s_master_2in_2out_192khz)
XCC_FLAGS_simulation_i2s_slave_2in_2out_192khz = -D SIMULATION $(BUILD_FLAGS_i2s_slave_2in_2out_192khz)
XCC_FLAGS_simulation_i2s_master_8in_8out_48khz = -D SIMULATION $(BUILD_FLAGS_i2s_master_8in_8out_48khz)
XCC_FLAGS_simulation_i2s_slave_8in_8out_48khz = -D SIMULATION $(BUILD_FLAGS_i2s_slave_8in_8out_48khz)
XCC_FLAGS_simulation_i2s_master_8in_8out_192khz = -D SIMULATION $(BUILD_FLAGS_i2s_master_8in_8out_192khz)
XCC_FLAGS_simulation_i2s_slave_8in_8out_192khz = -D SIMULATION $(BUILD_FLAGS_i2s_slave_8in_8out_192khz)
XCC_FLAGS_simulation_tdm_master_8in_8out_48khz = -D SIMULATION $(BUILD_FLAGS_tdm_master_8in_8out_48khz)
XCC_FLAGS_simulation_tdm_slave_8in_8out_48khz = -D SIMULATION $(BUILD_FLAGS_tdm_slave_8in_8out_48khz)
XCC_FLAGS_simulation_tdm_master_16in_16out_48khz = -D SIMULATION $(BUILD_FLAGS_tdm_master_16in_16out_48khz)
XCC_FLAGS_simulation_tdm_slave_16in_16out_48khz = -D SIMULATION $(BUILD_FLAGS_tdm_slave_16in_16out_48khz)
XMOS_MAKE_PATH ?= ../..
-include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -1,112 +0,0 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __hid_report_descriptor_h__
#define __hid_report_descriptor_h__
#include "xua_hid_report_descriptor.h"
#if 0
/* Existing static report descriptor kept for reference */
unsigned char hidReportDescriptor[] =
{
0x05, 0x0c, /* Usage Page (Consumer Device) */
0x09, 0x01, /* Usage (Consumer Control) */
0xa1, 0x01, /* Collection (Application) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x09, 0xb0, /* Usage (Play) */
0x09, 0xb5, /* Usage (Scan Next Track) */
0x09, 0xb6, /* Usage (Scan Previous Track) */
0x09, 0xe9, /* Usage (Volume Up) */
0x09, 0xea, /* Usage (Volume Down) */
0x09, 0xe2, /* Usage (Mute) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x06, /* Report Count (6) */
0x81, 0x02, /* Input (Data, Var, Abs) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x01, /* Input (Cnst, Ary, Abs) */
0xc0 /* End collection */
};
#endif
/*
* Define non-configurable items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t hidCollectionApplication = { .header = 0xA1, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidCollectionEnd = { .header = 0xC0, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputConstArray = { .header = 0x81, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidInputDataVar = { .header = 0x81, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum0 = { .header = 0x25, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMaximum1 = { .header = 0x25, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidLogicalMinimum0 = { .header = 0x15, .data = { 0x00, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount2 = { .header = 0x95, .data = { 0x02, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportCount6 = { .header = 0x95, .data = { 0x06, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidReportSize1 = { .header = 0x75, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsageConsumerControl = { .header = 0x09, .data = { 0x01, 0x00 }, .location = 0x00 };
static const USB_HID_Short_Item_t hidUsagePageConsumer = { .header = 0x05, .data = { 0x0C, 0x00 }, .location = 0x00 };
/*
* Define configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t hidUsageByte0Bit5 = { .header = 0x09, .data = { 0xE2, 0x00 }, .location = 0x50 }; // Mute
static USB_HID_Short_Item_t hidUsageByte0Bit4 = { .header = 0x09, .data = { 0xEA, 0x00 }, .location = 0x40 }; // Vol-
static USB_HID_Short_Item_t hidUsageByte0Bit3 = { .header = 0x09, .data = { 0xE9, 0x00 }, .location = 0x30 }; // Vol+
static USB_HID_Short_Item_t hidUsageByte0Bit2 = { .header = 0x09, .data = { 0xB6, 0x00 }, .location = 0x20 }; // Scan Prev
static USB_HID_Short_Item_t hidUsageByte0Bit1 = { .header = 0x09, .data = { 0xB5, 0x00 }, .location = 0x10 }; // Scan Next
static USB_HID_Short_Item_t hidUsageByte0Bit0 = { .header = 0x09, .data = { 0xB0, 0x00 }, .location = 0x00 }; // Play
/*
* List the configurable items in the HID Report descriptor.
*/
static USB_HID_Short_Item_t* const hidConfigurableItems[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* List Usage pages in the HID Report descriptor, one per byte.
*/
static const USB_HID_Short_Item_t* const hidUsagePages[] = {
&hidUsagePageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&hidUsagePageConsumer,
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5,
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* Define the length of the HID Report.
* This value must match the number of Report bytes defined by hidReportDescriptorItems.
*/
#define HID_REPORT_LENGTH ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,33 +0,0 @@
// Copyright 2017-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef CS4384_H_
#define CS4384_H_
//Address on I2C bus
#define CS4384_I2C_ADDR (0x18)
//Register Addresess
#define CS4384_CHIP_REV 0x01
#define CS4384_MODE_CTRL 0x02
#define CS4384_PCM_CTRL 0x03
#define CS4384_DSD_CTRL 0x04
#define CS4384_FLT_CTRL 0x05
#define CS4384_INV_CTRL 0x06
#define CS4384_GRP_CTRL 0x07
#define CS4384_RMP_MUTE 0x08
#define CS4384_MUTE_CTRL 0x09
#define CS4384_MIX_PR1 0x0a
#define CS4384_VOL_A1 0x0b
#define CS4384_VOL_B1 0x0c
#define CS4384_MIX_PR2 0x0d
#define CS4384_VOL_A2 0x0e
#define CS4384_VOL_B2 0x0f
#define CS4384_MIX_PR3 0x10
#define CS4384_VOL_A3 0x11
#define CS4384_VOL_B3 0x12
#define CS4384_MIX_PR4 0x13
#define CS4384_VOL_A4 0x14
#define CS4384_VOL_B4 0x15
#define CS4384_CM_MODE 0x16
#endif /* CS4384_H_ */

View File

@@ -1,19 +0,0 @@
// Copyright 2017-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _CS5368_H_
#define _CS5368_H_
//Address on I2C bus
#define CS5368_I2C_ADDR (0x4C)
//Register Addresess
#define CS5368_CHIP_REV 0x00
#define CS5368_GCTL_MDE 0x01
#define CS5368_OVFL_ST 0x02
#define CS5368_OVFL_MSK 0x03
#define CS5368_HPF_CTRL 0x04
#define CS5368_PWR_DN 0x06
#define CS5368_MUTE_CTRL 0x08
#define CS5368_SDO_EN 0x0a
#endif /* _CS5368_H_ */

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env python2.7
# Copyright 2018-2021 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
import xmostest
import os.path
if __name__ == "__main__":
xmostest.init()
xmostest.register_group("lib_xua",
"i2s_loopback_sim_tests",
"I2S loopback simulator tests",
"""
Tests are performed by running the audiohub code connected to a
loopback plugin
""")
xmostest.runtests()
xmostest.finish()

View File

@@ -1,51 +0,0 @@
#!/usr/bin/env python
# Copyright 2018-2021 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
import xmostest
def runtest_one_config(env, format, i2s_role, num_chans_in, num_chans_out, sample_rate):
testlevel = 'smoke'
resources = xmostest.request_resource('xsim')
binary = 'app_test_i2s_loopback/bin/{env}_{format}_{i2s_role}_{num_chans_in}in_{num_chans_out}out_{sample_rate}/app_test_i2s_loopback_{env}_{format}_{i2s_role}_{num_chans_in}in_{num_chans_out}out_{sample_rate}.xe'.format(env=env, format=format, i2s_role=i2s_role, num_chans_in=num_chans_in, num_chans_out=num_chans_out, sample_rate=sample_rate)
tester = xmostest.ComparisonTester(open('pass.expect'),
'lib_xua',
'i2s_loopback_sim_tests',
'i2s_loopback',
{'env':env,
'format':format,
'i2s_role':i2s_role,
'num_chans_in':num_chans_in,
'num_chans_out':num_chans_out,
'sample_rate':sample_rate})
tester.set_min_testlevel(testlevel)
loopback_args= '-port tile[0] XS1_PORT_1M 1 0 -port tile[0] XS1_PORT_1I 1 0 ' + \
'-port tile[0] XS1_PORT_1N 1 0 -port tile[0] XS1_PORT_1J 1 0 ' + \
'-port tile[0] XS1_PORT_1O 1 0 -port tile[0] XS1_PORT_1K 1 0 ' + \
'-port tile[0] XS1_PORT_1P 1 0 -port tile[0] XS1_PORT_1L 1 0 ' + \
'-port tile[0] XS1_PORT_1A 1 0 -port tile[0] XS1_PORT_1F 1 0 '
if i2s_role == 'slave':
loopback_args += '-port tile[0] XS1_PORT_1B 1 0 -port tile[0] XS1_PORT_1H 1 0 ' #bclk
loopback_args += '-port tile[0] XS1_PORT_1C 1 0 -port tile[0] XS1_PORT_1G 1 0 ' #lrclk
max_cycles = 1500000 #enough to reach the 10 skip + 100 test in sim at 48kHz
xmostest.run_on_simulator(resources['xsim'], binary, tester=tester, simargs=['--max-cycles', str(max_cycles), '--plugin', 'LoopbackPort.dll', loopback_args])
def runtest():
runtest_one_config('simulation', 'i2s', 'master', 2, 2, '48khz')
runtest_one_config('simulation', 'i2s', 'slave', 2, 2, '48khz')
runtest_one_config('simulation', 'i2s', 'master', 2, 2, '192khz')
runtest_one_config('simulation', 'i2s', 'slave', 2, 2, '192khz')
runtest_one_config('simulation', 'i2s', 'master', 8, 8, '48khz')
runtest_one_config('simulation', 'i2s', 'slave', 8, 8, '48khz')
runtest_one_config('simulation', 'i2s', 'master', 8, 8, '192khz')
runtest_one_config('simulation', 'i2s', 'slave', 8, 8, '192khz')
runtest_one_config('simulation', 'tdm', 'master', 8, 8, '48khz')
runtest_one_config('simulation', 'tdm', 'slave', 8, 8, '48khz')
runtest_one_config('simulation', 'tdm', 'master', 16, 16, '48khz')
runtest_one_config('simulation', 'tdm', 'slave', 16, 16, '48khz')

View File

@@ -1,860 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.xmos.cdt.toolchain.1285928753">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.toolchain.1285928753" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="com.xmos.cdt.core.XdeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.xmos.cdt.core.XEBinaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="com.xmos.cdt.toolchain.1285928753" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.xmos.cdt.toolchain.1285928753.790908561" name="/" resourcePath="">
<toolChain id="com.xmos.cdt.toolchain.1969897956" name="com.xmos.cdt.toolchain" superClass="com.xmos.cdt.toolchain">
<targetPlatform archList="all" binaryParser="com.xmos.cdt.core.XEBinaryParser;org.eclipse.cdt.core.GNU_ELF" id="com.xmos.cdt.core.platform.1615568037" isAbstract="false" osList="linux,win32,macosx" superClass="com.xmos.cdt.core.platform"/>
<builder arguments="-f .makefile" id="com.xmos.cdt.builder.base.45159417" keepEnvironmentInBuildfile="false" managedBuildOn="false" superClass="com.xmos.cdt.builder.base">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="outputPath" name="bin"/>
</outputEntries>
</builder>
<tool id="com.xmos.cdt.xc.compiler.404499215" name="com.xmos.cdt.xc.compiler" superClass="com.xmos.cdt.xc.compiler">
<option id="com.xmos.xc.compiler.option.defined.symbols.1492092903" name="com.xmos.xc.compiler.option.defined.symbols" superClass="com.xmos.xc.compiler.option.defined.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__XC__=1"/>
<listOptionValue builtIn="false" value="__llvm__=1"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELAXED=0"/>
<listOptionValue builtIn="false" value="__ATOMIC_CONSUME=1"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQUIRE=2"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELEASE=3"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQ_REL=4"/>
<listOptionValue builtIn="false" value="__ATOMIC_SEQ_CST=5"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.1"/>
<listOptionValue builtIn="false" value="__CONSTANT_CFSTRINGS__=1"/>
<listOptionValue builtIn="false" value="__ORDER_LITTLE_ENDIAN__=1234"/>
<listOptionValue builtIn="false" value="__ORDER_BIG_ENDIAN__=4321"/>
<listOptionValue builtIn="false" value="__ORDER_PDP_ENDIAN__=3412"/>
<listOptionValue builtIn="false" value="__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__"/>
<listOptionValue builtIn="false" value="__LITTLE_ENDIAN__=1"/>
<listOptionValue builtIn="false" value="_ILP32=1"/>
<listOptionValue builtIn="false" value="__ILP32__=1"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=255"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__=2"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__=1"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__=4"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_C_SUFFIX__=ULL"/>
<listOptionValue builtIn="false" value="__INTMAX_WIDTH__=64"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__SIZE_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WCHAR_WIDTH__=8"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WINT_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__=1.40129846e-45F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__FLT_DIG__=6"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__=1.19209290e-7F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__=24"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__=38"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__=128"/>
<listOptionValue builtIn="false" value="__FLT_MAX__=3.40282347e+38F"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__=(-37)"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__=(-125)"/>
<listOptionValue builtIn="false" value="__FLT_MIN__=1.17549435e-38F"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__=4.9406564584124654e-324"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__DBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__=2.2204460492503131e-16"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__DBL_MAX__=1.7976931348623157e+308"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__DBL_MIN__=2.2250738585072014e-308"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__=4.9406564584124654e-324L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__=2.2204460492503131e-16L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__=1.7976931348623157e+308L"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__=2.2250738585072014e-308L"/>
<listOptionValue builtIn="false" value="__POINTER_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WCHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WINT_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__INT8_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__INT16_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INT32_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INT64_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__=_"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__=2"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__=17"/>
<listOptionValue builtIn="false" value="__xcore__=1"/>
<listOptionValue builtIn="false" value="__XS1B__=1"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__STDC_UTF_16__=1"/>
<listOptionValue builtIn="false" value="__STDC_UTF_32__=1"/>
<listOptionValue builtIn="false" value="XCC_VERSION_YEAR=14"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MONTH=3"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MAJOR=1403"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MINOR=2"/>
<listOptionValue builtIn="false" value="__XCC_HAVE_FLOAT__=1"/>
<listOptionValue builtIn="false" value="_XSCOPE_PROBES_INCLUDE_FILE=&quot;/var/folders/0l/8jd0xy095ps890m302j532580000h5/T//cc8JvR3b.h&quot;"/>
</option>
<option id="com.xmos.xc.compiler.option.include.paths.834699451" name="com.xmos.xc.compiler.option.include.paths" superClass="com.xmos.xc.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/xc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/clang&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst/images}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/client}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/class}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core/included}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/control}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user}&quot;"/>
</option>
<inputType id="com.xmos.cdt.xc.compiler.input.2062798368" name="XC" superClass="com.xmos.cdt.xc.compiler.input"/>
</tool>
<tool id="com.xmos.cdt.c.compiler.1931691289" name="com.xmos.cdt.c.compiler" superClass="com.xmos.cdt.c.compiler">
<option id="com.xmos.c.compiler.option.defined.symbols.534062814" name="com.xmos.c.compiler.option.defined.symbols" superClass="com.xmos.c.compiler.option.defined.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__llvm__=1"/>
<listOptionValue builtIn="false" value="__clang__=1"/>
<listOptionValue builtIn="false" value="__clang_major__=3"/>
<listOptionValue builtIn="false" value="__clang_minor__=6"/>
<listOptionValue builtIn="false" value="__clang_patchlevel__=0"/>
<listOptionValue builtIn="false" value="__clang_version__=&quot;3.6.0"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__=2"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__=1"/>
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION=1002"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELAXED=0"/>
<listOptionValue builtIn="false" value="__ATOMIC_CONSUME=1"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQUIRE=2"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELEASE=3"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQ_REL=4"/>
<listOptionValue builtIn="false" value="__ATOMIC_SEQ_CST=5"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.1"/>
<listOptionValue builtIn="false" value="__CONSTANT_CFSTRINGS__=1"/>
<listOptionValue builtIn="false" value="__GXX_RTTI=1"/>
<listOptionValue builtIn="false" value="__ORDER_LITTLE_ENDIAN__=1234"/>
<listOptionValue builtIn="false" value="__ORDER_BIG_ENDIAN__=4321"/>
<listOptionValue builtIn="false" value="__ORDER_PDP_ENDIAN__=3412"/>
<listOptionValue builtIn="false" value="__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__"/>
<listOptionValue builtIn="false" value="__LITTLE_ENDIAN__=1"/>
<listOptionValue builtIn="false" value="_ILP32=1"/>
<listOptionValue builtIn="false" value="__ILP32__=1"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=255"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__=2"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__=1"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__=4"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_C_SUFFIX__=ULL"/>
<listOptionValue builtIn="false" value="__INTMAX_WIDTH__=64"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__SIZE_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WCHAR_WIDTH__=8"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WINT_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINTMAX_WIDTH__=64"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__=1.40129846e-45F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__FLT_DIG__=6"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__=1.19209290e-7F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__=24"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__=38"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__=128"/>
<listOptionValue builtIn="false" value="__FLT_MAX__=3.40282347e+38F"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__=(-37)"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__=(-125)"/>
<listOptionValue builtIn="false" value="__FLT_MIN__=1.17549435e-38F"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__=4.9406564584124654e-324"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__DBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__=2.2204460492503131e-16"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__DBL_MAX__=1.7976931348623157e+308"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__DBL_MIN__=2.2250738585072014e-308"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__=4.9406564584124654e-324L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__=2.2204460492503131e-16L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__=1.7976931348623157e+308L"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__=2.2250738585072014e-308L"/>
<listOptionValue builtIn="false" value="__POINTER_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WCHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WINT_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__INT8_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__INT16_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INT32_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INT64_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__=255"/>
<listOptionValue builtIn="false" value="__INT8_MAX__=127"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__INT16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_C_SUFFIX__=U"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__INT32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_C_SUFFIX__=ULL"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__INT64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__=127"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__=255"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__=127"/>
<listOptionValue builtIn="false" value="__INT_FAST8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__=255"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_FAST16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INT_FAST32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_FAST64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__=_"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__GNUC_STDC_INLINE__=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_BOOL_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR16_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR32_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_WCHAR_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_SHORT_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_INT_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_LONG_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_LLONG_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_POINTER_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__NO_INLINE__=1"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__=2"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__=17"/>
<listOptionValue builtIn="false" value="__xcore__=1"/>
<listOptionValue builtIn="false" value="__XS1B__=1"/>
<listOptionValue builtIn="false" value="__STDC__=1"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__STDC_VERSION__=199901L"/>
<listOptionValue builtIn="false" value="__STDC_UTF_16__=1"/>
<listOptionValue builtIn="false" value="__STDC_UTF_32__=1"/>
<listOptionValue builtIn="false" value="XCC_VERSION_YEAR=14"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MONTH=3"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MAJOR=1403"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MINOR=2"/>
<listOptionValue builtIn="false" value="__XCC_HAVE_FLOAT__=1"/>
<listOptionValue builtIn="false" value="_XSCOPE_PROBES_INCLUDE_FILE=&quot;/var/folders/0l/8jd0xy095ps890m302j532580000h5/T//ccVdKn1b.h&quot;"/>
</option>
<option id="com.xmos.c.compiler.option.include.paths.1661660573" name="com.xmos.c.compiler.option.include.paths" superClass="com.xmos.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/clang&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst/images}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/client}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/class}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core/included}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/control}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user}&quot;"/>
</option>
<inputType id="com.xmos.cdt.c.compiler.input.c.1188610778" name="C" superClass="com.xmos.cdt.c.compiler.input.c"/>
</tool>
<tool id="com.xmos.cdt.cxx.compiler.1403352573" name="com.xmos.cdt.cxx.compiler" superClass="com.xmos.cdt.cxx.compiler">
<option id="com.xmos.cxx.compiler.option.defined.symbols.665306874" name="com.xmos.cxx.compiler.option.defined.symbols" superClass="com.xmos.cxx.compiler.option.defined.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__llvm__=1"/>
<listOptionValue builtIn="false" value="__clang__=1"/>
<listOptionValue builtIn="false" value="__clang_major__=3"/>
<listOptionValue builtIn="false" value="__clang_minor__=6"/>
<listOptionValue builtIn="false" value="__clang_patchlevel__=0"/>
<listOptionValue builtIn="false" value="__clang_version__=&quot;3.6.0"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__=2"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__=1"/>
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION=1002"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELAXED=0"/>
<listOptionValue builtIn="false" value="__ATOMIC_CONSUME=1"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQUIRE=2"/>
<listOptionValue builtIn="false" value="__ATOMIC_RELEASE=3"/>
<listOptionValue builtIn="false" value="__ATOMIC_ACQ_REL=4"/>
<listOptionValue builtIn="false" value="__ATOMIC_SEQ_CST=5"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.1"/>
<listOptionValue builtIn="false" value="__CONSTANT_CFSTRINGS__=1"/>
<listOptionValue builtIn="false" value="__GXX_RTTI=1"/>
<listOptionValue builtIn="false" value="__DEPRECATED=1"/>
<listOptionValue builtIn="false" value="__GNUG__=4"/>
<listOptionValue builtIn="false" value="__GXX_WEAK__=1"/>
<listOptionValue builtIn="false" value="__private_extern__=extern"/>
<listOptionValue builtIn="false" value="__ORDER_LITTLE_ENDIAN__=1234"/>
<listOptionValue builtIn="false" value="__ORDER_BIG_ENDIAN__=4321"/>
<listOptionValue builtIn="false" value="__ORDER_PDP_ENDIAN__=3412"/>
<listOptionValue builtIn="false" value="__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__"/>
<listOptionValue builtIn="false" value="__LITTLE_ENDIAN__=1"/>
<listOptionValue builtIn="false" value="_ILP32=1"/>
<listOptionValue builtIn="false" value="__ILP32__=1"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=255"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__=8"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__=2"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__=4"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__=1"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__=4"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INTMAX_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__UINTMAX_C_SUFFIX__=ULL"/>
<listOptionValue builtIn="false" value="__INTMAX_WIDTH__=64"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__PTRDIFF_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INTPTR_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__SIZE_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__SIZE_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WCHAR_WIDTH__=8"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__WINT_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINTMAX_WIDTH__=64"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__UINTPTR_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__=1.40129846e-45F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__FLT_DIG__=6"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__=1.19209290e-7F"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__=24"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__=38"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__=128"/>
<listOptionValue builtIn="false" value="__FLT_MAX__=3.40282347e+38F"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__=(-37)"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__=(-125)"/>
<listOptionValue builtIn="false" value="__FLT_MIN__=1.17549435e-38F"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__=4.9406564584124654e-324"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__DBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__=2.2204460492503131e-16"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__DBL_MAX__=1.7976931348623157e+308"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__DBL_MIN__=2.2250738585072014e-308"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__=4.9406564584124654e-324L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__=1"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__=15"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__=2.2204460492503131e-16L"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__=1"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__=1"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__=53"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__=308"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__=1024"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__=1.7976931348623157e+308L"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__=(-307)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__=(-1021)"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__=2.2250738585072014e-308L"/>
<listOptionValue builtIn="false" value="__POINTER_WIDTH__=32"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WCHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__WINT_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__INT8_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__INT16_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__INT32_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__INT64_C_SUFFIX__=LL"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__UINT8_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__=255"/>
<listOptionValue builtIn="false" value="__INT8_MAX__=127"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__UINT16_C_SUFFIX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__INT16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__UINT32_C_SUFFIX__=U"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__INT32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__UINT64_C_SUFFIX__=ULL"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__INT64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__=127"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__=255"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__=signed"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__=127"/>
<listOptionValue builtIn="false" value="__INT_FAST8_FMTd__=&quot;hhd&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST8_FMTi__=&quot;hhi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__=255"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTo__=&quot;hho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTu__=&quot;hhu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTx__=&quot;hhx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_FMTX__=&quot;hhX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__=32767"/>
<listOptionValue builtIn="false" value="__INT_FAST16_FMTd__=&quot;hd&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST16_FMTi__=&quot;hi&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__=65535"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTo__=&quot;ho&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTu__=&quot;hu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTx__=&quot;hx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_FMTX__=&quot;hX&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__=int"/>
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__INT_FAST32_FMTd__=&quot;d&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST32_FMTi__=&quot;i&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__=4294967295U"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTo__=&quot;o&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTu__=&quot;u&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTx__=&quot;x&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_FMTX__=&quot;X&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INT_FAST64_FMTd__=&quot;lld&quot;"/>
<listOptionValue builtIn="false" value="__INT_FAST64_FMTi__=&quot;lli&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__=long"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__=18446744073709551615ULL"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTo__=&quot;llo&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTu__=&quot;llu&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTx__=&quot;llx&quot;"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_FMTX__=&quot;llX&quot;"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__=_"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_BOOL_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR16_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_CHAR32_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_WCHAR_T_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_SHORT_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_INT_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_LONG_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_LLONG_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__GCC_ATOMIC_POINTER_LOCK_FREE=1"/>
<listOptionValue builtIn="false" value="__NO_INLINE__=1"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__=2"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__=17"/>
<listOptionValue builtIn="false" value="__xcore__=1"/>
<listOptionValue builtIn="false" value="__XS1B__=1"/>
<listOptionValue builtIn="false" value="__STDC__=1"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__cplusplus=199711L"/>
<listOptionValue builtIn="false" value="__STDC_UTF_16__=1"/>
<listOptionValue builtIn="false" value="__STDC_UTF_32__=1"/>
<listOptionValue builtIn="false" value="XCC_VERSION_YEAR=14"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MONTH=3"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MAJOR=1403"/>
<listOptionValue builtIn="false" value="XCC_VERSION_MINOR=2"/>
<listOptionValue builtIn="false" value="__XCC_HAVE_FLOAT__=1"/>
<listOptionValue builtIn="false" value="_XSCOPE_PROBES_INCLUDE_FILE=&quot;/var/folders/0l/8jd0xy095ps890m302j532580000h5/T//cc8vh80e.h&quot;"/>
</option>
<option id="com.xmos.cxx.compiler.option.include.paths.1031009526" name="com.xmos.cxx.compiler.option.include.paths" superClass="com.xmos.cxx.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/clang&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/c++/v1&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst/images}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/client}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/class}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core/included}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user/control}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_logging/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc/rst}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/api}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/doc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib_xud/src/user}&quot;"/>
</option>
<inputType id="com.xmos.cdt.cxx.compiler.input.cpp.223196941" name="C++" superClass="com.xmos.cdt.cxx.compiler.input.cpp"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding=".build*" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="lib_xua.null.1378855182" name="lib_xua"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>

View File

@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>lib_xua</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.xmos.cdt.core.ProjectInfoSyncBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.xmos.cdt.core.LegacyProjectCheckerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.xmos.cdt.core.ModulePathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.xmos.cdt.core.XdeProjectNature</nature>
</natures>
</projectDescription>

View File

@@ -1 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><xproject><repository>lib_xua</repository><partnum>XM-012639-SM</partnum></xproject>

View File

@@ -1,20 +1,22 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_H_
#define _XUA_H_
#ifndef __XUA_H__
#define __XUA_H__
#include <xs1.h>
#include "xua_conf_full.h"
#if __XC__ || __STDC__
#ifndef __ASSEMBLER__
#include "xua_audiohub.h"
#include "xua_endpoint0.h"
#include "xua_buffer.h"
#include "xua_mixer.h"
#endif
#if __XC__
#ifdef __XC__
#include "xua_clocking.h"
#include "xua_midi.h"
#if XUA_NUM_PDM_MICS > 0
#include "xua_pdm_mic.h"
#endif

View File

@@ -1,9 +1,9 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_AUDIOHUB_H__
#define __XUA_AUDIOHUB_H__
#ifndef _XUA_AUDIOHUB_H_
#define _XUA_AUDIOHUB_H_
#if __XC__
#ifdef __XC__
#include "xccompat.h"
#include "xs1.h"
@@ -22,7 +22,7 @@
*
* \param clk_audio_mclk Nullable clockblock to be clocked from master clock
*
* \param clk_audio_mclk Nullable clockblock to be clocked from i2s clock
* \param clk_audio_bclk Nullable clockblock to be clocked from i2s bit clock
*
* \param p_mclk_in Master clock inport port (must be 1-bit)
*
@@ -34,21 +34,23 @@
*
* \param p_i2s_adc Nullable array of ports for I2S data input lines
*
* \param c_dig channel connected to the clockGen() thread for
* \param c_spdif_tx Channel connected to S/PDIF transmiter core from lib_spdif
*
* \param c_dig Channel connected to the clockGen() thread for
* receiving/transmitting samples
*/
void XUA_AudioHub(chanend ?c_aud,
clock ?clk_audio_mclk,
clock ?clk_audio_bclk,
void XUA_AudioHub(chanend ?c_aud,
clock ?clk_audio_mclk,
clock ?clk_audio_bclk,
in port p_mclk_in,
buffered _XUA_CLK_DIR port:32 ?p_lrclk,
buffered _XUA_CLK_DIR port:32 ?p_bclk,
buffered out port:32 (&?p_i2s_dac)[I2S_WIRES_DAC],
buffered out port:32 (&?p_i2s_dac)[I2S_WIRES_DAC],
buffered in port:32 (&?p_i2s_adc)[I2S_WIRES_ADC]
#if (XUA_SPDIF_TX_EN) //&& (SPDIF_TX_TILE != AUDIO_IO_TILE)
#if (XUA_SPDIF_TX_EN) || defined(__DOXYGEN__)
, chanend c_spdif_tx
#endif
#if((SPDIF_RX) || (ADAT_RX))
#if (XUA_SPDIF_RX_EN || XUA_ADAT_RX_EN || defined(__DOXYGEN__))
, chanend c_dig
#endif
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
@@ -78,4 +80,4 @@ void UserBufferManagementInit();
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[]);
#endif // __XUA_AUDIOHUB_H__
#endif // _XUA_AUDIOHUB_H_

View File

@@ -1,72 +1,63 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_BUFFER_H__
#define __XUA_BUFFER_H__
#if __XC__
#include "xua.h"
#include "xua_clocking.h" /* Required for pll_ref_if */
/** USB Audio Buffering Core.
/** USB Audio Buffering Core(s).
*
* This function buffers USB audio data between the XUD layer and the decouple
* thread. Most of the chanend parameters to the function should be connected to
* XUD_Manager()
* This function buffers USB audio data between the XUD and the audio subsystem.
* Most of the chanend parameters to the function should be connected to
* XUD_Manager(). The uses two cores.
*
* \param c_aud_out Audio OUT endpoint channel connected to the XUD
* \param c_aud_in Audio IN endpoint channel connected to the XUD
* \param c_aud_fb Audio feedback endpoint channel connected to the XUD
* \param c_midi_from_host MIDI OUT endpoint channel connected to the XUD
* \param c_midi_to_host MIDI IN endpoint channel connected to the XUD
* \param c_int Audio clocking interrupt endpoint channel connected to the XUD
* \param c_clk_int Optional chanend connected to the clockGen() thread if present
* \param c_sof Start of frame channel connected to the XUD
* \param c_aud_ctl Audio control channel connected to Endpoint0()
* \param p_off_mclk A port that is clocked of the MCLK input (not the MCLK input itself)
* \param c_aud_out Audio OUT endpoint channel connected to the XUD
* \param c_aud_in Audio IN endpoint channel connected to the XUD
* \param c_aud_fb Audio feedback endpoint channel connected to the XUD
* \param c_midi_from_host MIDI OUT endpoint channel connected to the XUD
* \param c_midi_to_host MIDI IN endpoint channel connected to the XUD
* \param c_midi Channel connected to MIDI core
* \param c_int Audio clocking interrupt endpoint channel connected to the XUD
* \param c_clk_int Optional chanend connected to the clockGen() thread if present
* \param c_sof Start of frame channel connected to the XUD
* \param c_aud_ctl Audio control channel connected to Endpoint0()
* \param p_off_mclk A port that is clocked of the MCLK input (not the MCLK input itself)
* \param c_aud Channel connected to XUA_AudioHub() core
* \param i_pll_ref Interface to task that toggles reference pin to CS2100
*/
void XUA_Buffer(
chanend c_aud_out,
#if (NUM_USB_CHAN_IN > 0)
#if (NUM_USB_CHAN_IN > 0) || defined(__DOXYGEN__)
chanend c_aud_in,
#endif
#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP)
chanend c_aud_fb,
#endif
#ifdef MIDI
#if defined(MIDI) || defined(__DOXYGEN__)
chanend c_midi_from_host,
chanend c_midi_to_host,
chanend c_midi,
#endif
#ifdef IAP
chanend c_iap_from_host,
chanend c_iap_to_host,
#ifdef IAP_INT_EP
chanend c_iap_to_host_int,
#endif
chanend c_iap,
#ifdef IAP_EA_NATIVE_TRANS
chanend c_iap_ea_native_out,
chanend c_iap_ea_native_in,
chanend c_iap_ea_native_ctrl,
chanend c_iap_ea_native_data,
#endif
#endif
#if (SPDIF_RX) || (ADAT_RX)
#if XUA_SPDIF_RX_EN || XUA_ADAT_RX_EN || defined(__DOXYGEN__)
chanend ?c_int,
chanend ?c_clk_int,
#endif
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#if( 0 < HID_CONTROLS )
#if (HID_CONTROLS)
, chanend c_hid
#endif
, chanend c_aud
#if (XUA_SYNCMODE == XUA_SYNCMODE_SYNC) || defined(__DOXYGEN__)
, client interface pll_ref_if i_pll_ref
#endif
);
void XUA_Buffer_Ep(chanend c_aud_out,
#if (NUM_USB_CHAN_IN > 0)
#if (NUM_USB_CHAN_IN > 0) || defined(__DOXYGEN__)
chanend c_aud_in,
#endif
#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP)
@@ -77,32 +68,21 @@ void XUA_Buffer_Ep(chanend c_aud_out,
chanend c_midi_to_host,
chanend c_midi,
#endif
#ifdef IAP
chanend c_iap_from_host,
chanend c_iap_to_host,
#ifdef IAP_INT_EP
chanend c_iap_to_host_int,
#endif
chanend c_iap,
#ifdef IAP_EA_NATIVE_TRANS
chanend c_iap_ea_native_out,
chanend c_iap_ea_native_in,
chanend c_iap_ea_native_ctrl,
chanend c_iap_ea_native_data,
#endif
#endif
#if (SPDIF_RX) || (ADAT_RX)
#if (XUA_SPDIF_RX_EN) || (XUA_ADAT_RX_EN)
chanend ?c_int,
chanend ?c_clk_int,
#endif
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#if( 0 < HID_CONTROLS )
#if (HID_CONTROLS)
, chanend c_hid
#endif
#ifdef CHAN_BUFF_CTRL
, chanend c_buff_ctrl
#endif
#if (XUA_SYNCMODE == XUA_SYNCMODE_SYNC) || defined(__DOXYGEN__)
, client interface pll_ref_if i_pll_ref
#endif
);
@@ -116,7 +96,5 @@ void XUA_Buffer_Decouple(chanend c_audio_out
, chanend c_buff_ctrl
#endif
);
#endif
#endif

View File

@@ -1,20 +1,32 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _CLOCKING_H_
#define _CLOCKING_H_
#include <xs1.h>
interface pll_ref_if
{
void toggle();
void init();
void toggle_timed(int relative);
};
[[distributable]]
void PllRefPinTask(server interface pll_ref_if i_pll_ref, out port p_sync);
/** Clock generation and digital audio I/O handling.
*
* \param c_spdif_rx channel connected to S/PDIF receive thread
* \param c_adat_rx channel connect to ADAT receive thread
* \param p port to output clock signal to drive external frequency synthesizer
* \param i_pll_ref interface to taslk that outputs clock signal to drive external frequency synthesizer
* \param c_audio channel connected to the audio() thread
* \param c_clk_ctl channel connected to Endpoint0() for configuration of the
* clock
* \param c_clk_int channel connected to the decouple() thread for clock
interrupts
*/
void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, out port p, chanend c_audio, chanend c_clk_ctl, chanend c_clk_int);
void clockGen(streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interface pll_ref_if i_pll_ref, chanend c_audio, chanend c_clk_ctl, chanend c_clk_int);
#endif

View File

@@ -1,4 +1,4 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
/*
* @brief Defines relating to device configuration and customisation of lib_xua
@@ -11,29 +11,20 @@
#include "xua_conf.h"
#endif
/* Default tile arrangement */
/**
* @brief Location (tile) of audio I/O. Default: 0
*/
#ifndef AUDIO_IO_TILE
#define AUDIO_IO_TILE 0
#define AUDIO_IO_TILE (0)
#endif
/**
* @brief Location (tile) of audio I/O. Default: 0
*/
#ifndef XUD_TILE
#define XUD_TILE 0
#endif
/**
* @brief Location (tile) of IAP. Default: AUDIO_IO_TILE
*/
#ifndef IAP_TILE
#define IAP_TILE AUDIO_IO_TILE
#define XUD_TILE (0)
#endif
/**
@@ -57,11 +48,18 @@
#define PDM_TILE AUDIO_IO_TILE
#endif
/**
* @brief Disable USB functionalty just leaving AudioHub
/**
* @brief Location (tile) of reference signal to CS2100. Default: AUDIO_IO_TILE
*/
#ifndef PLL_REF_TILE
#define PLL_REF_TILE AUDIO_IO_TILE
#endif
/**
* @brief Disable USB functionalty just leaving AudioHub
*/
#ifndef XUA_USB_EN
#define XUA_USB_EN 1
#define XUA_USB_EN (1)
#endif
/**
@@ -83,7 +81,7 @@
/**
* @brief Number of DSD output channels. Default: 0 (disabled)
*/
#if defined(DSD_CHANS_DAC)
#if defined(DSD_CHANS_DAC) && (DSD_CHANS_DAC != 0)
#if defined(NATIVE_DSD) && (NATIVE_DSD == 0)
#undef NATIVE_DSD
#else
@@ -93,20 +91,29 @@
#define DSD_CHANS_DAC 0
#endif
/* TODO not required */
#ifndef I2S_MODE_TDM
#define I2S_MODE_TDM 0
#define XUA_PCM_FORMAT_I2S (0)
#define XUA_PCM_FORMAT_TDM (1)
/**
* @brief Format of PCM audio interface. Should be set to XUA_PCM_FORMAT_I2S or XUA_PCM_FORMAT_TDM
*
* Default: XUA_PCM_FORMAT_I2S
*/
#ifdef XUA_PCM_FORMAT
#if (XUA_PCM_FORMAT != XUA_PCM_FORMAT_I2S) && (XUA_PCM_FORMAT != XUA_PCM_FORMAT_TDM)
#error Bad value for XUA_PCM_FORMAT
#endif
#else
#define XUA_PCM_FORMAT XUA_PCM_FORMAT_I2S
#endif
/**
* @brief Channels per I2S frame. *
*
* Default: 2 i.e standard stereo I2S (8 if using TDM i.e. I2S_MODE_TDM).
* Default: 2 i.e standard stereo I2S (8 if using TDM i.e. XUA_PCM_FORMAT_TDM).
*
**/
#ifndef I2S_CHANS_PER_FRAME
#if (I2S_MODE_TDM == 1)
#if (XUA_PCM_FORMAT == XUA_PCM_FORMAT_TDM)
#define I2S_CHANS_PER_FRAME 8
#else
#define I2S_CHANS_PER_FRAME 2
@@ -183,13 +190,26 @@
*/
#if (I2S_DOWNSAMPLE_MONO_IN == 1)
#define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2)
#if ((I2S_DOWNSAMPLE_FACTOR_IN > 1) && (I2S_MODE_TDM == 1))
#if ((I2S_DOWNSAMPLE_FACTOR_IN > 1) && (XUA_PCM_FORMAT == XUA_PCM_FORMAT_TDM))
#error Mono I2S input downsampling is not avaliable in TDM mode
#endif
#else
#define I2S_DOWNSAMPLE_CHANS_IN I2S_CHANS_ADC
#endif
/**
* @brief Number of bits per channel for I2S/TDM. Supported values: 16/32-bit.
*
* Default: 32 bits
*/
#ifndef XUA_I2S_N_BITS
#define XUA_I2S_N_BITS (32)
#endif
#if (XUA_I2S_N_BITS != 16) && (XUA_I2S_N_BITS != 32)
#error Unsupported value for XUA_I2S_N_BITS (only values 16/32 supported)
#endif
/**
* @brief Max supported sample frequency for device (Hz). Default: 192000
*/
@@ -333,13 +353,8 @@
/**
* @brief Enables ADAT Tx. Default: 0 (Disabled)
*/
#ifndef ADAT_TX
#define ADAT_TX (0)
#endif
/* Tidy up old SPDIF usage */
#if defined(ADAT_TX) && (ADAT_TX == 0)
#undef ADAT_TX
#ifndef XUA_ADAT_TX_EN
#define XUA_ADAT_TX_EN (0)
#endif
/**
@@ -354,15 +369,15 @@
/**
* @brief Enables SPDIF Rx. Default: 0 (Disabled)
*/
#ifndef SPDIF_RX
#define SPDIF_RX (0)
#ifndef XUA_SPDIF_RX_EN
#define XUA_SPDIF_RX_EN (0)
#endif
/**
* @brief Enables ADAT Rx. Default: 0 (Disabled)
*/
#ifndef ADAT_RX
#define ADAT_RX (0)
#ifndef XUA_ADAT_RX_EN
#define XUA_ADAT_RX_EN (0)
#endif
/**
@@ -371,9 +386,9 @@
*
* Default: NONE (Must be defined by app when SPDIF_RX enabled)
*/
#if (SPDIF_RX) || defined (__DOXYGEN__)
#if (XUA_SPDIF_RX_EN) || defined (__DOXYGEN__)
#ifndef SPDIF_RX_INDEX
#error SPDIF_RX_INDEX not defined and SPDIF_RX defined
#error SPDIF_RX_INDEX not defined and XUA_SPDIF_RX_EN defined
#define SPDIF_RX_INDEX 0 /* Default define for doxygen */
#endif
#endif
@@ -382,11 +397,11 @@
* @brief ADAT Rx first channel index. defines which channels ADAT will be input on.
* Note, indexed from 0.
*
* Default: NONE (Must be defined by app when ADAT_RX enabled)
* Default: NONE (Must be defined by app when XUA_ADAT_RX_EN is true)
*/
#if (ADAT_RX) || defined(__DOXYGEN__)
#if (XUA_ADAT_RX_EN) || defined(__DOXYGEN__)
#ifndef ADAT_RX_INDEX
#error ADAT_RX_INDEX not defined and ADAT_RX defined
#error ADAT_RX_INDEX not defined and XUA_ADAT_RX_EN is true
#define ADAT_RX_INDEX (0) /* Default define for doxygen */
#endif
@@ -395,7 +410,7 @@
#endif
#endif
#if ADAT_RX
#if (XUA_ADAT_RX_EN)
/* Setup input stream formats for ADAT */
#if(MAX_FREQ > 96000)
@@ -433,7 +448,42 @@
#define HID_CONTROLS (0)
#endif
/* @brief Defines whether XMOS device runs as master (i.e. drives LR and Bit clocks)
/**
* HID may be required in two forms: the built-in XUA-HID reports, or a
* user-provided static HID. Some sections of code are always needed, they
* are enclosed in XUA_OR_STATIC_HID_ENABLED; code specific to XUA-HID
* reports are enclosed in XUA_HID_ENABLED.
*
* HID_CONTROLS implies that the XUA_HID is used, and hence defines both.
* In order to roll your own, do not enable HID_CONTROLS, but instead
* create a file static_hid_report.h that contains the static descriptor.
*
* You must also supply your own function to deal with the HID endpoint(s)
* in this case.
*/
#if( 0 < HID_CONTROLS )
#define XUA_HID_ENABLED (1)
#define XUA_OR_STATIC_HID_ENABLED (1)
#endif
#if defined(__static_hid_report_h_exists__)
#define XUA_OR_STATIC_HID_ENABLED (1)
#endif
/**
* @brief Enable a HID OUT endpoint. Only use this if you supply your own HID control.
*
* 1 for enabled, 0 for disabled.
*
* Default 0 (Disabled)
*/
#ifndef HID_OUT_REQUIRED
#define HID_OUT_REQUIRED (0)
#endif
/**
* @brief Defines whether XMOS device runs as master (i.e. drives LR and Bit clocks)
*
* 0: XMOS is I2S master. 1: CODEC is I2s master.
*
@@ -452,7 +502,6 @@
#define SERIAL_STR ""
#endif
/**
* @brief Vendor String used by the device. This is also pre-pended to various strings used by the design.
*
@@ -959,43 +1008,32 @@
/* Power */
#define XUA_POWERMODE_SELF (0)
#define XUA_POWERMODE_BUS (1)
/**
* @brief Report as self to the host when enabled, else reports as bus-powered. This affects descriptors
* and XUD usage.
* @brief Report as self or bus powered device. This affects descriptors
* and XUD usage and is important for USB compliance
*
* Default: 0 (Disabled)
* Default: XUA_POWERMODE_BUS
*/
#ifndef SELF_POWERED
#define SELF_POWERED (0)
#endif
/* Tidy-up historical ifndef usage */
#if defined(SELF_POWERED) && (SELF_POWERED==0)
#undef SELF_POWERED
#ifndef XUA_POWERMODE
#define XUA_POWERMODE XUA_POWERMODE_BUS
#endif
/**
* @brief Power drawn from the host (in mA x 2)
*
* Default: 0 when SELF_POWERED enabled else 250 (500mA)
* Default: 0 when self-powered, else 250 (500mA)
*/
#ifdef SELF_POWERED
#if (XUA_POWERMODE == XUA_POWERMODE_SELF)
/* Default to taking no power from the bus in self-powered mode */
#ifndef BMAX_POWER
#define BMAX_POWER 0
#ifndef _XUA_BMAX_POWER
#define _XUA_BMAX_POWER (0)
#endif
#else
/* Default to taking 500mA from the bus in bus-powered mode */
#ifndef BMAX_POWER
#define BMAX_POWER 250
#endif
#endif
#ifndef XUD_PWR_CFG
#ifdef SELF_POWERED
#define XUD_PWR_CFG XUD_PWR_SELF
#else
#define XUD_PWR_CFG XUD_PWR_BUS
#ifndef _XUA_BMAX_POWER
#define _XUA_BMAX_POWER (250)
#endif
#endif
@@ -1010,17 +1048,12 @@
#define MIXER (0)
#endif
/* Tidy up old ifndef usage */
#if defined(MIXER) && (MIXER == 0)
#undef MIXER
#endif
/**
* @brief Number of seperate mixes to perform
*
* Default: 8 if MIXER enabled, else 0
*/
#ifdef MIXER
#if (MIXER)
#ifndef MAX_MIX_COUNT
#define MAX_MIX_COUNT (8)
#endif
@@ -1100,82 +1133,55 @@
#define VOLUME_RES_MIXER (0x100)
#endif
/* Handle out volume control in the mixer */
#if defined(OUT_VOLUME_IN_MIXER) && (OUT_VOLUME_IN_MIXER==0)
#undef OUT_VOLUME_IN_MIXER
#else
#if defined(MIXER)
// Disabled by default
//#define OUT_VOLUME_IN_MIXER
#endif
/* Handle out volume control in the mixer - enabled by default */
#ifndef OUT_VOLUME_IN_MIXER
#define OUT_VOLUME_IN_MIXER (1)
#endif
/* Apply out volume controls after the mix */
#if defined(OUT_VOLUME_AFTER_MIX) && (OUT_VOLUME_AFTER_MIX==0)
#undef OUT_VOLUME_AFTER_MIX
#else
#if defined(MIXER) && defined(OUT_VOLUME_IN_MIXER)
// Enabled by default
#define OUT_VOLUME_AFTER_MIX
#endif
/* Apply out volume controls after the mix. Only relevant when OUT_VOLUME_IN_MIXER enabled. Enabled by default */
#ifndef OUT_VOLUME_AFTER_MIX
#define OUT_VOLUME_AFTER_MIX (1)
#endif
/* Handle in volume control in the mixer */
#if defined(IN_VOLUME_IN_MIXER) && (IN_VOLUME_IN_MIXER==0)
#undef IN_VOLUME_IN_MIXER
#else
#if defined(MIXER)
/* Disabled by default */
//#define IN_VOLUME_IN_MIXER
#endif
/* Handle in volume control in the mixer - disabled by default */
#ifndef IN_VOLUME_IN_MIXER
#define IN_VOLUME_IN_MIXER (0)
#endif
/* Apply in volume controls after the mix */
#if defined(IN_VOLUME_AFTER_MIX) && (IN_VOLUME_AFTER_MIX==0)
#undef IN_VOLUME_AFTER_MIX
#else
#if defined(MIXER) && defined(IN_VOLUME_IN_MIXER)
// Enabled by default
#define IN_VOLUME_AFTER_MIX
#endif
/* Apply in volume controls after the mix. Only relebant when IN_VOLUMNE_IN MIXER enabled. Enabled by default */
#ifndef IN_VOLUME_AFTER_MIX
#define IN_VOLUME_AFTER_MIX (1)
#endif
/* IAP */
#if defined(IAP) && (IAP == 0)
#undef IAP
/* Always enable explicit feedback EP, even when input stream is present */
#ifndef UAC_FORCE_FEEDBACK_EP
#define UAC_FORCE_FEEDBACK_EP (1)
#endif
/* IAP Interrupt endpoint */
#if defined(IAP_INT_EP) && (IAP_INT_EP == 0)
#undef IAP_INT_EP
#endif
/* IAP EA Native Transport */
#if defined(IAP_EA_NATIVE_TRANS) && (IAP_EA_NATIVE_TRANS == 0)
#undef IAP_EA_NATIVE_TRANS
#endif
#if defined(IAP_EA_NATIVE_TRANS) || defined(__DOXYGEN__)
/**
* @brief Number of supported EA Native Interface Alternative settings.
*
* Only 1 supported
*/
#ifndef IAP_EA_NATIVE_TRANS_ALT_COUNT
#define IAP_EA_NATIVE_TRANS_ALT_COUNT 1
#endif
#if (IAP_EA_NATIVE_TRANS_ALT_COUNT > 1)
/* Only 1 supported */
#error
#endif
#endif
#if (defined(UAC_FORCE_FEEDBACK_EP) && UAC_FORCE_FEEDBACK_EP == 0)
#undef UAC_FORCE_FEEDBACK_EP
#endif
/* Synchronisation defines */
#define XUA_SYNCMODE_ASYNC (1) // USB_ENDPOINT_SYNCTYPE_ASYNC
#define XUA_SYNCMODE_ADAPT (2) // USB_ENDPOINT_SYNCTYPE_ADAPT
#define XUA_SYNCMODE_SYNC (3) // USB_ENDPOINT_SYNCTYPE_SYNC
#ifndef XUA_SYNCMODE
#define XUA_SYNCMODE XUA_SYNCMODE_ASYNC
#endif
#if (XUA_SYNCMODE == XUA_SYNCMODE_SYNC)
#if (XUA_SPDIF_RX_EN|| ADAT_RX)
#error "Digital input streams not supported in Sync mode"
#endif
#endif
/*********************************************************/
/*** Internal defines below here. NOT FOR MODIFICATION ***/
/*********************************************************/
#ifndef __ASSEMBLER__
/* Endpoint addresses enums */
enum USBEndpointNumber_In
@@ -1185,13 +1191,13 @@ enum USBEndpointNumber_In
ENDPOINT_NUMBER_IN_FEEDBACK,
#endif
ENDPOINT_NUMBER_IN_AUDIO,
#if (SPDIF_RX) || (ADAT_RX)
#if (XUA_SPDIF_RX_EN) || (XUA_ADAT_RX_EN)
ENDPOINT_NUMBER_IN_INTERRUPT, /* Audio interrupt/status EP */
#endif
#ifdef MIDI
ENDPOINT_NUMBER_IN_MIDI,
#endif
#if( 0 < HID_CONTROLS )
#if XUA_OR_STATIC_HID_ENABLED
ENDPOINT_NUMBER_IN_HID,
#endif
#ifdef IAP
@@ -1218,54 +1224,51 @@ enum USBEndpointNumber_Out
#ifdef IAP_EA_NATIVE_TRANS
ENDPOINT_NUMBER_OUT_IAP_EA_NATIVE_TRANS,
#endif
#endif
#if XUA_OR_STATIC_HID_ENABLED && HID_OUT_REQUIRED
ENDPOINT_NUMBER_OUT_HID,
#endif
XUA_ENDPOINT_COUNT_OUT /* End marker */
};
#ifndef XUA_ENDPOINT_COUNT_CUSTOM_OUT
#define XUA_ENDPOINT_COUNT_CUSTOM_OUT 0
#define XUA_ENDPOINT_COUNT_CUSTOM_OUT (0)
#endif
#ifndef XUA_ENDPOINT_COUNT_CUSTOM_IN
#define XUA_ENDPOINT_COUNT_CUSTOM_IN 0
#define XUA_ENDPOINT_COUNT_CUSTOM_IN (0)
#endif
#define ENDPOINT_COUNT_IN (XUA_ENDPOINT_COUNT_IN + XUA_ENDPOINT_COUNT_CUSTOM_IN)
#define ENDPOINT_COUNT_OUT (XUA_ENDPOINT_COUNT_OUT + XUA_ENDPOINT_COUNT_CUSTOM_OUT)
#define ENDPOINT_COUNT_IN (XUA_ENDPOINT_COUNT_IN + XUA_ENDPOINT_COUNT_CUSTOM_IN)
#define ENDPOINT_COUNT_OUT (XUA_ENDPOINT_COUNT_OUT + XUA_ENDPOINT_COUNT_CUSTOM_OUT)
#endif
#endif /* __ASSEMBLER__ */
/*** Internal defines below here. NOT FOR MODIFICATION ***/
#define AUDIO_STOP_FOR_DFU (0x12345678)
#define AUDIO_START_FROM_DFU (0x87654321)
#define AUDIO_REBOOT_FROM_DFU (0xa5a5a5a5)
#define AUDIO_STOP_FOR_DFU (0x12345678)
#define AUDIO_START_FROM_DFU (0x87654321)
#define AUDIO_REBOOT_FROM_DFU (0xa5a5a5a5)
#define MAX_VOL (0x20000000)
#if defined(SU1_ADC_ENABLE) && (SU1_ADC_ENABLE == 0)
#undef SU1_ADC_ENABLE
#endif
/* Result of db_to_mult(MAX_VOLUME, 8, 29) */
#define MAX_VOLUME_MULT (0x20000000)
#if defined(LEVEL_METER_LEDS) && !defined(LEVEL_UPDATE_RATE)
#define LEVEL_UPDATE_RATE 400000
#define LEVEL_UPDATE_RATE (400000)
#endif
/* The number of clock ticks to wait for the audio feeback to stabalise
* Note, feedback always counts 128 SOFs (16ms @ HS, 128ms @ FS) */
#ifndef FEEDBACK_STABILITY_DELAY_HS
#define FEEDBACK_STABILITY_DELAY_HS (2000000)
#define FEEDBACK_STABILITY_DELAY_HS (2000000)
#endif
#ifndef FEEDBACK_STABILITY_DELAY_FS
#define FEEDBACK_STABILITY_DELAY_FS (20000000)
#define FEEDBACK_STABILITY_DELAY_FS (20000000)
#endif
/* Length of clock unit/clock-selector units */
#if (SPDIF_RX) && (ADAT_RX)
#if (XUA_SPDIF_RX_EN) && (XUA_ADAT_RX_EN)
#define NUM_CLOCKS (3)
#elif (SPDIF_RX) || (ADAT_RX)
#elif (XUA_SPDIF_RX_EN) || (XUA_ADAT_RX_EN)
#define NUM_CLOCKS (2)
#else
#define NUM_CLOCKS (1)
@@ -1346,9 +1349,9 @@ enum USBEndpointNumber_Out
/* Some defines that allow us to remove unused code */
/* Useful for dropping lower part of macs in volume processing... */
#if (FS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS > 24) || (FS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS > 24) || \
(FS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS > 24) || (HS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS > 24) || \
(HS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS > 24) || (HS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS > 24)
#if (FS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS > 24) || (HS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS > 24) || \
(((FS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS > 24) || (HS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS > 24)) && (OUTPUT_FORMAT_COUNT > 1)) || \
(((FS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS > 24) || (HS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS > 24)) && (OUTPUT_FORMAT_COUNT > 2))
#define STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED 1
#else
#define STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED 0
@@ -1480,6 +1483,7 @@ enum USBEndpointNumber_Out
#define _XUA_CLK_DIR out
#endif
#if (CODEC_MASTER == 1) && (DSD_CHANS_DAC != 0)
#error CODEC_MASTER with DSD is currently unsupported
#if (CODEC_MASTER == 1) && (DSD_CHANS_DAC != 0)
#error CODEC_MASTER with DSD is currently unsupported
#endif

View File

@@ -1,7 +1,7 @@
// Copyright 2017-2021 XMOS LIMITED.
// Copyright 2017-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_CONF_FULL_H__
#define __XUA_CONF_FULL_H__
#ifndef _XUA_CONF_FULL_H_
#define _XUA_CONF_FULL_H_
#ifdef __xua_conf_h_exists__
#include "xua_conf.h"
@@ -9,6 +9,4 @@
#include "xua_conf_default.h"
#endif

View File

@@ -1,36 +1,41 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_ENDPOINT0_H_
#define _XUA_ENDPOINT0_H_
#include "xua.h"
#include "dfu_interface.h"
#include "vendorrequests.h"
#if __XC__
/** Function implementing Endpoint 0 for enumeration, control and configuration
* of USB audio devices. It uses the descriptors defined in ``descriptors_2.h``.
*
* \param c_ep0_out Chanend connected to the XUD_Manager() out endpoint array
* \param c_ep0_in Chanend connected to the XUD_Manager() in endpoint array
* \param c_audioCtrl Chanend connected to the decouple thread for control
* audio (sample rate changes etc.). Note when nulled, the
* audio device only supports single sample rate/format and
* DFU is not supported either since this channel is used
* to carry messages about format, rate and DFU state
* \param c_mix_ctl Optional chanend to be connected to the mixer thread if
* present
* \param c_clk_ctl Optional chanend to be connected to the clockgen thread if
* present.
* \param c_usb_test Optional chanend to be connected to XUD if test modes required.
* of USB audio devices. It uses the descriptors defined in ``xua_ep0_descriptors.h``.
*
* \param c_ep0_out Chanend connected to the XUD_Manager() out endpoint array
* \param c_ep0_in Chanend connected to the XUD_Manager() in endpoint array
* \param c_audioCtrl Chanend connected to the decouple thread for control
* audio (sample rate changes etc.). Note when nulled, the
* audio device only supports single sample rate/format and
* DFU is not supported either since this channel is used
* to carry messages about format, rate and DFU state
* \param c_mix_ctl Optional chanend to be connected to the mixer core(s) if
* present
* \param c_clk_ctl Optional chanend to be connected to the clockgen core if
* present
* \param dfuInterface Interface to DFU task (this task must be run on a tile
* connected to boot flash.
* \param c_EANativeTransport_ctrl Optional chanend to be connected to EA Native
* endpoint manager if present
*/
void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend ?c_audioCtrl,
chanend ?c_mix_ctl,chanend ?c_clk_ctl, chanend ?c_EANativeTransport_ctr, client interface i_dfu ?dfuInterface
VENDOR_REQUESTS_PARAMS_DEC_);
void XUA_Endpoint0(chanend c_ep0_out,
chanend c_ep0_in, chanend ?c_audioCtrl,
chanend ?c_mix_ctl, chanend ?c_clk_ctl,
chanend ?c_EANativeTransport_ctrl,
client interface i_dfu ?dfuInterface
#if !defined(__DOXYGEN__)
VENDOR_REQUESTS_PARAMS_DEC_
#endif
);
/** Function to set the Vendor ID value
*

View File

@@ -1,34 +1,40 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __usb_midi_h__
#define __usb_midi_h__
#ifndef _XUA_MIDI_H_
#define _XUA_MIDI_H_
#include "xua.h"
/** USB MIDI I/O thread.
#ifndef MIDI_SHIFT_TX
#define MIDI_SHIFT_TX (0)
#endif
/** USB MIDI I/O task.
*
* This function passes MIDI data from USB to UART I/O.
* This function passes MIDI data between XUA_Buffer and MIDI UART I/O.
*
* \param p_midi_in 1-bit input port for MIDI
* \param p_midi_out 1-bit output port for MIDI
* \param clk_midi clock block used for clockin the UART; should have
* a rate of 100MHz
* \param c_midi chanend connected to the decouple() thread
* \param cable_number the cable number of the MIDI implementation.
* \param p_midi_in 1-bit input port for MIDI
* \param p_midi_out 1-bit output port for MIDI
* \param clk_midi Clock block used for clockin the UART; should have
* a rate of 100MHz
* \param c_midi Chanend connected to the decouple() thread
* \param cable_number The cable number of the MIDI implementation.
* This should be set to 0.
**/
void usb_midi(
#if (MIDI_RX_PORT_WIDTH == 4)
buffered in port:4 ?p_midi_in,
buffered in port:4 ?p_midi_in,
#else
buffered in port:1 ?p_midi_in,
buffered in port:1 ?p_midi_in,
#endif
port ?p_midi_out,
clock ?clk_midi,
chanend ?c_midi,
unsigned cable_number,
chanend ?c_iap, chanend ?c_i2c, // iOS stuff
unsigned cable_number
#ifdef IAP
, chanend ?c_iap, chanend ?c_i2c, // iOS stuff
port ?p_scl, port ?p_sda
#endif
);
#define MAX_USB_MIDI_PACKET_SIZE 1024
@@ -72,4 +78,4 @@ INLINE void midi_send_ack(chanend c) {
#define MIDI_RATE (31250)
#define MIDI_BITTIME (XS1_TIMER_MHZ * 1000000 / MIDI_RATE)
#define MIDI_BITTIME_2 (MIDI_BITTIME>>1)
#endif // __usb_midi_h__
#endif // _XUA_MIDI_H_

View File

@@ -1,7 +1,9 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2023 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __mixer_h__
#define __mixer_h__
#ifndef _XUA_MIXER_H_
#define _XUA_MIXER_H_
#include "xua.h"
enum mix_ctl_cmd {
SET_SAMPLES_TO_HOST_MAP,
@@ -31,4 +33,14 @@ enum mix_ctl_cmd {
*/
void mixer(chanend c_to_host, chanend c_to_audio, chanend c_mix_ctl);
#define XUA_MIXER_OFFSET_OUT (0)
#define XUA_MIXER_OFFSET_IN (NUM_USB_CHAN_OUT)
#define XUA_MIXER_OFFSET_MIX (NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN)
#define XUA_MIXER_OFFSET_OFF (NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN + MAX_MIX_COUNT)
/* Defines uses for DB to actual muliplier conversion */
#define XUA_MIXER_MULT_FRAC_BITS (25)
#define XUA_MIXER_DB_FRAC_BITS (8)
#define XUA_MIXER_MAX_MULT (1<<XUA_MIXER_MULT_FRAC_BITS) /* i.e. multiply by 0 */
#endif

Binary file not shown.

27
lib_xua/doc/rst/add.rst Normal file
View File

@@ -0,0 +1,27 @@
Additional Features
-------------------
The previous sections describes only the basic core set of ``lib_xua`` details on enabling additional features e.g. S/PDIF are discussed in this section.
Where something must be defined, it is recommended this is done in `xua_conf.h` but could also be done in the application Makefile.
For each feature steps are listed for if calling ``lib_xua`` functions manually - if using the "codeless" programming model then these steps are informational only.
Each section also includes a sub-section on enabling the feature using the "codeless" model.
For full details of all options please see the API section
.. toctree::
S/PDIF Transmit <feat_spdif_tx>

12
lib_xua/doc/rst/api.rst Normal file
View File

@@ -0,0 +1,12 @@
.. _sec_api:
API Reference
*************
.. toctree::
api_defines
api_user_functions
api_component

View File

@@ -0,0 +1,35 @@
.. _sec_api_component:
Component API
=============
The following functions can be called from the top level main of an
application and implement the various components described in
:ref:`usb_audio_sec_architecture`.
When using the USB audio framework the ``c_ep_in`` array is always
composed in the following order:
* Endpoint 0 (in)
* Audio Feedback endpoint (if output enabled)
* Audio IN endpoint (if input enabled)
* MIDI IN endpoint (if MIDI enabled)
* Clock Interrupt endpoint
The array ``c_ep_out`` is always composed in the following order:
* Endpoint 0 (out)
* Audio OUT endpoint (if output enabled)
* MIDI OUT endpoint (if MIDI enabled)
.. doxygenfunction:: XUA_Endpoint0
.. doxygenfunction:: XUA_Buffer
.. doxygenfunction:: XUA_AudioHub
.. doxygenfunction:: mixer
.. doxygenfunction:: clockGen
.. doxygenfunction:: usb_midi

View File

@@ -0,0 +1,179 @@
.. _sec_api_defines:
Configuration Defines
=====================
An application using the USB audio framework needs to have defines set for configuration.
Defaults for these defines are found in ``xua_conf_default.h``.
These defines should be over-ridden in an optional header file ``xua_conf.h`` file or in the ``Makefile``
for a relevant build configuration.
This section fully documents all of the settable defines and their default values (where appropriate).
Code Location (tile)
--------------------
.. doxygendefine:: AUDIO_IO_TILE
.. doxygendefine:: XUD_TILE
.. doxygendefine:: MIDI_TILE
.. doxygendefine:: SPDIF_TX_TILE
.. doxygendefine:: PDM_TILE
.. doxygendefine:: PLL_REF_TILE
Channel Counts
--------------
.. doxygendefine:: NUM_USB_CHAN_OUT
.. doxygendefine:: NUM_USB_CHAN_IN
.. doxygendefine:: I2S_CHANS_DAC
.. doxygendefine:: I2S_CHANS_ADC
Frequencies and Clocks
----------------------
.. doxygendefine:: MAX_FREQ
.. doxygendefine:: MIN_FREQ
.. doxygendefine:: DEFAULT_FREQ
.. doxygendefine:: MCLK_441
.. doxygendefine:: MCLK_48
Audio Class
-----------
.. doxygendefine:: AUDIO_CLASS
.. doxygendefine:: AUDIO_CLASS_FALLBACK
.. doxygendefine:: FULL_SPEED_AUDIO_2
Feature Configuration
---------------------
I2S/TDM
^^^^^^^
.. doxygendefine:: I2S_CHANS_DAC
.. doxygendefine:: I2S_CHANS_ADC
.. doxygendefine:: CODEC_MASTER
.. doxygendefine:: XUA_I2S_N_BITS
.. doxygendefine:: XUA_PCM_FORMAT
MIDI
^^^^
.. doxygendefine:: MIDI
.. doxygendefine:: MIDI_RX_PORT_WIDTH
S/PDIF
^^^^^^
.. doxygendefine:: XUA_SPDIF_TX_EN
.. doxygendefine:: SPDIF_TX_INDEX
.. doxygendefine:: XUA_SPDIF_RX_EN
.. doxygendefine:: SPDIF_RX_INDEX
ADAT
^^^^
.. doxygendefine:: XUA_ADAT_RX_EN
.. doxygendefine:: ADAT_RX_INDEX
PDM Microphones
^^^^^^^^^^^^^^^
.. doxygendefine:: XUA_NUM_PDM_MICS
DFU
^^^
.. doxygendefine:: XUA_DFU_EN
.. .. doxygendefine:: DFU_FLASH_DEVICE
HID
^^^
.. doxygendefine:: HID_CONTROLS
CODEC Interface
^^^^^^^^^^^^^^^
.. doxygendefine:: CODEC_MASTER
USB Device Configuration
------------------------
.. doxygendefine:: VENDOR_STR
.. doxygendefine:: VENDOR_ID
.. doxygendefine:: PRODUCT_STR
.. doxygendefine:: PRODUCT_STR_A2
.. doxygendefine:: PRODUCT_STR_A1
.. doxygendefine:: PID_AUDIO_1
.. doxygendefine:: PID_AUDIO_2
.. doxygendefine:: BCD_DEVICE
Stream Formats
--------------
Output/Playback
^^^^^^^^^^^^^^^
.. doxygendefine:: OUTPUT_FORMAT_COUNT
.. doxygendefine:: STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS
.. doxygendefine:: STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS
.. doxygendefine:: STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS
.. doxygendefine:: HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES
.. doxygendefine:: HS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES
.. doxygendefine:: HS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES
.. doxygendefine:: FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES
.. doxygendefine:: FS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES
.. doxygendefine:: FS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES
.. doxygendefine:: STREAM_FORMAT_OUTPUT_1_DATAFORMAT
.. doxygendefine:: STREAM_FORMAT_OUTPUT_2_DATAFORMAT
.. doxygendefine:: STREAM_FORMAT_OUTPUT_3_DATAFORMAT
Input/Recording
^^^^^^^^^^^^^^^
.. doxygendefine:: INPUT_FORMAT_COUNT
.. doxygendefine:: STREAM_FORMAT_INPUT_1_RESOLUTION_BITS
.. doxygendefine:: HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES
.. doxygendefine:: FS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES
.. doxygendefine:: STREAM_FORMAT_INPUT_1_DATAFORMAT
Volume Control
--------------
.. doxygendefine:: OUTPUT_VOLUME_CONTROL
.. doxygendefine:: INPUT_VOLUME_CONTROL
.. doxygendefine:: MIN_VOLUME
.. doxygendefine:: MAX_VOLUME
.. doxygendefine:: VOLUME_RES
Mixing
------
.. doxygendefine:: MIXER
.. doxygendefine:: MAX_MIX_COUNT
.. doxygendefine:: MIX_INPUTS
.. doxygendefine:: MIN_MIXER_VOLUME
.. doxygendefine:: MAX_MIXER_VOLUME
.. doxygendefine:: VOLUME_RES_MIXER
Power
-----
.. doxygendefine:: XUA_POWERMODE

View File

@@ -0,0 +1,74 @@
Required User Function Definitions
==================================
The following functions need to be defined by an application using the XMOS USB Audio framework.
External Audio Hardware Configuration Functions
-----------------------------------------------
.. c:function:: void AudioHwInit(chanend ?c_codec)
This function is called when the audio core starts after the
device boots up and should initialize the external audio harware e.g. clocking, DAC, ADC etc
:param c_codec: An optional chanend that was original passed into
:c:func:`audio` that can be used to communicate
with other cores.
.. c:function:: void AudioHwConfig(unsigned samFreq, unsigned mclk, chanend ?c_codec, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC)
This function is called when the audio core starts or changes
sample rate. It should configure the extenal audio hardware to run at the specified
sample rate given the supplied master clock frequency.
:param samFreq: The sample frequency in Hz that the hardware should be configured to (in Hz).
:param mclk: The master clock frequency that is required in Hz.
:param c_codec: An optional chanend that was original passed into
:c:func:`audio` that can be used to communicate
with other cores.
:param dsdMode: Signifies if the audio hardware should be configured for DSD operation
:param sampRes_DAC: The sample resolution of the DAC stream
:param sampRes_ADC: The sample resolution of the ADC stream
Audio Streaming Functions
-------------------------
The following functions can be optionally used by the design. They can be useful for mute lines etc.
.. c:function:: void AudioStreamStart(void)
This function is called when the audio stream from device to host
starts.
.. c:function:: void AudioStreamStop(void)
This function is called when the audio stream from device to host stops.
Host Active
-----------
The following function can be used to signal that the device is connected to a valid host.
This is called on a change in state.
.. c:function:: void AudioStreamStart(int active)
:param active: Indicates if the host is active or not. 1 for active else 0.
HID Controls
------------
The following function is called when the device wishes to read physical user input (buttons etc).
.. c:function:: void UserReadHIDButtons(unsigned char hidData[])
:param hidData: The function should write relevant HID bits into this array. The bit ordering and functionality is defined by the HID report descriptor used.

92
lib_xua/doc/rst/arch.rst Normal file
View File

@@ -0,0 +1,92 @@
.. _usb_audio_sec_architecture:
Software Architecture
*********************
This section describes the required software architecture of a USB Audio device implemented using `lib_xua`, its dependencies and other supporting libraries.
`lib_xua` provides fundamental building blocks for producing USB Audio products on XMOS devices. Every system is required to have the components from `lib_xua` listed in :ref:`usb_audio_shared_components`.
.. tabularcolumns:: lp{5cm}l
.. _usb_audio_shared_components:
.. list-table:: Required XUA Components
:header-rows: 1
:widths: 40 60
* - Component
- Description
* - Endpoint 0
- Provides the logic for Endpoint 0 which handles
enumeration and control of the device including DFU related requests.
* - Endpoint buffer
- Buffers endpoint data packets to and from the host. Manages delivery of audio packets between the endpoint buffer
component and the audio components. It can also handle volume control processing. Note, this currently utilises two cores
* - AudioHub
- Handles audio I/O over I2S and manages audio data
to/from other digital audio I/O components.
In addition low-level USB I/0 is required and is provided by the external dependency `lib_xud`
.. tabularcolumns:: lp{5cm}l
.. list-table:: Additional Components Required
:header-rows: 1
:widths: 100 60
* - Component
- Description
* - XMOS USB Device Driver (XUD)
- Handles the low level USB I/O.
In addition :ref:`usb_audio_optional_components` shows optional components that can be added/enabled from within `lib_xua`
.. tabularcolumns:: lp{5cm}l
.. _usb_audio_optional_components:
.. list-table:: Optional Components
:header-rows: 1
:widths: 40 60
* - Component
- Description
* - Mixer
- Allows digital mixing of input and output channels. It can also
handle volume control instead of the decoupler.
* - Clockgen
- Drives an external frequency generator (PLL) and manages
changes between internal clocks and external clocks arising
from digital input.
* - MIDI
- Outputs and inputs MIDI over a serial UART interface.
`lib_xua` also provides optional support for integrating with the following external dependencies listed in :ref:`usb_audio_external_components`
.. tabularcolumns:: lp{5cm}l
.. _usb_audio_external_components:
.. list-table:: External Components
:header-rows: 1
:widths: 40 60
* - Component
- Description
* - S/PDIF Transmitter (lib_spdif)
- Outputs samples of an S/PDIF digital audio interface.
* - S/PDIF Receiver (lib_spdif)
- Inputs samples of an S/PDIF digital audio interface (requires the
clockgen component).
* - ADAT Receiver (lib_adat)
- Inputs samples of an ADAT digital audio interface (requires the
clockgen component).
* - PDM Microphones (lib_mic_array)
- Receives PDM data from microphones and performs PDM to PCM conversion
.. _usb_audio_threads:
.. figure:: images/threads-crop.*
:width: 100%
USB Audio Core Diagram
:ref:`usb_audio_threads` shows how the components interact with each
other in a typical system. The green circles represent cores with arrows indicating inter-core communications.

View File

@@ -1,117 +1,24 @@
Features & Options
------------------
Additional Features
*******************
The previous chapter describes the use of core functionality contained within ``lib_xua``
This seciton details enabling additional features with supported external dependencies, for example,
``lib_xua`` can provide S/PDIF output though the used of ``lib_spdif``
Where something must be defined, it is recommended this is done in `xua_conf.h` but could also be done in the application Makefile.
.. toctree::
S/PDIF Transmit <feat_spdif_tx>
S/PDIF Receive <feat_spdif_rx>
The previous sections describes only the basic core set of ``lib_xua`` details on enabling additional features e.g. S/PDIF are discussed in this section.
Where something must be defined, it is recommened this is done in `xua_conf.h` but could also be done in the application Makefile.
For each feature steps are listed for if calling ``lib_xua`` functions manually - if using the "codeless" programming model then these steps informational only.
Each section also includes a sub-section on enabling the feature using the "codeless" model.
For full details of all options please see the API section
I2S/TDM
~~~~~~~
I2S/TDM is typically fundamental to most products and is built into the ``XUA_AudioHub()`` core.
In order to enable I2S on must declare an array of ports for the data-lines (one for each direction)::
/* Port declarations. Note, the defines come from the xn file */
buffered out port:32 p_i2s_dac[] = {PORT_I2S_DAC0}; /* I2S Data-line(s) */
buffered in port:32 p_i2s_adc[] = {PORT_I2S_ADC0}; /* I2S Data-line(s) */
Ports for the sample and bit clocks are also required::
buffered out port:32 p_lrclk = PORT_I2S_LRCLK; /* I2S Bit-clock */
buffered out port:32 p_bclk = PORT_I2S_BCLK; /* I2S L/R-clock */
.. note::
All of these ports must be buffered, width 32. Based on whether the xCORE is bus slave/master the ports must be declared as input/output respectively
These ports must then be passed to the ``XUA_AudioHub()`` task appropriately.
I2S functionality also requires two clock-blocks, one for bit and sample clock e.g.::
/* Clock-block declarations */
clock clk_audio_bclk = on tile[0]: XS1_CLKBLK_4; /* Bit clock */
clock clk_audio_mclk = on tile[0]: XS1_CLKBLK_5; /* Master clock */
These hardware resources must be passed into the call to ``XUA_AudioHub()``::
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
on tile[0]: XUA_AudioHub(c_aud, clk_audio_mclk, clk_audio_bclk, p_mclk_in, p_lrclk, p_bclk);
Codeless Programming Model
..........................
All ports and hardware resources are already fully declared, one must simply set the following:
* `I2S_CHANS_DAC` must be set to the desired number of output channels via I2S
* `I2S_CHANS_ADC` must be set to the desired number of input channels via I2S
* `AUDIO_IO_TILE` must be set to the tile where the physical I2S connections reside
For configuration options, master vs slave, TDM etc please see the API section.
|newpage|
S/PDIF Transmit
~~~~~~~~~~~~~~~
``lib_xua`` supports the development of devices with S/PDIF transmit functionality through the use of
``lib_spdif``. The XMOS S/PDIF transmitter runs in a single core and supports rates up to 192kHz.
The S/PDIF transmitter core takes PCM audio samples via a channel and outputs them in S/PDIF format to a port.
Samples are provided to the S/PDIF transmitter task from the ``XUA_AudioHub()`` task.
The channel should be declared a normal::
chan c_spdif_tx
In order to use the S/PDIF transmmiter with ``lib_xua`` hardware resources must be declared e.g::
buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT; /* SPDIF transmit port */
This port should be clocked from the master-clock, ``lib_spdif`` provides a helper function for setting up the port::
spdif_tx_port_config(p_spdif_tx2, clk_audio_mclk, p_mclk_in, delay);
.. note:: If sharing the master-clock port and clockblock with ``XUA_AudioHub()`` (or any other task) then this setup
should be done before running the tasks in a ``par`` statement.
Finally the S/PDIF transmitter task must be run - passing in the port and channel for communication with ``XUA_AudioHub``.
For example::
par
{
while(1)
{
/* Run the S/PDIF transmitter task */
spdif_tx(p_spdif_tx2, c_spdif_tx);
}
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
/* Note, since we are not using I2S we pass in null for LR and Bit clock ports and the I2S dataline ports */
XUA_AudioHub(c_aud, clk_audio_mclk, null, p_mclk_in, null, null, null, null, c_spdif_tx);
}
For further details please see the documentation, application notes and examples provided for ``lib_spdif``.
Codeless Programming Model
..........................
If using the codeless programming method one must simply ensure the following:
* `PORT_SPDIF_OUT` is correctly defined in the XN file
* `XUA_SPDIF_TX_EN` should be defined as non-zero
* `SPDIF_TX_TILE` is correctly defined (note, this defaults to `AUDIO_IO_TILE`)
For further configuration options please see the API section.

View File

@@ -0,0 +1,52 @@
S/PDIF Receive
==============
``lib_xua`` supports the development of devices with S/PDIF receive functionality through the use of
``lib_spdif``. The XMOS S/PDIF receiver runs in a single core and supports rates up to 192kHz.
The S/PDIF receiver inputs data via a port and outputs samples via a channel. It requires a 1-bit port
which must be 4-bit buffered. For example::
buffered in port:4 p_spdif_rx = PORT_SPDIF_IN;
It also requires a clock-block, for example::
clock clk_spd_rx = XS1_CLKBLK_1;
Finally, a channel for the output samples must be declared, note, this should be a streaming channel::
streaming chan c_spdif_rx;
The S/PDIF receiver should be called on the appropriate tile::
spdif_rx(c_spdif_rx,p_spdif_rx,clk_spd_rx,192000);
.. note::
It is recomended to use the value 192000 for the ``sample_freq_estimate`` parameter
With the steps above an S/PDIF stream can be captured by the xCORE. To be functionally useful the audio
master clock must be able to synchronise to this external digital stream. Additionally, the host can be
notified regarding changes in the validity of this stream, it's frequency etc. To synchronise to external
streams the codebase assumes the use of an external Cirrus Logic CS2100 device.
The ``ClockGen()`` task from ``lib_xua`` provides the reference signal to the CS2100 device and also handles
recording of clock validity etc. See :ref:`usb_audio_sec_clock_recovery` for full details regarding ``ClockGen()``.
It also provides a small FIFO for S/PDIF samples before they are forwarded to the ``AudioHub`` core.
As such it requires to be inserted in the communication path between the S/PDIF receiver and the
``AudioHub`` core. For example::
chan c_dig_rx;
streaming chan c_spdif_rx;
par
{
SpdifReceive(..., c_spdif_rx, ...);
clockGen(c_spdif_rx, ..., c_dig_rx, ...);
XUA_AudioHub(..., c_dig_rx, ...);
}

View File

@@ -0,0 +1,47 @@
S/PDIF Transmit
===============
``lib_xua`` supports the development of devices with S/PDIF transmit functionality through the use of
``lib_spdif``. The XMOS S/PDIF transmitter runs in a single core and supports rates up to 192kHz.
The S/PDIF transmitter core takes PCM audio samples via a channel and outputs them in S/PDIF format to a port.
Samples are provided to the S/PDIF transmitter task from the ``XUA_AudioHub()`` task.
The channel should be declared as normal::
chan c_spdif_tx
In order to use the S/PDIF transmitter with ``lib_xua`` a 1-bit port must be declared e.g::
buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT; /* SPDIF transmit port */
This port should be clocked from the master-clock, ``lib_spdif`` provides a helper function for setting up the port::
spdif_tx_port_config(p_spdif_tx, clk_audio_mclk, p_mclk_in, delay);
.. note:: If sharing the master-clock port and clockblock with ``XUA_AudioHub()`` (or any other task) then this setup
should be done before running the tasks in a ``par`` statement.
Finally the S/PDIF transmitter task must be run - passing in the port and channel for communication with ``XUA_AudioHub``.
For example::
par
{
while(1)
{
/* Run the S/PDIF transmitter task */
spdif_tx(p_spdif_tx, c_spdif_tx);
}
/* AudioHub/IO core does most of the audio IO i.e. I2S (also serves as
* a hub for all audio).
* Note, since we are not using I2S we pass in null for LR and Bit
* clock ports and the I2S dataline ports */
XUA_AudioHub(c_aud, clk_audio_mclk, null, p_mclk_in, null, null,
null, null, c_spdif_tx);
}
For further details please see the documentation, application notes and examples provided for ``lib_spdif``.

View File

@@ -4,59 +4,118 @@ XMOS USB Audio Hardware Platforms
A range of hardware platforms for evaluating USB Audio on XMOS devices.
Specific, in depth, details for each platform/board are out of scope of this library documentation however, the features of the most popular platform are described below with the view of providing a worked example.
Specific details for each platform/board are out of scope of this library documentation however, the features of the most popular platform are described below with the view of providing a worked example.
Please also see application note AN00246.
xCORE-200 Multi-Channel Audio Board
xCORE.AI Multichannel Audio Board
...................................
`The XMOS xCORE-200 Multi-channel Audio board <https://www.xmos.com/support/boards?product=18334>`_
(XK-AUDIO-216-MC) is a complete hardware and reference software platform targeted at up to 32-channel USB and networked audio applications, such as DJ decks and mixers.
The XMOS xCORE.ai Multichannel Audio board (XK-AUDIO-316-MC) is a complete hardware and reference software platform targeted at up to 32-channel USB audio applications, such as DJ decks and mixers and other musical instrument interfaces. The board can also be used to prototype products with smaller feature sets or HiFi style products.
The Multichannel Audio Platform hardware is based around the XE216-512-TQ128 multicore microcontroller; an dual-tile xCORE-200 device with an integrated High Speed USB 2.0 PHY, RGMII (Gigabit Ethernet) interface and 16 logical cores delivering up to 2000MIPS of deterministic and responsive processing power.
The Multichannel Audio Platform hardware is based around the XU316-1024-TQ128-C24 multicore microcontroller; an dual-tile xCORE.ai device with an integrated High Speed USB 2.0 PHY and 16 logical cores delivering up to 3200MIPS of deterministic and responsive processing power.
Exploiting the flexible programmability of the xCORE-200 architecture, the Multi-channel Audio Platform supports either USB or network audio source, streaming 8 analogue input and 8 analogue output audio channels simultaneously - at up to 192kHz.
Exploiting the flexible programmability of the xCORE.ai architecture, the Multi-channel Audio Platform supports either USB or network audio source, streaming 8 analogue input and 8 analogue output audio channels simultaneously - at up to 192kHz.
For full details regarding the hardware please refer to `xCORE-200 Multichannel Audio Platform Hardware Manual <https://www.xmos.com/support/boards?product=18334&component=18687>`_.
The reference board has an associated firmware application that uses `lib_xua` to implemented a USB Audio Devicce. Full details of this application can be found in the USB Audio Design Guide.
The reference board has an associated firmware application that uses `lib_xua` to implemented a USB Audio Device. Full details of this application can be found later in this document.
Analogue Input & Output
+++++++++++++++++++++++
A total of eight single-ended analog input channels are provided via 3.5mm stereo jacks. Each is fed into a CirrusLogic CS5368 ADC.
Similarly a total of eight single-ended analog output channels are provided. Each is fed into a CirrusLogic CS4384 DAC.
A total of eight single-ended analog input channels are provided via 3.5mm stereo jacks. These inputs feed into a pair of quad-channel PCM1865 ADCs from Texas Instruments.
The four digital I2S/TDM input and output channels are mapped to the xCORE input/outputs through a header array. This jumper allows channel selection when the ADC/DAC is used in TDM mode
A total of eight single-ended analog output channels are provided. These a fed from a for PCM5122 stereo DAC's from Texas instruments.
ADC's and DAC's are configured via an I2C bus.
The four digital I2S/TDM input and output channels are mapped to the xCORE input/outputs through a header array. These jumpers allow channel selection when the ADC/DAC is used in TDM mode
Digital Input & Output
++++++++++++++++++++++
Optical and coaxial digital audio transmitters are used to provide digital audio input output in formats such as IEC60958 consumer mode (S/PDIF) and ADAT.
The output data streams from the xCORE-200 are re-clocked using the external master clock to synchronise the data into the audio clock domain. This is achieved using simple external D-type flip-flops.
The output data streams from the xCORE are re-clocked using the external master clock to synchronise the data into the audio clock domain. This is achieved using simple external D-type flip-flops.
MIDI
++++
MIDI I/O is provided on the board via standard 5-pin DIN connectors. The signals are buffered using 5V line drivers and are then connected to 1-bit ports on the xCORE-200, via a 5V to 3.3V buffer.
MIDI I/O is provided on the board via standard 5-pin DIN connectors. The signals are buffered using 5V line drivers and are then connected to 1-bit ports on the xCORE, via a 5V to 3.3V buffer.
Audio Clocking
++++++++++++++
A flexible clocking scheme is provided for both audio and other system services. In order to accommodate a multitude of clocking options, the low-jitter master clock is generated locally using a frequency multiplier PLL chip. The chip used is a Phaselink PL611-01, which is pre-programmed to provide a 24MHz clock from its CLK0 output, and either 24.576 MHz or 22.5792MHz from its CLK1 output.
In order to accommodate a multitude of clocking options a flexible clocking scheme is provided for the audio subsystem.
The 24MHz fixed output is provided to the xCORE-200 device as the main processor clock. It also provides the reference clock to a Cirrus Logic CS2100, which provides a very low jitter audio clock from a synchronisation signal provided from the xCORE-200.
Three methods of generating an audio master clock are provided on the board:
* A Cirrus Logic CS2100-CP PLL device. The CS2100 features both a clock generator and clock multiplier/jitter reduced clock frequency synthesizer (clean up) and can generate a low jitter audio clock based on a synchronisation signal provided by the xCORE
* A Skyworks Si5351B PLL device. The Si5351 is an I2C configurable clock generator that is ideally suited for replacing crystals, crystal oscillators, VCXOs, phase-locked loops (PLLs), and fanout buffers.
* xCORE.ai devices are equipped with a secondary (or 'application') PLL which can be used to generate audio clocks
Selection between these methods is done via writing to bits 6 and 7 of PORT 8D on tile[0].
Either the locally generated clock (from the PL611) or the recovered low jitter clock (from the CS2100) may be selected to clock the audio stages; the xCORE-200, the ADC/DAC and Digital output stages. Selection is controlled via an additional I/O, bit 5 of PORT 8C, see :ref:`hw_316_ctrlport`.
.. _hw_316_ctrlport:
Control I/O
+++++++++++
4 bits of PORT 8C are used to control external hardware on the board. This is described in :ref:`table_316_ctrlport`.
.. _table_316_ctrlport:
.. table:: PORT 8C functionality
:class: horizontal-borders vertical_borders
+--------+-----------------------------------------+------------+------------+
| Bit(s) | Functionality | 0 | 1 |
+========+=========================================+============+============+
| [0:3] | Unused | | |
+--------+-----------------------------------------+------------+------------+
| 4 | Enable 3v3 power for digital (inverted) | Enabled | Disabled |
+--------+-----------------------------------------+------------+------------+
| 5 | Enable 3v3 power for analogue | Disabled | Enabled |
+--------+-----------------------------------------+------------+------------+
| 6 | PLL Select | CS2100 | Si5351B |
+--------+-----------------------------------------+------------+------------+
| 7 | Master clock direction | Output | Input |
+--------+-----------------------------------------+------------+------------+
.. note::
To use the xCORE application PLL bit 7 should be set to 0. To use one of the external PLL's bit 7 should be set to 1.
Either the locally generated clock (from the PL611) or the recovered low jitter clock (from the CS2100) may be selected to clock the audio stages; the xCORE-200, the ADC/DAC and Digital output stages. Selection is conntrolled via an additional I/O, bit 5 of PORT 8C.
LEDs, Buttons and Other IO
++++++++++++++++++++++++++
An array of 4*4 green LEDs, 3 buttons and a switch are provided for general purpose user interfacing. The LED array is driven by eight signals each controlling one of 4 rows and 4 columns.
All programmable I/O on the board is configured for 3v3.
A standard XMOS xSYS interface is provided to allow host debug of the board via JTAG.
For green LED's and three push buttons are provided for general purpose user interfacing.
|newpage|
The LEDs are connected to PORT 4F and the buttons are connected to bits [0:2] of PORT 4E. Bit 3 of this port is connected to the (currently
unused) ADC interrupt line.
The board also includes support for an AES11 format Word Clock input via 75 ohm BNC. The software does not support this currently and it is
provided for future expansion.
All spare IO and Functional IO brought out on headers for easy connection of expansion boards (via 0.1” headers).
Power
+++++
The board is capable of acting as a USB2.0 self or bus powered device. If bus powered, board takes power from ``USB DEVICE`` connector (micro-B receptacle).
If self powered, board takes power from ``EXTERNAL POWER`` input (micro-B receptacle).
A Power Source Select (marked ``PWR SRC``) is used to select between bus and self-powered configuration.
Debug
+++++
For convenience the board includes an on-board xTAG4 for debugging via JTAG/xSCOPE. This is accessed via the USB (micro-B) receptacle marked ``DEBUG``.

View File

@@ -1,39 +0,0 @@
.. include:: ../../../README.rst
About This Document
-------------------
This document describes the structure of the library, its use and resources required. It also covers some implementation detail.
This document assumes familiarity with the XMOS xCORE architecture, the Universal Serial Bus 2.0 Specification (and related specifications),
the XMOS tool chain and XC language.
Host System Requirements
------------------------
USB Audio devices built using `lib_xua` have the following host system requirements.
- Mac OSX version 10.6 or later
- Windows Vista, 7, 8 or 10 with Thesycon Audio Class 2.0 driver for Windows (Tested against version 3.20). Please contact XMOS for details.
- Windows Vista, 7, 8 or 10 with built-in USB Audio Class 1.0 driver.
Older versions of Windows are not guaranteed to operate as expected. Devices are also expected to operate with various Linux distributions including mobile variants.
.. toctree::
Overview <overview>
Hardware Platforms <hw>
Software Overview <sw>
Using lib_xua <using>
Features <feat>
Software Detail <sw_detail>
Known Issues <issues>
.. include:: ../../../CHANGELOG.rst

View File

@@ -1,20 +1,34 @@
|appendix|
Known Issues
------------
************
- Quad-SPI DFU will corrupt the factory image with tools version < 14.0.4 due to an issue with libquadflash
- (#14762) When in DSD mode with S/PDIF output enabled, DSD samples are transmitted over S/PDIF if the DSD and S/PDIF channels are shared, this may or may not be desired
- When in DSD mode with S/PDIF output enabled, DSD samples are transmitted over S/PDIF if the DSD and S/PDIF channels are shared, this may or may not be desired (#14762)
- (#14173) I2S input is completely disabled when DSD output is active - any input stream to the host will contain 0 samples
- I2S input is completely disabled when DSD output is active - any input stream to the host will contain 0 samples (#14173)
- (#14780) Operating the design at a sample rate of less than or equal to the SOF rate (i.e. 8kHz at HS, 1kHz at FS) may expose a corner case relating to 0 length packet handling in both the driver and device and should be considered un-supported at this time.
- Operating the design at a sample rate of less than or equal to the SOF rate (i.e. 8kHz at HS, 1kHz at FS) may expose a corner case relating to 0 length packet handling in both the driver and device and should be considered unsupported at this time (#14780)
- (#14883) Before DoP mode is detected a small number of DSD samples will be played out as PCM via I2S
- Before DoP mode is detected a small number of DSD samples will be played out as PCM via I2S (lib_xua #162)
- (#14887) Volume control settings currently affect samples in both DSD and PCM modes. This results in invalid DSD output if volume control not set to 0
- Volume control settings currently affect samples in both DSD and PCM modes. This results in invalid DSD output if volume control not set to 0 (#14887)
- Windows XP volume control very sensitive. The Audio 1.0 driver built into Windows XP (usbaudio.sys) does not properly support master volume AND channel volume controls, leading to a very sensitive control. Descriptors can be easily modified to disable master volume control if required (one byte - bmaControls(0) in Feature Unit descriptors)
- 88.2kHz and 176.4kHz sample frequencies are not exposed in Windows control panels. These are known OS restrictions.
- 88.2kHz and 176.4kHz sample frequencies are not exposed in Windows control panels. These are known OS restrictions.
- When DFU flash access fails the device NAKS the host indefinitely (sw_usb_audio #54)
- Host mixer app (xmos_mixer) is currently not provided (lib_xua #279)
- In synchronous mode there is no nice transition of the reference signal when moving between internal and SOF clocks (lib_xua #275)
- Binary images exceeding FLASH_MAX_UPGRADE_SIZE fail silently on DFU download (lib_xua #165)
- UAC 1.0 mode assumes device always has input. A run time exception occurs if this is not the case (lib_xua #58)
- No support for I2S_CHANS_DAC = 0 and I2S_CHANS_ADC = 0 (lib_xua #260)

View File

@@ -0,0 +1,25 @@
.. include:: ../../../README.rst
About This Document
===================
This document describes the structure of ``lib_xua``, its use and resources required. It also covers some implementation detail.
This document assumes familiarity with the XMOS xCORE architecture, the Universal Serial Bus 2.0 Specification (and related specifications),
the XMOS tool chain and XC language.
.. toctree::
Overview <overview>
Software Architecture <arch>
Basic Usage <using>
Options <opt>
Advanced Usage <using_adv>
Additional Features <feat>
Implementation Detail <sw>
API <api>
Known Issues <issues>

37
lib_xua/doc/rst/opt.rst Normal file
View File

@@ -0,0 +1,37 @@
.. _sec_options:
Options
*******
This section describes key options of ``lib_xua``. These are typically controlled using build time defines.
Where something must be defined, it is recommended this is done in `xua_conf.h` but could also be done in the application Makefile.
For full details of all options please see ::ref:`sec_api`.
.. toctree::
Strings <opt_strings>
Code Location <opt_location>
Channel Counts and Sample Rates <opt_channels>
USB Audio Class Support <opt_audio_class>
Synchronisation <opt_sync>
I2S/TDM <opt_i2s>
S/PDIF Transmit <opt_spdif_tx>
S/PDIF Receive <opt_spdif_rx>
MIDI <opt_midi>
PDM Microphones <opt_pdm>
Mixer <opt_mixer>
Direct Stream Digital (DSD) <opt_dsd>
USB Audio Formats <opt_audio_formats>
Other Options <opt_other>

View File

@@ -1,33 +1,40 @@
USB Audio Class Version Support
-------------------------------
|newpage|
The XMOS USB Audio framework supports both USB Audio Class 1.0 and Audio Class 2.0.
USB Audio Class Version
=======================
USB Audio Class 2.0 offers many improvements over USB Audio Class 1.0, most notable is the complete support for high-speed operation. This means that Audio Class devices are no longer limited to full-speed operation allowing greater channel counts, sample frequencies and sample bit-depths. Additional improvement, amoungst others, include:
The codebase supports USB Audio Class versions 1.0 and 2.0.
USB Audio Class 2.0 offers many improvements over USB Audio Class 1.0, most notable is the complete
support for high-speed operation. This means that Audio Class devices are no longer limited to
full-speed operation allowing greater channel counts, sample frequencies and sample bit-depths.
Additional improvements, amongst others, include:
- Added support for multiple clock domains, clock description and clock control
- Extensive support for interrupts to inform the host about dynamic changes that occur to different entities such as Clocks etc
Driver Support
~~~~~~~~~~~~~~
--------------
Audio Class 1.0
+++++++++++++++
^^^^^^^^^^^^^^^
Audio Class 1.0 is fully supported in Apple OSX. Audio Class 1.0 is fully supported in all modern Microsoft Windows operating systems (i.e. Windows XP and later).
Audio Class 2.0
+++++++++++++++
^^^^^^^^^^^^^^^
Audio Class 2.0 is fully supported in Apple OSX since version 10.6.4. Audio Class 2.0 is not supported natively by Windows operating systems. It is therefore required that a driver is installed. Documentation of Windows drivers is beyond the scope of this document, please contact XMOS for further details.
Audio Class 2.0 is fully supported in Apple OSX since version 10.6.4. Starting with Windows 10, release 1703, a USB Audio 2.0 driver is shipped with Windows.
Third party Windows drivers are also available, however, documentation of these is beyond the scope of this document, please contact XMOS for further details.
Audio Class 1.0 Mode and Fall-back
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----------------------------------
The normal default for XMOS USB Audio applications is to run as a high-speed Audio Class 2.0
The default for XMOS USB Audio applications is to run as a high-speed Audio Class 2.0
device. However, some products may prefer to run in Audio Class 1.0 mode, this is normally to
allow "driver-less" operation with Windows operating systems.
allow "driver-less" operation with older versions of Windows operating systems.
.. note::
@@ -41,7 +48,7 @@ The device will operate in full-speed Audio Class 1.0 mode if one of the followi
to the host over a full speed link (and the Audio Class fall back is
enabled).
The options to control this behavior are detailed in :ref:`usb_audio_sec_custom_defines_api`.
The options to control this behavior are detailed in :ref:`sec_api_defines`.
When running in Audio Class 1.0 mode the following restrictions are applied:
@@ -55,3 +62,29 @@ Due to bandwidth limitations of full-speed USB the following sample-frequency re
- Sample rate is limited to a maximum of 96kHz if only input *or* output is enabled.
Related Defines
---------------
:ref:`opt_audio_class_defines` descibes the defines that effect audio class selection.
.. _opt_audio_class_defines:
.. list-table:: Audio Class defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``AUDIO_CLASS``
- Audio Class version (1 or 2)
- N/A (*must* be defined)
* - ``AUDIO_CLASS_FALLBACK``
- Enable audio class fallback functionalty
- ``0`` (disabled)
.. note::
Enabling USB Audio Class fallback functionality may have USB Compliance implications

View File

@@ -0,0 +1,135 @@
|newpage|
.. _sec_opt_audio_formats:
Audio Stream Formats
====================
The design currently supports up to three different stream formats for playback, selectable at
run time. This is implemented using standard Alternative Settings to the Audio Streaming interfaces.
An Audio Streaming interface can have Alternate Settings that can be used to change certain characteristics
of the interface and underlying endpoint. A typical use of Alternate Settings is to provide a way to
change the subframe size and/or number of channels on an active Audio Streaming interface.
Whenever an Audio Streaming interface requires an isochronous data endpoint, it must at least provide
the default Alternate Setting (Alternate Setting 0) with zero bandwidth requirements (no isochronous
data endpoint defined) and an additional Alternate Setting that contains the actual isochronous
data endpoint. This zero bandwidth alternative setting 0 is always implemented by the design.
For further information refer to 3.16.2 of `USB Audio Device Class Definition for Audio Devices <http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip>`_
Customisable parameters for the Alternate Settings provided by the design are as follows.:
* Audio sample resolution
* Audio sample subslot size
* Audio data format
.. note::
Currently only a single format is supported for the recording stream
By default the design exposes two sets of Alternative Settings for the playback Audio Streaming interface, one for 16-bit and another for
24-bit playback. When DSD is enabled an additional (32-bit) alternative is exposed.
Audio Subslot
-------------
An audio subslot holds a single audio sample. See `USB Device Class Definition for Audio Data Formats
<http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip>`_ for full details.
This is represented by `bSubslotSize` in the devices descriptor set.
An audio subslot always contains an integer number of bytes. The specification limits the possible
audio subslot size to 1, 2, 3 or 4 bytes per audio subslot.
Since the xCORE is a 32-bit machine the value 4 is typically used for `bSubSlot` - this means that
packing/unpacking samples to/from packets is trivial. Other values can, however, be used and the design
supports values 4, 3 and 2.
Values other than 4 may be used for the following reasons:
* Bus-bandwidth needs to be efficiently utilised. For example maximising channel-count/sample-rates in
full-speed operation.
* To support restrictions with certain hosts. For example many Android based hosts support only 16bit
samples in a 2-byte subslot.
`bSubSlot` size is set using the following defines:
* When running in high-speed:
* `HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES`
* `HS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES`
* `HS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES`
* When running in full-speed:
* `FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES`
* `FS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES`
* `FS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES`
Audio Sample Resolution
-----------------------
An audio sample is represented using a number of bits (`bBitResolution`) less than or equal to the number
of total bits available in the audio subslot i.e. `bBitResolution` <= `bSubslotSize` * 8). The design
supports values 16, 24 and 32.
`bBitResolution` is set using the following defines:
* When operating at high-speed:
* `HS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS`
* `HS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS`
* `HS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS`
* When operating at full-speed:
* `FS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS`
* `FS_STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS`
* `FS_STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS`
Audio Format
------------
The design supports two audio formats, PCM and, when "Native" DSD is enabled, Direct Stream Digital (DSD).
A DSD capable DAC is required for the latter.
The USB Audio `Raw Data` format is used to indicate DSD data (2.3.1.7.5 of `USB Device Class
Definition for Audio Data Formats <http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip>`_).
This use of a RAW/DSD format in an alternative setting is termed by XMOS as *Native DSD*
The following defines affect both full-speed and high-speed operation:
* STREAM_FORMAT_OUTPUT_1_DATAFORMAT
* STREAM_FORMAT_OUTPUT_2_DATAFORMAT
* STREAM_FORMAT_OUTPUT_3_DATAFORMAT
The following options are supported:
* UAC_FORMAT_TYPEI_RAW_DATA
* UAC_FORMAT_TYPEI_PCM
.. note::
Currently DSD is only supported on the output/playback stream
.. note::
4 byte slot size with a 32 bit resolution is required for RAW/DSD format
Native DSD requires driver support and is available in the Thesycon Windows driver via ASIO.

View File

@@ -0,0 +1,73 @@
|newpage|
Channel Counts and Sample Rates
===============================
The codebase is fully configurable in relation to channel counts and sample rates.
Practical limitations of these are normally based on USB packet size restrictions and I/O
availablity.
For example, the maximum packet size for high-speed USB is 1024 bytes, limiting the channel count
to 10 channels for a device running at 192kHz with 32bit sample depth.
The defines in :ref:`opt_channel_defines` set the channel counts exposed to the USB host.
.. tabularcolumns:: lp{5cm}l
.. _opt_channel_defines:
.. list-table:: Channel count defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``NUM_USB_CHAN_OUT``
- Number of output channels the device advertises to the USB host
- N/A (must be defined)
* - ``NUM_USB_CHAN_IN``
- Number of input channels the device advertises to the USB host
- N/A (must be defined)
Sample rates ranges are set by the defines in :ref:`opt_channel_sr_defines`. The codebase will
automatically populate the device sample rate list with popular frequencies between the min and
max values. All values are in Hz:
.. tabularcolumns:: lp{5cm}l
.. _opt_channel_sr_defines:
.. list-table:: Sample rate defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``MAX_FREQ``
- Maximum supported sample rate (Hz)
- ``192000``
* - ``MIN_FREQ``
- Minimum supported sample rate (Hz)
- ``44100``
* - ``DEFAULT_FREQ``
- Starting frequency for the device after boot
- ``MIN_FREQ``
The codebase requires knowledge of the two master clock frequencies that will be present on the
master-clock port(s). One for 44.1kHz, 88.2kHz etc and one for 48kHz, 96kHz etc. These are set
using defines in :ref:`opt_channel_mc_defines`. All values are in Hz.
.. tabularcolumns:: lp{5cm}l
.. _opt_channel_mc_defines:
.. list-table:: Master clock rate defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``CLK_441``
- Master clock defines for 44100 rates (Hz)
- ``(256 * 44100)``
* - ``MCLK_48``
- Master clock defines for 48000 rates (Hz)
- ``(256 * 48000)``

104
lib_xua/doc/rst/opt_dsd.rst Normal file
View File

@@ -0,0 +1,104 @@
|newpage|
Direct Stream Digital (DSD)
===========================
Direct Stream Digital (DSD) is used for digitally encoding audio signals on Super Audio CDs (SACD).
It uses pulse-density modulation (PDM) encoding.
The codebase supports DSD playback from the host via "DSD over PCM" (DoP) and a "Native" implementation
which is, while USB specification based, proprietary to XMOS.
DSD is enabled with by setting the define in :ref:`opt_dsd_defines` to a non-zero value.
.. _opt_dsd_defines:
.. list-table:: DSD defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``DSD_CHANS_DAC``
- Number of DSD channels
- ``0`` (Disabled)
Typically this would be set to ``2`` for stereo output.
By default both "Native" and DoP functionality are enabled when DSD is enabled. The Native DSD implementation uses
an alternative streaming interface such that the host can inform the device that DSD data is being streamed.
See: ::ref:`sec_opt_audio_formats` for details.
If only DoP functionality is desired the Native implementation can be disabled with the define in
:ref:`opt_nativedsd_defines`.
.. _opt_nativedsd_defines:
.. list-table:: Native DSD defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``NATIVE_DSD``
- Enable/Disable "Native" DSD implementation
- ``1`` (Enabled)
DSD over PCM (DoP)
------------------
DoP support follows the method described in the `DoP Open Standard 1.1
<http://dsd-guide.com/sites/default/files/white-papers/DoP_openStandard_1v1.pdf>`_.
While Native DSD support is available in Windows though a driver, OSX incorporates a USB driver
that only supports PCM, this is also true of the central audio engine, CoreAudio. It is
therefore not possible to use the "Native" scheme defined above using the built in driver of OSX.
Since the Apple OS only allows a PCM path a method of transporting DSD audio data over PCM frames
has been developed.
Standard DSD has a sample size of 1 bit and a sample rate of 2.8224MHz - this is 64x the speed of a
compact disc (CD). This equates to the same data-rate as a 16 bit PCM stream at 176.4kHz.
In order to clearly identify when this PCM stream contains DSD and when it contains PCM some header
bits are added to the sample. A 24-bit PCM stream is therefore used, with the most significant
byte being used for a DSD marker (alternating 0x05 and 0xFA values).
When enabled, if USB audio design detects a un-interrupted run of these samples (above a defined
threshold) it switches to DSD mode, using the lower 16-bits as DSD sample data. When this check for
DSD headers fails the design falls back to PCM mode. DoP detection and switching is done completely
in the Audio/I2S core (`audio.xc`). All other code handles the audio samples as PCM.
The design supports higher DSD/DoP rates (i.e. DSD128) by simply raising the underlying PCM sample
rate e.g. from 176.4kHz to 352.8kHz. The marker byte scheme remains exactly the same regardless
of rate.
.. note::
DoP requires bit-perfect transmission - therefore any audio/volume processing will break the stream.
"Native" vs DoP
---------------
Since the DoP specification requires header bytes this eats into the data bandwidth. The "Native" implementation
has no such overhead and can therefore transfer the same DSD rate and half the effective PCM rate of DoP.
Such a property may be desired when upporting DSD128 without exposing a 352.8kHz PCM rate, for example.
Ports
-----
The codebase expects 1-bit ports to be defined in the application XN file for the DSD data and
clock lines for example::
<Port Location="XS1_PORT_1M" Name="PORT_DSD_DAC0"/>
<port Location="XS1_PORT_1N" Name="PORT_DSD_DAC1"/>
<Port Location="XS1_PORT_1G" Name="PORT_DSD_CLK"/>
.. note::
The DSD ports may or may not overlap the I2S ports - the codebase will reconfigure the ports as appropriate
when switching between PCM and DSD modes.

View File

@@ -0,0 +1,60 @@
|newpage|
I2S/TDM
=======
I2S/TDM is typically fundamental to most products and is built into the ``XUA_AudioHub()`` core.
The defines in :ref:`opt_i2s_defines` effect the I2S implementation.
.. tabularcolumns:: lp{5cm}l
.. _opt_i2s_defines:
.. list-table:: I2S defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``I2S_CHANS_DAC``
- The desired number of output channels via I2S (0 for disabled)
- N/A (Must be defined)
* - ``I2S_CHANS_ADC``
- The desired number of input channels via I2S (0 for disabled)
- N/A (Must be defined)
* - ``XUA_PCM_FORMAT``
- Enables either TDM or I2S mode
- ``XUA_PCM_FORMAT_I2S``
* - ``CODEC_MASTER``
- Sets if xCORE is I2S master or slave
- ``0`` (xCORE is master)
* - ``XUA_I2S_N_BITS``
- I2S/TDM word length (16, 32-bit supported)
- ``32``
The I2S code expects that the ports required for I2S (master clock, LR-clock, bit-clock and data lines) are be defined in the application XN file in the relevant `Tile``.
For example::
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1A" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1B" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1C" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1D" Name="PORT_I2S_DAC0"/>
<port Location="XS1_PORT_1E" Name="PORT_I2S_DAC1"/>
<Port Location="XS1_PORT_1F" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_1G" Name="PORT_I2S_ADC1"/>
</Tile>
All of the I2S/TDM related ports must be 1-bit ports.
.. note::
TDM mode allows 8 channels (rather than 2) to be supplied on each data-line.
.. note::
Data output/input is in "I2S" format, rather than, say "left-justified" or "right-justified" formats.
I2S format specifies a single bit-clock delay after the LR-clock transition before sample-data is driven/received.
This also applies to TDM mode. TDM support in ADC/DAC hardware is quite varied, an "offset" value may need to be programmed into
the external device for compatible operation.

View File

@@ -0,0 +1,44 @@
|newpage|
Code Location
=============
When designing a system there is a choice as to which hardware resources to use for each interface.
In a multi-tile system the codebase needs to be informed as to which tiles to use for these hardware
resources and associated code.
A series of defines are used to allow the programmer to easily move code between tiles. Arguably the
most important of these are ``AUDIO_IO_TILE`` and ``XUD_TILE``. :ref:`opt_location_defines` shows a
full listing of these ``TILE`` defines.
.. tabularcolumns:: lp{5cm}l
.. _opt_location_defines:
.. list-table:: Tile defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``AUDIO_IO_TILE``
- Tile on which I2S/TDM, ADAT Rx, S/PDIF Rx & mixer resides
- ``0``
* - ``XUD_TILE``
- Tile on which USB resides, including buffering for all USB interfaces/endppoints
- ``0``
* - ``MIDI_TILE``
- Tile on which MIDI resides
- Same as ``AUDIO_IO_TILE``
* - ``SPDIF_TX_TILE``
- Tile on which S/PDIF Tx resides
- Same as ``AUDIO_IO_TILE``
* - ``PDM_TILE``
- Tile on which PDM microphones resides
- Same as ``AUDIO_IO_TILE``
* - ``PLL_REF_TILE``
- Tile on which reference signal to CS2100 resides
- Same as ``AUDIO_IO_TILE``
.. note::
It should be ensured that the relevant port defines in the application XN file match the code location defines

View File

@@ -0,0 +1,54 @@
|newpage|
MIDI
====
The codebase supports MIDI input/output over USB as per `Universal Serial Bus Device Class Definition for MIDI Devices <https://www.usb.org/sites/default/files/midi10.pdf>`_.
MIDI functionality is enabled with the define in :ref:`opt_midi_defines`.
.. _opt_midi_defines:
.. list-table:: MIDI enable define
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``MIDI``
- Enable MIDI functionality
- ``0`` (Disabled)
The codebase supports MIDI receive on a 4-bit or 1-bit port, defaulting to using a 1-bit port.
MIDI transmit is supported port of any bit-width. By default the codebase assumes the transmit
and receive I/O is connected to bit[0] of the port. This is configurable for the transmit port.
:ref:`opt_midi_defines` provides information on the configuring these parameters.
.. _opt_midi_port_defines:
.. list-table:: MIDI port defines
:header-rows: 1
:widths: 20 80 20
* - Define
- Description
- Default
* - ``MIDI_RX_PORT_WIDTH``
- Port width of the MIDI rx port (1 or 4bit)
- ``1`` (1-bit port)
* - ``MIDI_SHIFT_TX``
- MIDI tx bit
- ``0`` (bit[0])
The MIDI code expects that the ports for receive and transmit are defined in the application XN file in the relevant Tile.
The expected names for the ports are ``PORT_MIDI_IN`` and ``PORT_MIDI_OUT``, for example::
<Tile Number="0" Reference="tile[0]">
<!-- MIDI -->
<Port Location="XS1_PORT_1F" Name="PORT_MIDI_IN"/>
<Port Location="XS1_PORT_4C" Name="PORT_MIDI_OUT"/>
</Tile>

Some files were not shown because too many files have changed in this diff Show More